summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
Commit message (Collapse)AuthorAgeFilesLines
...
* Ran the static analyzer on the codebase and found a few things.Greg Clayton2012-07-172-2/+7
| | | | llvm-svn: 160338
* <rdar://problem/11672978> Fixing an issue where an ObjC object might come ↵Enrico Granata2012-07-161-7/+9
| | | | | | out without a description because the expression used to obtain it would timeout before running to completion llvm-svn: 160326
* <rdar://problem/11870357>Greg Clayton2012-07-142-33/+32
| | | | | | Allow "frame variable" to find ivars without the need for "this->" or "self->". llvm-svn: 160211
* Be a little more safe when checking whether theSean Callanan2012-07-131-1/+1
| | | | | | | | | | | current symbol context is a C++ or Objective-C instance method. Specifically, ensure that we fetch information on the current block, not just the current function. llvm-svn: 160195
* Fixed a potential crash if a metadata categorySean Callanan2012-07-041-1/+1
| | | | | | | | we write into doesn't already exist. <rdar://problem/11775508> llvm-svn: 159700
* Minor fixes for ARM/iOS targets:Sean Callanan2012-06-082-0/+17
| | | | | | | | | | - On iOS, we select the "apcs-gnu" ABI to match what libraries expect. - Literals are now allocated at their preferred alignment, eliminating many alignment crashes. llvm-svn: 158236
* Made nil resolve as (id)0 and not be looked upSean Callanan2012-05-311-0/+8
| | | | | | | (which regularly conflicts with existing symbols in Objective-C). llvm-svn: 157758
* We were accessing the ModuleList in the target without locking it for tasks likeJim Ingham2012-05-301-6/+9
| | | | | | | | | | | setting breakpoints. That's dangerous, since while we are setting a breakpoint, the target might hit the dyld load notification, and start removing modules from the list. This change adds a GetMutex accessor to the ModuleList class, and uses it whenever we are accessing the target's ModuleList (as returned by GetImages().) <rdar://problem/11552372> llvm-svn: 157668
* Insert dynamic checks only if the appropriateSean Callanan2012-05-291-15/+21
| | | | | | checker functions exist. llvm-svn: 157652
* Updated the object-pointer lookup logic to fixSean Callanan2012-05-211-13/+30
| | | | | | Objective-C "self," which is not a regular pointer. llvm-svn: 157214
* Fixed a nasty bug where JIT expressions didn't workSean Callanan2012-05-211-11/+33
| | | | | | | when stopped in a const method. Also updated our testsuite to ensure that JIT is forced in this case. llvm-svn: 157208
* Enabled C++11 in the expression parser. auto andSean Callanan2012-05-162-2/+19
| | | | | | | | | various other syntactic sugar work. Lambdas do not due to some problems relocating code containing lambdas. Rvalue references work when returned from expressions, but need more testing. llvm-svn: 156948
* Don't try to use "OkayToDiscard" to mean BOTH this plan is a user plan or ↵Jim Ingham2012-05-111-0/+2
| | | | | | | | not AND unwind on error. rdar://problem/11419156 llvm-svn: 156627
* <rdar://problem/11330621>Greg Clayton2012-05-101-2/+1
| | | | | | | | | | | | Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size. Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code. Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function). Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions. llvm-svn: 156532
* Added a #define of NULL to 0 to make NULL usableSean Callanan2012-05-091-1/+9
| | | | | | in expressions. llvm-svn: 156514
* Made the IR interpreter move all floats, not just "wide"Sean Callanan2012-04-261-1/+1
| | | | | | | | | | ones, to its own constant pool. This reflects the fact that the LLVM code generators for different targets move floats to their constant pools under varying conditions, and the JIT cannot (yet) be relied upon to relocate references to its constant pool correctly. llvm-svn: 155660
* Hardened LLDB against NULL identifiers being passedSean Callanan2012-04-251-2/+9
| | | | | | into FindExternalVisibleDeclsByName. llvm-svn: 155561
* Fixed a crasher that occurs when an expressionSean Callanan2012-04-241-1/+2
| | | | | | | | | | | doesn't return a result. If that expression can't be run in the current context (for example, if it uses a function and there is no running process) then we used to try to destroy the nonexistent result variable. We now only destroy the result variable if we actually made one. llvm-svn: 155455
* Implemented zext as a no-op cast in the IRSean Callanan2012-04-231-4/+6
| | | | | | interpreter. llvm-svn: 155360
* Disabled spell checking in the expression parser,Sean Callanan2012-04-171-0/+6
| | | | | | | which incurs large overheads in terms of type parsing and importing. llvm-svn: 154885
* Make sure frozen_sp for a ClangExpressionVariableSean Callanan2012-04-121-1/+2
| | | | | | is non-NULL before asking for its name. llvm-svn: 154593
* Hardened the struct layout code to eliminate aSean Callanan2012-04-071-0/+5
| | | | | | | potential crash if the underlying type couldn't be completed. llvm-svn: 154234
* In a prior commit, I changed the parameters around on a ↵Greg Clayton2012-04-061-2/+2
| | | | | | ModuleList::FindTypes where the old parameters that existing clients were using would have been compatible, so I renamed ModuleList::FindTypes to ModuleList::FindTypes2. Then I made fixes and verified I updated and fixed all client code, but I forgot to rename the function back to ModuleList::FindTypes(). I am doing that now and also cleaning up the C++ dynamic type code a bit. llvm-svn: 154182
* Fixed a problem where we did not read propertiesSean Callanan2012-04-051-0/+80
| | | | | | | | | | | | | | | | correctly if the setter/getter were not present in the debug information. The fixes are as follows: - We not only look for the method by its full name, but also look for automatically-generated methods when searching for a selector in an Objective-C interface. This is necessary to find accessors. - Extract the getter and setter name from the DW_TAG_APPLE_Property declaration in the DWARF if they are present; generate them if not. llvm-svn: 154067
* Initialize ivars in the correct order.Bill Wendling2012-04-031-3/+3
| | | | llvm-svn: 153947
* Disabling blocks support because of rdar://problem/11024417 - This is ↵Enrico Granata2012-03-301-1/+2
| | | | | | hopefully just a temporary countermeasure llvm-svn: 153758
* <rdar://problem/11082392>Greg Clayton2012-03-301-1/+1
| | | | | | | | | | | | | | | | | | | Fixed an issue that could cause circular type parsing that will assert and kill LLDB. Prior to this fix the DWARF parser would always create class types and not start their definitions (for both C++ and ObjC classes) until we were asked to complete the class later. When we had cases like: class A { class B { }; }; We would alway try to complete A before specifying "A" as the decl context for B. Turns out we can just start the definition and still not complete the class since we can check the TagDecl::isCompleteDefinition() function. This only works for C++ types. This means we will not be pulling in the full definition of parent classes all the time and should help with our memory consumption and also reduce the amount of debug info we have to parse. I also reduced redundant code that was checking in a lldb::clang_type_t was a possible C++ dynamic type since it was still completing the type, just to see if it was dynamic. This was fixed in another function that was checking for a type being dynamic as an ObjC or a C++ type, but there was dedicated fucntion for C++ that we missed. llvm-svn: 153713
* <rdar://problem/11113279>Greg Clayton2012-03-262-7/+12
| | | | | | | | | | Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method. This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB. llvm-svn: 153482
* Added some hardening to make sure that we don'tSean Callanan2012-03-212-0/+5
| | | | | | use QualType contents unchecked. llvm-svn: 153201
* Fixed some potential null-pointer bugs in theSean Callanan2012-03-201-1/+7
| | | | | | expression parser code. llvm-svn: 153128
* Strengthened LLDB's completion of object types.Sean Callanan2012-03-153-1/+23
| | | | | | | | | | | | | | Now when LLDB reports a variable, it has a complete type. Similarly, when it reports members of a struct, it completes their types. Also, when it creates the result variable for an expression, it ensures that variable's type is complete. This ensures compliance with Clang's expectations, preventing potential crashes. llvm-svn: 152771
* <rdar://problem/10434005>Greg Clayton2012-03-141-3/+3
| | | | | | | Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind macros that allows us to easily compile for either C++. llvm-svn: 152698
* Hardened the process of reading the program counterSean Callanan2012-03-101-1/+6
| | | | | | on behalf of a DWARF expression. llvm-svn: 152477
* Updated the revision of LLVM/Clang used by LLDB.Sean Callanan2012-03-082-6/+9
| | | | | | | | | | | | | | | This takes two important changes: - Calling blocks is now supported. You need to cast their return values, but that works fine. - We now can correctly run JIT-compiled expressions that use floating-point numbers. Also, we have taken a fix that allows us to ignore access control in Objective-C as in C++. llvm-svn: 152286
* <rdar://problem/10997402>Greg Clayton2012-03-071-7/+5
| | | | | | | | | | | This fix really needed to happen as a previous fix I had submitted for calculating symbol sizes made many symbols appear to have zero size since the function that was calculating the symbol size was calling another function that would cause the calculation to happen again. This resulted in some symbols having zero size when they shouldn't. This could then cause infinite stack traces and many other side affects. llvm-svn: 152244
* Added support for calling blocks from expressions,Sean Callanan2012-03-061-0/+42
| | | | | | | but gated by an #ifdef until we roll LLVM/Clang to bring in the necessary parser support. llvm-svn: 152149
* Don't return bare symbols when asked to searchSean Callanan2012-03-061-2/+2
| | | | | | inside a namespace. This bypasses local variables. llvm-svn: 152144
* Made sure to store the type for "this" when in aSean Callanan2012-03-051-0/+12
| | | | | | C++ method. llvm-svn: 152064
* And remove the control character that somehow found its way into the last ↵Jim Ingham2012-03-021-1/+1
| | | | | | checkin... llvm-svn: 151941
* For Sean: handle the case where you are asked for a 0 byte allocation with 0 ↵Jim Ingham2012-03-021-2/+2
| | | | | | alignment. llvm-svn: 151940
* Prevent assertions because of zero-sized sections,Sean Callanan2012-03-021-1/+6
| | | | | | | while still ensuring that the sections get remote allocations. llvm-svn: 151936
* Updated LLVM to take a new MC JIT that supportsSean Callanan2012-03-013-12/+17
| | | | | | | | | | allocations by section. We install these sections in the target process and inform the JIT of their new locations. Also removed some unused variable warnings. llvm-svn: 151789
* Made the IR interpreter handle GetElementPtr instructionsSean Callanan2012-02-291-1/+34
| | | | | | with non-constant indexes. llvm-svn: 151734
* Extended the IR interpreter to support symbolsSean Callanan2012-02-281-4/+16
| | | | | | that have valid load addresses. llvm-svn: 151636
* Harden the checks on the type returned from theSean Callanan2012-02-271-0/+5
| | | | | | | AST importer because we're seeing occasional crashes. llvm-svn: 151541
* <rdar://problem/10103468>Greg Clayton2012-02-243-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | I started work on being able to add symbol files after a debug session had started with a new "target symfile add" command and quickly ran into problems with stale Address objects in breakpoint locations that had lldb_private::Section pointers into modules that had been removed or replaced. This also let to grabbing stale modules from those sections. So I needed to thread harded the Address, Section and related objects. To do this I modified the ModuleChild class to now require a ModuleSP on initialization so that a weak reference can created. I also changed all places that were handing out "Section *" to have them hand out SectionSP. All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild so all of the find plug-in, static creation function and constructors now require ModuleSP references instead of Module *. Address objects now have weak references to their sections which can safely go stale when a module gets destructed. This checkin doesn't complete the "target symfile add" command, but it does get us a lot clioser to being able to do such things without a high risk of crashing or memory corruption. llvm-svn: 151336
* Added support for looking up the complete type forSean Callanan2012-02-221-18/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objective-C classes. This allows LLDB to find ivars declared in class extensions in modules other than where the debugger is currently stopped (we already supported this when the debugger was stopped in the same module as the definition). This involved the following main changes: - The ObjCLanguageRuntime now knows how to hunt for the authoritative version of an Objective-C type. It looks for the symbol indicating a definition, and then gets the type from the module containing that symbol. - ValueObjects now report their type with a potential override, and the override is set if the type of the ValueObject is an Objective-C class or pointer type that is defined somewhere other than the original reported type. This means that "frame variable" will always use the complete type if one is available. - The ClangASTSource now looks for the complete type when looking for ivars. This means that "expr" will always use the complete type if one is available. - I added a testcase that verifies that both "frame variable" and "expr" work. llvm-svn: 151214
* The second part in thread hardening the internals of LLDB where we makeGreg Clayton2012-02-182-17/+13
| | | | | | | | | | | | | | | | the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the the most volatile objects we have as when we are doing single stepping, frames can often get lost or thrown away, only to be re-created as another object that still refers to the same frame. We have another bug tracking that. But we need to be able to have frames no longer be able to get the thread when they are not part of a thread anymore, and this is the first step (this fix makes that possible but doesn't implement it yet). Also changed lldb_private::ExecutionContextScope to return shared pointers to all objects in the execution context to further thread harden the internals. llvm-svn: 150871
* Ignore the constness of the object pointer whenSean Callanan2012-02-181-3/+10
| | | | | | fetching it. llvm-svn: 150861
* Stop finding bare symbols when we're explicitlySean Callanan2012-02-151-1/+4
| | | | | | told to look in a namespace. llvm-svn: 150590
OpenPOWER on IntegriCloud