summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* <rdar://problem/10338439>Greg Clayton2011-11-101-0/+2
| | | | | | | | Fixed an issue where if you had an initialized global variable, we would not link it up correctly in the debug info if the .o file had the symbols as UNDF + EXT (undefined external). We now properly link the globals. llvm-svn: 144259
* Sometimes the debug information includes artifically-Sean Callanan2011-11-021-3/+5
| | | | | | | | | | | | | generated special member functions (constructors, destructors, etc.) for classes that don't really have them. We needed to mark these as artificial to reflect the debug information; this bug does that for constructors and destructors. The "etc." case (certain assignment operators, mostly) remains to be fixed. llvm-svn: 143526
* Added the capability (turned off for now) to mark aSean Callanan2011-11-011-1/+4
| | | | | | | | | | | | | | | | method as __attribute__ ((used)) when adding it to a class. This functionality is useful when stopped in anonymous namespaces: expressions attached to classes in anonymous namespaces are typically elided by Clang's CodeGen because they have no namespaces are intended not to be externally visible. __attribute__ ((used)) forces CodeGen to emit the function. Right now, __attribute__ ((used)) causes the JIT not to emit the function, so we're not enabling it until we fix that. llvm-svn: 143469
* Fixed some warnings after enabling some stricter warnings in the Xcode projectGreg Clayton2011-10-311-11/+34
| | | | | | | | | settings. Also fixed an issue where we weren't creating anonymous namepaces correctly: <rdar://problem/10371295> llvm-svn: 143403
* warnings: Fix several uses of trailing comma on enumeration extensions.Daniel Dunbar2011-10-311-1/+1
| | | | llvm-svn: 143380
* Added support for the C++Ox "nullptr_t" type.Greg Clayton2011-10-282-0/+12
| | | | llvm-svn: 143225
* Added support for the new ".apple_objc" accelerator tables. These tables areGreg Clayton2011-10-272-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the same hashed format as the ".apple_names", but they map objective C class names to all of the methods and class functions. We need to do this because in the DWARF the methods for Objective C are never contained in the class definition, they are scattered about at the translation unit level and they don't even have attributes that say the are contained within the class itself. Added 3 new formats which can be used to display data: eFormatAddressInfo eFormatHexFloat eFormatInstruction eFormatAddressInfo describes an address such as function+offset and file+line, or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants). The format character for this is "A", the long format is "address". eFormatHexFloat will print out the hex float format that compilers tend to use. The format character for this is "X", the long format is "hex float". eFormatInstruction will print out disassembly with bytes and it will use the current target's architecture. The format character for this is "i" (which used to be being used for the integer format, but the integer format also has "d", so we gave the "i" format to disassembly), the long format is "instruction". Mate the lldb::FormatterChoiceCriterion enumeration private as it should have been from the start. It is very specialized and doesn't belong in the public API. llvm-svn: 143114
* Fixed an issue where a class that resides inside another class wasn't gettingGreg Clayton2011-10-262-2/+16
| | | | | | | an access specifier set on it, causing an assertion to fire when building with a Debug+Asserts build of clang. llvm-svn: 143010
* <rdar://problem/10335756>Greg Clayton2011-10-251-1/+20
| | | | | | | | Fixed an issue where bad DWARF from clang would get recycled from DWARF back into types and cause clang to assert and die, killing the lldb binary, when it tried to used the type in an expression. llvm-svn: 142897
* Added template support when parsing DWARF into types. We can now use STLGreg Clayton2011-10-222-18/+190
| | | | | | classes in the expression parser. llvm-svn: 142717
* Fixed some issues where we might not have one of the new apple acceleratorGreg Clayton2011-10-204-676/+159
| | | | | | | | | | | tables (like the .apple_namespaces) and it would cause us to index DWARF that didn't need to be indexed. Updated the MappedHash.h (generic Apple accelerator table) and the DWARF specific one (HashedNameToDIE.h) to be up to date with the latest and greatest hash table format. llvm-svn: 142627
* Moved lldb::user_id_t values to be 64 bit. This was going to be needed forGreg Clayton2011-10-194-89/+169
| | | | | | | | | | | process IDs, and thread IDs, but was mainly needed for for the UserID's for Types so that DWARF with debug map can work flawlessly. With DWARF in .o files the type ID was the DIE offset in the DWARF for the .o file which is not unique across all .o files, so now the SymbolFileDWARFDebugMap class will make the .o file index part (the high 32 bits) of the unique type identifier so it can uniquely identify the types. llvm-svn: 142534
* Changed lldb_private::Type over to use the intrusive ref counted pointersGreg Clayton2011-10-182-46/+30
| | | | | | | | | | | so we don't have to lookup types in a type list by ID. Changed the DWARF parser to remove the "can externally complete myself" bits from the type when we are in the process of completing the type itself to avoid an onslaught of external visible decl requests from the clang::ExternalASTSource. llvm-svn: 142461
* Add function decls to their parent decl context.Greg Clayton2011-10-141-1/+2
| | | | llvm-svn: 142011
* Make sure we create only unique one namespace per AST when parsing the DWARF.Greg Clayton2011-10-142-24/+40
| | | | llvm-svn: 142005
* Modified the DWARF parser to take care of a 1 clang::DeclContext to manyGreg Clayton2011-10-132-47/+60
| | | | | | DIEs. Prior to this fix, there was a 1 to 1 mapping. llvm-svn: 141917
* Fixed a case where we might end up trying to parse a type in the DWARF ↵Greg Clayton2011-10-131-22/+59
| | | | | | parser for a method whose class isn't currently in the process of completing itself. Currently, methods of a class, must be parsed when the class type that contains the method is asked to complete itself through the clang::ExternalASTSource virtual functions. Now we "do the right thing" by checking if the class is being defined, and if so we parse it, else we tell the class to complete itself so everything happens correctly. llvm-svn: 141908
* Enabled the namespace-specific search functionality,Sean Callanan2011-10-131-1/+16
| | | | | | | | | | | | | which had previously been commented out while I tested it. It's not fully working yet, but it doesn't break our testsuite and it's an important piece of functionality. Also added some logging to SymbolFileDWARF to help diagnose entities that are found in a symbol file, but do not reside in the expected namespace. llvm-svn: 141894
* Moved the list of found namespaces into the searchSean Callanan2011-10-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | context object. Having it populated and registered within a single FindExternalVisibleDecls call worked fine when there was only one call (i.e., when we were just looking in the global namespace). However, now FindExternalVisibleDecls is called for nested namespaces as well, which means that it is called not once but many times (once per module in which the parent namespace appears). This means that the namespace mapping is built up across many calls to the inferior FindExternalVisibleDecls, so I moved it into a data structure (the search context) that is shared by all calls. I also added some logging to make it easier to see what is happening during a namespace search, and cleaned up some existing logging. llvm-svn: 141888
* Completed the glue that passes a ClangNamespaceDecl *Sean Callanan2011-10-136-32/+83
| | | | | | | | down through Module and SymbolVendor into SymbolFile. Added checks to SymbolFileDWARF that restrict symbol searches when a namespace is passed in. llvm-svn: 141847
* Add a version of ResolveFunction that takes a "const DWARFDebugInfoEntry *"Greg Clayton2011-10-132-70/+85
| | | | | | | and a "DWARFCompileUnit *" to avoid doing a DIE lookup twice and to prepare for using namespaces in the lookups. llvm-svn: 141843
* Added a function to test if a ClangNamespaceDecl matches the current symbolGreg Clayton2011-10-132-1/+29
| | | | | | | file. This will help us to minimize lookups that can't possibly match anything in the current symbol file. llvm-svn: 141838
* Added the ability to see if a DIE is contained in a namespace.Greg Clayton2011-10-122-0/+40
| | | | llvm-svn: 141832
* Remove a debugging printf...Jim Ingham2011-10-111-3/+0
| | | | llvm-svn: 141627
* Fix a couple of places in FindFunctions where I was using the passed in ↵Jim Ingham2011-10-111-2/+2
| | | | | | | | name_type_mask rather than the computed effective_name_type_mask. llvm-svn: 141624
* Changed RangeMap over to use llvm::SmallVector and updated the RangeArray ↵Greg Clayton2011-10-082-2/+2
| | | | | | and the RangeDataArray to have an extra "unsigned N" template parameter. Updated the lldb_private::Block to use a RangeArray with a uint32_t for both the function base offset and block range size, and then a 1 for the small vector size since most lexical blocks in DWARF only have 1 range. Updates the DWARFDebugRanges RangeArray to use an unsigned of 2 since most blocks that have more than one range usually have 2. Also updated a DWARFDebugAranges to default their RangeArray to use a SmallVector with unsigned size of 1 since this will take care of the .o files when doing DWARF in .o files and since there really isn't any good size we can guess with. llvm-svn: 141480
* Added more functionality to Range template classes in RangeMap.h and ↵Greg Clayton2011-10-086-217/+140
| | | | | | converted remaining DWARF areas that were using ranges over to this class. Also converted lldb_private::Block to use it. llvm-svn: 141460
* Move the responsibility for translating the various eFunctionNameType ↵Jim Ingham2011-10-073-156/+331
| | | | | | | | | | lookups to the SymbolFIle (it was done mostly in the BreakpointResolverName resolver before.) Then tailor our searches to the way the indexed maps are laid out. This removes a bunch of test case failures using indexed dSYM's. llvm-svn: 141428
* Re-organized the contents of RangeMap.h to be more concise and also allow ↵Greg Clayton2011-10-072-3/+3
| | | | | | | | | | for a Range, RangeArray, RangeData (range + data), or a RangeDataArray. We have many range implementations in LLDB and I will be converting over to using the classes in RangeMap.h so we can have one set of code that does ranges and searching of ranges. Fixed up DWARFDebugAranges to use the new range classes. Fixed the enumeration parsing to take a lldb_private::Error to avoid a lot of duplicated code. Now when an invalid enumeration is supplied, an error will be returned and that error will contain a list of the valid enumeration values. llvm-svn: 141382
* Since we use address ranges a lot I added a templatized class that allows us ↵Greg Clayton2011-10-075-837/+113
| | | | | | to easily control the base address type, the size type, and the data that is stored with each range. It is designed to be populated by appending all needed items, then sorting the resulting list, and optionally minimizing the list when done. I adopted this new list in the DWARFDebugAranges for even further memory savings. llvm-svn: 141352
* Added a new logging channel to the DWARF called "lookups":Greg Clayton2011-10-068-26/+94
| | | | | | | | | (lldb) log enable dwarf lookups This allows us to see when lookups are being done on functions, addresses, and types by both name and regular expresssion. llvm-svn: 141259
* Stop spurious "DW_AT_specification(0x%8.8x) has no decl" warnings that were ↵Greg Clayton2011-10-052-45/+90
| | | | | | | | due to not parsing the function types when the function blocks are made and parsed. Cached the Function object's m_type value after it has been calculated. llvm-svn: 141225
* Enable all the new accelerator tables if they are present and don't manuallyGreg Clayton2011-10-045-293/+778
| | | | | | | | | | index the DWARF. Also fixed an issue with memory accelerator tables with a size of 1 where we would loop infinitely. Added support for parsing the new .apple_namespaces section which gives us a memory hash table for looking up namespaces. llvm-svn: 141128
* Print object names in case we have a .o file in a static archive when loggingGreg Clayton2011-10-011-0/+6
| | | | | | DWARF errors and warnings. llvm-svn: 140918
* Fix segfault in UniqueDWARFASTTypeList::Find if we are comparingJason Molenda2011-10-011-2/+9
| | | | | | an anonymous struct type (which lacks any name). llvm-svn: 140917
* Removed some commented out code from the DWARF parser.Greg Clayton2011-09-301-34/+3
| | | | | | | | | | Also reduce the size of the lldb_private::Symbol objects by removing the lldb_private::Function pointer that was in each symbol. Running Instruments has shown that when debugging large applications with DWARF in .o files that lldb_private::Symbol objects are one of the highest users of memory. No one was using the Symbol::GetFunction() call anyway. llvm-svn: 140881
* <rdar://problem/10212450>Greg Clayton2011-09-302-115/+148
| | | | | | Don't parse function types all the time, only parse them lazily. llvm-svn: 140842
* Fixed an issue where a lexical block or inlined function might have bad debugGreg Clayton2011-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information generated for it. Say we have a concrete function "foo" which has inlined function "a" which calls another inlined function "b": foo 1 { 2 { a () 3 { b () 4 { } } } } Sometimes we see the compiler generate an address range in the DWARF for "foo" (block 1 above) as say [0x1000-0x1100). Then the range for "a" is something like [0x1050-0x1060) (note that it is correctly scoped within the "foo" address range). And then we get "b" which is a child of "a", yet the debug info says it has a range of [0x1060-0x1080) (not contained within "a"). We now detect this issue when making our blocks and add an extra range to "a". Also added a new "lldb" logging category named "symbol" where we can find out about symbol file errors and warnings. llvm-svn: 140822
* Centralize the warning reporting and use ReportWarning & ReportError ↵Jim Ingham2011-09-292-8/+30
| | | | | | everywhere we were using fprintf(stderr directly. llvm-svn: 140813
* If the new .apple_names and .apple_types DWARF accelerator tablesGreg Clayton2011-09-292-13/+18
| | | | | | | | | are available, we currently will still index the DWARF ourselves and assert if the name lookups differ. This will help us transition to the new accelerator tables and make sure they are workng before we switch over entirely. llvm-svn: 140788
* Found a great optimization after speaking with Sean Callanan which cleansGreg Clayton2011-09-292-77/+40
| | | | | | | up the implementation details of the on disk hash, these changed implement the changes in the on disk table format. llvm-svn: 140750
* Convert over to the latest and greatest on disc acceleratorGreg Clayton2011-09-284-171/+506
| | | | | | | hash tables. Renamed the DWARF sections to ".apple_names" and ".apple_types" until we get more buy in from other vendors. llvm-svn: 140702
* Added the ability to restrict breakpoints by function name, function regexp, ↵Jim Ingham2011-09-231-2/+2
| | | | | | | | | | selector etc to specific source files. Added SB API's to specify these source files & also more than one module. Added an "exact" option to CompileUnit's FindLineEntry API. llvm-svn: 140362
* Add a new breakpoint type "break by source regular expression".Jim Ingham2011-09-211-9/+9
| | | | | | | | | Fix the RegularExpression class so it has a real copy constructor. Fix the breakpoint setting with multiple shared libraries so it makes one breakpoint not one per shared library. Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.) llvm-svn: 140225
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-205-6/+6
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Don't put modules for .o files into the global shared module list. WeGreg Clayton2011-09-181-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | used to do this because we needed to find the shared pointer for a .o file when the .o file's module was needed in a SymbolContext since the module in a symbol context was a shared pointer. Now that we are using intrusive pointers we don't have this limitation anymore since any instrusive shared pointer can be made from a pointer to an object all on its own. Also switched over to having the Module and SymbolVendor use shared pointers to their object files as had a leak on MacOSX when the SymbolVendor's object file wasn't the same as the Module's (debug info in a stand along file (dSYM file)). Now everything will correctly clean itself up when the module goes away after an executable gets rebuilt. Now we correctly get rid of .o files that are used with the DWARF with debug map executables on subsequent runs since the only shared pointer to the object files in from the DWARF symbol file debug map parser, and when the module gets replaced, it destroys to old one along with all .o files. Also added a small optimization when using BSD archives where we will remove old BSD containers from the shared list when they are outdated. llvm-svn: 140002
* Removed the function:Greg Clayton2011-09-172-8/+7
| | | | | | | | | | | ModuleSP Module::GetSP(); Since we are now using intrusive ref counts, we can easily turn any pointer to a module into a shared pointer just by assigning it. llvm-svn: 139984
* Huge memory and performance improvements in the DWARF parser.Greg Clayton2011-09-1212-872/+578
| | | | | | | | | | | | | | | | | | | | | | Address ranges are now split up into two different tables: - one in DWARFDebugInfo that is compile unit specific - one in each DWARFCompileUnit that has exact function DIE offsets This helps keep the size of the aranges down since the main table will get uniqued and sorted and have consecutive ranges merged. We then only parse the compile unit one on demand once we have determined that a compile unit contains the address in question. We also now use the .debug_aranges section if there is one instead of always indexing the DWARF manually. NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map. std::map is very bulky as each node has 3 pointers and the key and value types. This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves us a lot of memory when we have very large DWARF. DWARFDebugAranges now has a smaller footprint for each range it contains to save on memory. llvm-svn: 139557
* Fixed the header guards.Greg Clayton2011-09-1216-35/+30
| | | | llvm-svn: 139490
* Fixed the logging output to be done consistently across all plug-ins.Greg Clayton2011-09-122-10/+13
| | | | | | | Added a new log category for DWARF called "aranges" to log the parsing of address ranges. llvm-svn: 139489
OpenPOWER on IntegriCloud