summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed a problem where LLDB inserted regular CSean Callanan2012-04-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | FunctionDecls into classes if it looked up a method in a different DWARF context than the one where it found the parent class's definition. The symptom of this was, for a method A::B(), 1) LLDB finds A in context 1, creating a CXXRecordDecl for A and marking it as needing completion 2) LLDB looks up B in context 2, finds that its parent A already has a CXXRecordDecl, but can't find a CXXMethodDecl for B 3) Not finding a CXXMethodDecl for B, LLDB doesn't set the flag indicating that B was resolved 4) Because the flag wasn't set, LLDB's fallthrough code creates a FunctionDecl for B and sticks it in the DeclContext -- in this case, A. 5) Clang crashes on finding a FunctionDecl inside a CXXRecordDecl. llvm-svn: 154627
* Fixed an issue that could occur when looking up functions inside of a ↵Greg Clayton2012-04-091-35/+112
| | | | | | | | namespace where if the NamespaceDecl hadn't been parsed yet, we would say a function wasn't in a namespace. Also improved the logging that happens with "log enable dwarf lookups" is enabled to show when we find matches. llvm-svn: 154352
* Fixed a problem where we did not read propertiesSean Callanan2012-04-052-21/+51
| | | | | | | | | | | | | | | | 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
* Possibly too soon for this commit.Bill Wendling2012-04-031-1/+1
| | | | llvm-svn: 153946
* Spell 'DW_TAG_APPLE_property' with the correct capitalization.Bill Wendling2012-04-031-1/+1
| | | | llvm-svn: 153940
* <rdar://problem/11160171>Greg Clayton2012-04-023-150/+166
| | | | | | Fixed an issue where there were more than one way to get a CompileUnitSP created when using SymbolFileDWARF with SymbolFileDWARFDebugMap. This led to an assertion that would fire under certain conditions. Now there is only one way to create the compile unit and it will "do the right thing". llvm-svn: 153908
* Added the ability to log when things get completed in DWARF. This can be ↵Greg Clayton2012-03-303-19/+33
| | | | | | | | | | enabled using: (lldb) log enable --verbose lldb completion This will print out backtraces for all type completion calls which will help us verify that we don't ever complete a type when we don't need to. llvm-svn: 153787
* <rdar://problem/11082392>Greg Clayton2012-03-301-36/+55
| | | | | | | | | | | | | | | | | | | 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/10103468>Greg Clayton2012-03-291-0/+11
| | | | | | | | | | Symbol files (dSYM files on darwin) can now be specified during program execution: (lldb) target symbols add /path/to/symfile/a.out.dSYM/Contents/Resources/DWARF/a.out This command can be used when you have a debug session in progress and want to add symbols to get better debug info fidelity. llvm-svn: 153693
* Added support for the DW_AT_APPLE_Property tagSean Callanan2012-03-291-59/+90
| | | | | | | | | | for unbacked properties. We support two variants: one in which the getter/setter are provided by selector ("mySetter:") and one in which the getter/setter are provided by signature ("-[MyClass mySetter:]"). llvm-svn: 153675
* Fixed a few things in the ELF object file:Greg Clayton2012-03-271-12/+12
| | | | | | | | | 1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags 2 - symbol names are marked as mangled if they start with "_Z" Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF. llvm-svn: 153496
* <rdar://problem/11113279>Greg Clayton2012-03-261-1/+1
| | | | | | | | | | 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
* Use GetClangDeclContextForDIE, it'll find the cached oneEric Christopher2012-03-251-2/+2
| | | | | | | if it's there and we may not have a cached die yet. This fixes a bunch of false positives on "die has no decl". llvm-svn: 153417
* <rdar://problem/11101372>Sean Callanan2012-03-242-4/+18
| | | | | | | | We now reject binaries built with LTO and print an error, rather than crashing later while trying to parse them. llvm-svn: 153361
* <rdar://problem/11072382>Greg Clayton2012-03-192-15/+18
| | | | | | | | | | Fixed a case where the source path remappings on the module were too expensive to use when we try to verify (stat the file system) that the remapped path points to a valid file. Now we will use the lldb_private::Module path remappings (if any) when parsing the debug info without verifying that the paths exist so we don't slow down line table parsing speeds. llvm-svn: 153059
* <rdar://problem/8196933>Greg Clayton2012-03-153-6/+24
| | | | | | Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available. llvm-svn: 152836
* <rdar://problem/11049371>Greg Clayton2012-03-141-6/+5
| | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=12232 Fixed a case where a missing "break" in a switch statement could cause an assertion to fire and kill the debug session. The fix was derived from the findings of Andrea Bigagli, thanks Andrea. llvm-svn: 152741
* <rdar://problem/10434005>Greg Clayton2012-03-143-4/+4
| | | | | | | 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
* <rdar://problem/10997402>Greg Clayton2012-03-072-14/+13
| | | | | | | | | | | 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
* Make sure breakpoint partial name matches occur on namespace boundaries.Jim Ingham2012-03-021-1/+34
| | | | | | <rdar://problem/10720345> "break set -n" name matching should only match at namespace boundaries llvm-svn: 151876
* Improved the type's handling of anonymous structs,Sean Callanan2012-03-021-0/+3
| | | | | | | | | so that the expression parser can look up members of anonymous structs correctly. This meant creating all the proper IndirectFieldDecls in each Record after it has been completely populated with members. llvm-svn: 151868
* <rdar://problem/10967107>Greg Clayton2012-03-021-1/+3
| | | | | | Don't try and unique anonymous struct/union/class types. llvm-svn: 151863
* Moved byte-size computation out of aSean Callanan2012-02-271-127/+130
| | | | | | | | startDefinition() ... endDefinition() block, preventing crashes where the byte size of a not-yet-complete type was being computed. llvm-svn: 151546
* <rdar://problem/10103468>Greg Clayton2012-02-242-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added support for the DWARF 4 DW_FORM values.Greg Clayton2012-02-221-140/+66
| | | | llvm-svn: 151202
* Add a logging mode that takes a callback and flush'es to that callback.Jim Ingham2012-02-212-10/+8
| | | | | | Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
* Tightened up type uniq'ing so we don't uniq twoSean Callanan2012-02-131-0/+1
| | | | | | | anonymous types to each other unless they have the same byte_size. llvm-svn: 150422
* Extended function lookup to allow the user toSean Callanan2012-02-104-10/+28
| | | | | | | | | indicate whether inline functions are desired. This allows the expression parser, for instance, to filter out inlined functions when looking for functions it can call. llvm-svn: 150279
* Caching the DIE for the DeclContext as reportedSean Callanan2012-02-091-1/+3
| | | | | | | by GetClangDeclContextContainingDIE, for better debuggability. llvm-svn: 150211
* Added a logging helper class for SymbolFileDWARF::ParseType() that willGreg Clayton2012-02-091-19/+92
| | | | | | | | enable us to track the depth of parsing and what is being parsed. This helps when trying to track down difficult type parsing issues and is only enabled in non-production builds. llvm-svn: 150203
* Made SymbolFileDWARF be less strict when lookingSean Callanan2012-02-071-19/+17
| | | | | | | | for types that can be uniqued to the given type. This is especially helpful when types are missing file and line information. llvm-svn: 150004
* I left some stray debugging messages in the sourceSean Callanan2012-02-061-5/+0
| | | | | | code. Removing these. llvm-svn: 149903
* Almost have templatized functions working (templatized classes are alreadyGreg Clayton2012-02-062-75/+134
| | | | | | | | working, but not functions). I need to check on a few things to make sure I am registering everything correctly in the right order and in the right contexts. llvm-svn: 149858
* Removed all of the "#ifndef SWIG" from the SB header files since we are usingGreg Clayton2012-02-061-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface (.i) files for each class. Changed the FindFunction class from: uint32_t SBTarget::FindFunctions (const char *name, uint32_t name_type_mask, bool append, lldb::SBSymbolContextList& sc_list) uint32_t SBModule::FindFunctions (const char *name, uint32_t name_type_mask, bool append, lldb::SBSymbolContextList& sc_list) To: lldb::SBSymbolContextList SBTarget::FindFunctions (const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); lldb::SBSymbolContextList SBModule::FindFunctions (const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); This makes the API easier to use from python. Also added the ability to append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList. Exposed properties for lldb.SBSymbolContextList in python: lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...) and then the result can be used to extract the desired information: sc_list = lldb.target.FindFunctions("erase") for function in sc_list.functions: print function for symbol in sc_list.symbols: print symbol Exposed properties for the lldb.SBSymbolContext objects in python: lldb.SBSymbolContext.module => lldb.SBModule lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit lldb.SBSymbolContext.function => lldb.SBFunction lldb.SBSymbolContext.block => lldb.SBBlock lldb.SBSymbolContext.line_entry => lldb.SBLineEntry lldb.SBSymbolContext.symbol => lldb.SBSymbol Exposed properties for the lldb.SBBlock objects in python: lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block) lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned lldb.SBBlock.ranges => an array or all address ranges for this block lldb.SBBlock.num_ranges => the number of address ranges for this blcok SBFunction objects can now get the SBType and the SBBlock that represents the top scope of the function. SBBlock objects can now get the variable list from the current block. The value list returned allows varaibles to be viewed prior with no process if code wants to check the variables in a function. There are two ways to get a variable list from a SBBlock: lldb::SBValueList SBBlock::GetVariables (lldb::SBFrame& frame, bool arguments, bool locals, bool statics, lldb::DynamicValueType use_dynamic); lldb::SBValueList SBBlock::GetVariables (lldb::SBTarget& target, bool arguments, bool locals, bool statics); When a SBFrame is used, the values returned will be locked down to the frame and the values will be evaluated in the context of that frame. When a SBTarget is used, global an static variables can be viewed without a running process. llvm-svn: 149853
* Made a fix that would affect anything in the anonymous namespace when lookingGreg Clayton2012-02-051-1/+1
| | | | | | for types and comparing decl context matches. llvm-svn: 149812
* Added some extra comments for the declaration context comparison functionGreg Clayton2012-02-051-2/+42
| | | | | | in the DWARF plug-in. llvm-svn: 149811
* <rdar://problem/10560053>Greg Clayton2012-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed "target modules list" (aliased to "image list") to output more information by default. Modified the "target modules list" to have a few new options: "--header" or "-h" => show the image header address "--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library) Removed the "--symfile-basename" or "-S" option, and repurposed it to "--symfile-unique" "-S" which will show the symbol file if it differs from the executable file. ObjectFile's can now be loaded from memory for cases where we don't have the files cached locally in an SDK or net mounted root. ObjectFileMachO can now read mach files from memory. Moved the section data reading code into the ObjectFile so that the object file can get the section data from Process memory if the file is only in memory. lldb_private::Module can now load its object file in a target with a rigid slide (very common operation for most dynamic linkers) by using: bool Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed) lldb::SBModule() now has a new constructor in the public interface: SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr); This will find an appropriate ObjectFile plug-in to load an image from memory where the object file header is at "header_addr". llvm-svn: 149804
* I have brought LLDB up-to-date with top of treeSean Callanan2012-02-041-15/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM/Clang. This brings in several fixes, including: - Improvements in the Just-In-Time compiler's allocation of memory: the JIT now allocates memory in chunks of sections, improving its ability to generate relocations. I have revamped the RecordingMemoryManager to reflect these changes, as well as to get the memory allocation and data copying out fo the ClangExpressionParser code. Jim Grosbach wrote the updates to the JIT on the LLVM side. - A new ExternalASTSource interface to allow LLDB to report accurate structure layout information to Clang. Previously we could only report the sizes of fields, not their offsets. This meant that if data structures included field alignment directives, we could not communicate the necessary alignment to Clang and accesses to the data would fail. Now we can (and I have update the relevant test case). Thanks to Doug Gregor for implementing the Clang side of this fix. - The way Objective-C interfaces are completed by Clang has been made consistent with RecordDecls; with help from Doug Gregor and Greg Clayton I have ensured that this still works. - I have eliminated all local LLVM and Clang patches, committing the ones that are still relevant to LLVM and Clang as needed. I have tested the changes extensively locally, but please let me know if they cause any trouble for you. llvm-svn: 149775
* Fixed a build breakage when trying to assign a shared pointer using a raw ↵Greg Clayton2012-02-021-1/+1
| | | | | | pointer. llvm-svn: 149609
* Fixed an issue where we might accept the wrong type when completingGreg Clayton2012-02-024-12/+89
| | | | | | | | | a type when we have a forward declaration. We always have found a type by basename, but now we also compare the decl context of the die we are trying to complete with the matches we find from the accelerator tables to ensure we get the right one. llvm-svn: 149593
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-296-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Added logging so we can see the field names and offsets of any structures Greg Clayton2012-01-281-2/+12
| | | | | | for when we enable the assisted layout. llvm-svn: 149167
* Adding the DWARF parser side for assited layout where the AST contextGreg Clayton2012-01-284-136/+316
| | | | | | | | | will ask ExternalASTSource objects to help laying out a type. This is needed because the DWARF typically doesn't contain alignement or packing attribute values, and we need to be able to match up types that the compiler uses in expressions. llvm-svn: 149160
* Fixed an issue with the Instruction subclasses where the strings mightGreg Clayton2012-01-192-7/+11
| | | | | | | | | | be fetched too many times and the DisassemblerLLVM was appending to strings when the opcode, mnemonic and comment accessors were called multiple times and if any of the strings were empty. Also fixed the test suite failures from recent Objective C modifications. llvm-svn: 148460
* Fixed a problem where maintaining the ObjCInterfaceMapSean Callanan2012-01-192-2/+2
| | | | | | | | | | | | | for each ObjCInterfaceDecl was imposing performance penalties for Objective-C apps. Instead, we now use the normal function query mechanisms, which use the relevant accelerator tables. This fix also includes some modifications to the SymbolFile which allow us to find Objective-C methods and report their Clang Decls correctly. llvm-svn: 148457
* Added an extra way to chop up an objective C prototype and use it where ↵Greg Clayton2012-01-192-6/+7
| | | | | | necessary. llvm-svn: 148445
* Be sure to use the one and only trusted source for chopping upGreg Clayton2012-01-181-9/+4
| | | | | | | | objective C class names when extracting the class name, selector and name without category for objective C full class and instance method names. llvm-svn: 148435
* Fixed an issue where we might not find the one true ObjC definition. Now we ↵Greg Clayton2012-01-182-29/+73
| | | | | | | | | | do things much smarter by extracting search results more efficiently and by properly obeying the must_be_implementation bool in the SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE() function. llvm-svn: 148413
* <rdar://problem/10688864>Greg Clayton2012-01-131-1/+7
| | | | | | | | Fixed the new __apple_types to be able to accept a DW_TAG_structure_type forward declaration and then find a DW_TAG_class_type definition, or vice versa. llvm-svn: 148097
OpenPOWER on IntegriCloud