summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed a problem where m_register_info was not beingSean Callanan2010-11-301-1/+2
| | | | | | | | | copied by the copy constructor for ClangExpressionVariable. This meant that a NULL m_register_info wouldn't be copied, and instead the field was uninitialized, potentially confusing the materializer. llvm-svn: 120472
* Moved the code in ClangUserExpression that set up & ran the thread plan with ↵Jim Ingham2010-11-302-303/+76
| | | | | | | | | | timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it. Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened. llvm-svn: 120386
* Added a feature where registers can be referred toSean Callanan2010-11-303-5/+145
| | | | | | | | | | | using special $-variables from expressions. (lldb) expr $rip These variables are available for reading and writing. llvm-svn: 120367
* Fix build error when lldb is being built i386.Jason Molenda2010-11-291-3/+5
| | | | llvm-svn: 120322
* Made GetVariableValue() more robust in the faceSean Callanan2010-11-201-0/+11
| | | | | | | | of failures in the AST importer. Also ensured that a variable will not be blindly added if GetVariableValue() returns an error. llvm-svn: 119889
* Removed a stray dump().Sean Callanan2010-11-201-3/+1
| | | | llvm-svn: 119888
* Change the DWARFExpression::Evaluate methods to take an optionalJason Molenda2010-11-202-38/+114
| | | | | | | | | | | | | | RegisterContext* - normally this is retrieved from the ExecutionContext's StackFrame but when we need to evaluate an expression while creating the stack frame list this can be a little tricky. Add DW_OP_deref_size, needed for the _sigtramp FDE expression. Add support for processing DWARF expressions in RegisterContextLLDB. Update callers to DWARFExpression::Evaluate. llvm-svn: 119885
* Modifications to type handling logic. We no longerSean Callanan2010-11-192-34/+43
| | | | | | | | | perform recursive type lookups, because these are not required for full type fidelity. We also make the SelectorTable last for the full lifetime of the Clang compiler; this was the source of many bugs. llvm-svn: 119835
* Added support for indicating to the expression parserSean Callanan2010-11-192-6/+14
| | | | | | | | | | that the result of an expression should be coerced to a specific type. Also made breakpoint conditions pass in the bool type for this type. The expression parser ignores this indication for now. llvm-svn: 119779
* Added some logging back and cleaned up the code to match LLDB's codingGreg Clayton2010-11-191-118/+110
| | | | | | conventions. llvm-svn: 119771
* Fixed the logic in IRForTarget that recognizesSean Callanan2010-11-181-4/+4
| | | | | | | externally-defined variables to match up with the code in ClangASTSource that produces them. llvm-svn: 119750
* Updated to the LLVM/Clang of 2010-11-17 at 3:30pm.Sean Callanan2010-11-182-1/+5
| | | | llvm-svn: 119677
* The thread plan destructors may call Thread virtual methods. That means ↵Jim Ingham2010-11-181-1/+2
| | | | | | they have to get cleaned up in the derived class's destructor. Make sure that happens. llvm-svn: 119675
* Added support for constant strings of the form @"this-is-a-string".Sean Callanan2010-11-171-39/+349
| | | | | | | They are replaced with calls to the CoreFoundation function CFStringCreateWithBytes() by a portion of the IRForTarget pass. llvm-svn: 119582
* Whitespace fix.Sean Callanan2010-11-171-1/+0
| | | | llvm-svn: 119581
* Added an "Interrupted" bit to the ProcessEventData. Halt now generates an eventJim Ingham2010-11-171-47/+50
| | | | | | | | | with the Interrupted bit set. Process::HandlePrivateEvent ignores Interrupted events. DoHalt is changed to ensure that the stop even is processed, and an event with the Interrupted event is posted. Finally ClangFunction is rationalized to use this facility so the that Halt is handled more deterministically. llvm-svn: 119453
* First attempt and getting "const" C++ method function signatures correct.Greg Clayton2010-11-161-4/+20
| | | | | | | It currently isn't working, but it should be close. I will work on this more when I figure out what I am not doing correctly. llvm-svn: 119324
* Added quotes around names that are being lookup up or inspected in the Greg Clayton2010-11-151-26/+26
| | | | | | | | | | | expression logging. Added some properties to the "objc" test. The expression parser can currently display properties that are backed by the default functions "expr myStr.string" will work. But it won't currently work when the property is backed by a different function such as "expr myStr.date". llvm-svn: 119103
* Added recursive name lookup logging with depth which is commented out and is ↵Greg Clayton2010-11-151-0/+4
| | | | | | currently only enabled when we blow the stack. llvm-svn: 119101
* Just like functions can have a basename and a mangled/demangled name, variableGreg Clayton2010-11-141-27/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | can too. So now the lldb_private::Variable class has support for this. Variables now have support for having a basename ("i"), and a mangled name ("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i"). Nowwhen searching for a variable by name, users might enter the fully qualified name, or just the basename. So new test functions were added to the Variable and Mangled classes as: bool NameMatches (const ConstString &name); bool NameMatches (const RegularExpression &regex); I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search for global variables that are not in the current file scope by first starting with the current module, then moving on to all modules. Fixed an issue in the DWARF parser that could cause a varaible to get parsed more than once. Now, once we have parsed a VariableSP for a DIE, we cache the result even if a variable wasn't made so we don't do any re-parsing. Some DW_TAG_variable DIEs don't have locations, or are missing vital info that stops a debugger from being able to display anything for it, we parse a NULL variable shared pointer for these DIEs so we don't keep trying to reparse it. llvm-svn: 119085
* Got namespace lookup working and was able to print a complex "this" as anGreg Clayton2010-11-132-10/+19
| | | | | | | | | | | | | | expression. This currently takes waaaayyyyy too much time to evaluate. We will need to look at the expression parser and find ways to optimize the info we provide and get this to evaluate quicker. I believe the performance issue is currently related to us always providing a complete C++ class type when asked about a C++ class which can cause a lot of information to be pulled since all classes will be fully created (methods, base classes, members, all their types). We will need to give the classes back the parser and mark them as having external sources and get parser (Sema) to query us when it needs more info. This should bring things up to an acceptable level. llvm-svn: 118979
* Modified the lldb_private::Type clang type resolving code to handle threeGreg Clayton2010-11-134-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | cases when getting the clang type: - need only a forward declaration - need a clang type that can be used for layout (members and args/return types) - need a full clang type This allows us to partially parse the clang types and be as lazy as possible. The first case is when we just need to declare a type and we will complete it later. The forward declaration happens only for class/union/structs and enums. The layout type allows us to resolve the full clang type _except_ if we have any modifiers on a pointer or reference (both R and L value). In this case when we are adding members or function args or return types, we only need to know how the type will be laid out and we can defer completing the pointee type until we later need it. The last type means we need a full definition for the clang type. Did some renaming of some enumerations to get rid of the old "DC" prefix (which stands for DebugCore which is no longer around). Modified the clang namespace support to be almost ready to be fed to the expression parser. I made a new ClangNamespaceDecl class that can carry around the AST and the namespace decl so we can copy it into the expression AST. I modified the symbol vendor and symbol file plug-ins to use this new class. llvm-svn: 118976
* Trivial fix for an error message.Johnny Chen2010-11-101-1/+1
| | | | llvm-svn: 118697
* Did a lot of code cleanup.Greg Clayton2010-11-091-13/+9
| | | | | | | | Fixed the DWARF plug-in such that when it gets all attributes for a DIE, that it omits the DW_AT_sibling and DW_AT_declaration when getting attributes from a DW_AT_abstract_origin or DW_AT_specification DIE. llvm-svn: 118654
* Fixed an issue in the DWARF parser that was causing forward declarationsGreg Clayton2010-11-091-39/+39
| | | | | | | | | | | | to not get resolved. Fixed the "void **isa_ptr" variable inside the objective C verifier to start with a '$' character so we don't go looking for it in our program. Moved the lookup for "$__lldb_class" into the part that knows we are looking for internal types that start with a '$'. llvm-svn: 118488
* Added more logging so we see the register stateSean Callanan2010-11-082-18/+18
| | | | | | | | | when a function starts and ends, and also the disassembly for anything that is a client of ClangExpressionParser after it has been JIT compiled. llvm-svn: 118401
* Made variable resolution more robust by handlingSean Callanan2010-11-081-25/+27
| | | | | | | | | every external variable reference in the module, and returning a clean error (instead of letting LLVM issue a fatal error) if the variable could not be resolved. llvm-svn: 118388
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-0610-36/+36
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Fixed a bug where variables in the source operandsSean Callanan2010-11-061-1/+2
| | | | | | | of store statements were not being marked for resolution. llvm-svn: 118316
* Added the equivalent of gdb's "unwind-on-signal" to the expression command, ↵Jim Ingham2010-11-052-11/+33
| | | | | | and a parameter to control it in ClangUserExpression, and on down to ClangFunction. llvm-svn: 118290
* Fixed error handling when the utility functionsSean Callanan2010-11-051-1/+9
| | | | | | | | | | | that check pointer validity fail to parse. Now lldb does not crash in that case. Also added support for checking Objective-C class validity in the Version 1 runtime as well as Version 2 runtimes with varying levels of available debug support. llvm-svn: 118271
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-041-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding support into lldb_private::Process: virtual uint32_t lldb_private::Process::LoadImage (const FileSpec &image_spec, Error &error); virtual Error lldb_private::Process::UnloadImage (uint32_t image_token); There is a default implementation that should work for both linux and MacOSX. This ability has also been exported through the SBProcess API: uint32_t lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error); lldb::SBError lldb::SBProcess::UnloadImage (uint32_t image_token); Modified the DynamicLoader plug-in interface to require it to be able to tell us if it is currently possible to load/unload a shared library: virtual lldb_private::Error DynamicLoader::CanLoadImage () = 0; This way the dynamic loader plug-ins are allows to veto whether we can currently load a shared library since the dynamic loader might know if it is currenlty loading/unloading shared libraries. It might also know about the current host system and know where to check to make sure runtime or malloc locks are currently being held. Modified the expression parser to have ClangUserExpression::Evaluate() be the one that causes the dynamic checkers to be loaded instead of other code that shouldn't have to worry about it. llvm-svn: 118227
* Re-enabled LLDB's pointer checkers, and moved theSean Callanan2010-11-042-61/+28
| | | | | | | implementation of the Objective-C object checkers into the Objective-C language runtime. llvm-svn: 118226
* Modified ThreadPlanCallFunction to perform theSean Callanan2010-11-031-1/+1
| | | | | | | | exception checks at the right time, and modified ClangFunction so that it doesn't misinterpret the stop as a timeout stop. llvm-svn: 118189
* Fixed a bug where we left a definition hangingSean Callanan2010-11-021-0/+3
| | | | | | | for a global variable that we had replaced with a reference to a slot in the input array. llvm-svn: 118123
* Fixed a bug that was confusing the code generatorSean Callanan2010-11-021-6/+2
| | | | | | | on i386 platforms, leading to crashes on simple expressions. llvm-svn: 118114
* Improved logging and cleaned up a redundant returnSean Callanan2010-11-011-5/+22
| | | | | | | | | statement. Now when ClangExpressionDeclMap returns a variable for a name, it pretty-prints that variable to the log instead of printing a (fairly useless) NamedDecl pointer. llvm-svn: 117972
* Print notes for expressions as well as errorsSean Callanan2010-11-011-1/+6
| | | | | | and warnings. llvm-svn: 117947
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-291-1/+5
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* Overloading is not broken any more. No need forSean Callanan2010-10-291-8/+0
| | | | | | an #ifndef. llvm-svn: 117706
* ClangUserExpression ctor should not crash if given a null expr_prefix char*.Johnny Chen2010-10-291-2/+2
| | | | llvm-svn: 117700
* Updated LLVM to latest version as of 10/28 atSean Callanan2010-10-291-1/+3
| | | | | | 7pm, and made minor integration fixes. llvm-svn: 117680
* Added a user-settable variable, 'target.expr-prefix',Sean Callanan2010-10-291-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which holds the name of a file whose contents are prefixed to each expression. For example, if the file ~/lldb.prefix.header contains: typedef unsigned short my_type; then you can do this: (lldb) settings set target.expr-prefix '~/lldb.prefix.header' (lldb) expr sizeof(my_type) (unsigned long) $0 = 2 When the variable is changed, the corresponding file is loaded and its contents are fetched into a string that is stored along with the target. This string is then passed to each expression and inserted into it during parsing, like this: typedef unsigned short my_type; void $__lldb_expr(void *$__lldb_arg) { sizeof(my_type); } llvm-svn: 117627
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-271-3/+5
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* Fixed a problem where function calls on i386 weren't Sean Callanan2010-10-263-2/+15
| | | | | | | | | being generated correctly. Also added a messy way to single-step through expressions that I will improve soon. llvm-svn: 117342
* Added a hack so that "unichar" is resolved toSean Callanan2010-10-241-0/+21
| | | | | | | | | "unsigned short." As discussed in the comments, this is pending a better solution to the problem of types not in the debug information but readily available through headers. llvm-svn: 117247
* Added a temporary hack to allow casting of Objective-CSean Callanan2010-10-221-3/+24
| | | | | | | | | method results to int. This will only last until we get accurate type information for Objective-C methods or some way of making their types inferred by the parser. llvm-svn: 117178
* Fixed IRForTarget to not recognize $__lldb variablesSean Callanan2010-10-211-1/+2
| | | | | | | as persistent variables. These are special markers used by LLDB. llvm-svn: 117078
* Don't cache the public stop reason, since it can change as plan completion ↵Jim Ingham2010-10-201-3/+3
| | | | | | gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do. llvm-svn: 116892
* Fixed a silly bug that was causing the "this" pointerSean Callanan2010-10-191-3/+3
| | | | | | | to be passed improperly to expressions in certain cases. llvm-svn: 116884
OpenPOWER on IntegriCloud