summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
* First step in getting LLDB ready to support multiple different type systems.Greg Clayton2015-08-111-77/+105
| | | | | | | | This is the work done by Ryan Brown from http://reviews.llvm.org/D8712 that makes a TypeSystem class and abstracts types to be able to use a type system. All tests pass on MacOSX and passed on linux the last time this was submitted. llvm-svn: 244679
* Move the computation of whether a DWARF compile unitJason Molenda2015-07-313-6/+32
| | | | | | | | is optimized into DWARFCompileUnit, where it should have been. Next I'll need to call this from another section of code for DWARF-in-.o-file behavior correctness. llvm-svn: 243736
* Fix issues with separate symbolfile handlingTamas Berghammer2015-07-301-0/+1
| | | | | | Differential revision: http://reviews.llvm.org/D11595 llvm-svn: 243637
* Make DWARF at_comp_dir symbolic links configurable via ↵Oleksiy Vyalov2015-07-292-9/+78
| | | | | | | | plugin.symbol-file.dwarf.comp-dir-symlink-paths setting. http://reviews.llvm.org/D11586 llvm-svn: 243580
* First part of an attempt to indicate to the user when they are Jason Molenda2015-07-293-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debugging optimized code. Adds new methods on Function/SBFunction to query whether a given function is optimized. Adds a new function.is-optimized format entity and changes the default frame-format to append "[opt]" if the function was built with optimization. The only indication that a binary was built with optimization that we have right now is the presence of the DW_AT_APPLE_optimized attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit. The absence of this flag may mean that the compile_unit was not compiled with optimization, or it may mean that the producer does not generate this attribute. Currently this only works for dSYM debugging. When we create the CompileUnit with dwarf-in-.o-file debugging we don't have the attribute value yet so it's not set. I need to find the flag value when we do start to read the .o file DWARF and set the CompileUnit's status at that point - but haven't done it yet. I'm also going to add a mechanism for issuing warnings to users such that they're only issued once in a debug session and there is away for users to suppress these warnings altogether via .lldbinit file settings. But I want to get this changeset committed now that it's at a useful state. <rdar://problem/19281172> llvm-svn: 243508
* If a path contains a '/' before a ':', then the ':' is not a hostname ↵Enrico Granata2015-07-271-3/+9
| | | | | | separator, but just a part of the path (e.g. /tmp/fi:lename vs. pro:/tmp/fi:lename) llvm-svn: 243330
* Fix warnings found by -Wextra-semiPavel Labath2015-07-221-3/+2
| | | | | | patch by Eugene Zelenko. llvm-svn: 242875
* Fix typos.Bruce Mitchener2015-07-221-2/+2
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* Improve the performance of DWARFDebugInfo::GetCompileUnitContainingDIE() by ↵Greg Clayton2015-07-211-22/+41
| | | | | | | | using a binary search. Also switched DWARFDebugInfo::GetCompileUnit() over to using the same kind of binary search instead of using bsearch(). llvm-svn: 242852
* Resolve DW_AT_comp_dir path if it contains a symlinkOleksiy Vyalov2015-07-211-8/+40
| | | | | | http://reviews.llvm.org/D11357 llvm-svn: 242757
* Don't crash if we are unable to get the member type.Greg Clayton2015-07-131-1/+1
| | | | | | <rdar://problem/21624447> llvm-svn: 242076
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-084-11/+16
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Tolerate DWARF compile unit without filename.David Srbecky2015-07-081-14/+28
| | | | | | | | | | | Summary: The DW_AT_name attribute of compile unit is optional. If it is missing, try to get filename from the debug_line section. This allows the compile unit to be useful without the filename. Differential Revision: http://reviews.llvm.org/D11003 llvm-svn: 241679
* Resubmitting 240466 after fixing the linux test suite failures.Greg Clayton2015-06-253-9/+9
| | | | | | | | | | | | | | | A few extras were fixed - Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected. - Since some places want to access the address as a reference, I added a few new functions to symbol: Address &Symbol::GetAddressRef(); const Address &Symbol::GetAddressRef() const; Linux test suite passes just fine now. <rdar://problem/21494354> llvm-svn: 240702
* Fix a variety of typos.Bruce Mitchener2015-06-181-1/+1
| | | | | | No functional change. llvm-svn: 239995
* Fix enum LanguageType values and language string table lookups.Dawn Perchik2015-06-173-8/+23
| | | | | | | | | | | | | | | Summary: * Fix enum LanguageType values so that they can be used as indexes into array language_names and g_languages as assumed by LanguageRuntime::GetNameForLanguageType, Language::SetLanguageFromCString and Language::AsCString. * Add DWARFCompileUnit::LanguageTypeFromDWARF to convert from DWARF DW_LANG_* values to enum LanguageType values. Reviewed By: clayborg, abidh Differential Revision: http://reviews.llvm.org/D10484 llvm-svn: 239963
* Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.Chaoren Lin2015-06-092-3/+3
| | | | | | | | | | | | | | | | | Summary: `IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths are sometimes appended to other directories, not just the cwd. Plus, the new name is shorter. Also added `IsAbsolute` for completeness. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10262 llvm-svn: 239419
* Revert "Introduce a TypeSystem interface to support adding non-clang languages."Pavel Labath2015-06-081-105/+77
| | | | | | This seems to break expression evaluation on the linux build. llvm-svn: 239366
* Introduce a TypeSystem interface to support adding non-clang languages.Pavel Labath2015-06-081-77/+105
| | | | | | | | | | | | | Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8712 Original Author: Ryan Brown <ribrdb@google.com> llvm-svn: 239360
* Delegate path operations to FileSpec.Chaoren Lin2015-06-052-75/+30
| | | | | | | | | | | | | | | | | Summary: - Added PrependPathComponent utility functions to FileSpec. - Delegate path operations in ParseCompileUnit to FileSpec. - Delegate path operations in ParseSupportFiles to FileSpec. Reviewers: clayborg, vharron, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10253 llvm-svn: 239127
* Parse function name from DWARF DW_AT_abstract_originTamas Berghammer2015-05-271-9/+13
| | | | | | | | | | | | | | | A DW_TAG_subprogram entry can contain a reference to a DW_AT_abstract_origin entry instead of duplicating the information from it (e.g.: name) when the same function is inlined in some case and not inlined in other cases. This CL fixes name parsing for the case when the DW_TAG_subprogram for the non inlined version contains just a reference to the DW_AT_abstract_origin entry instead of the full information. Differential revision: http://reviews.llvm.org/D10034 llvm-svn: 238307
* Quiet compiler warnings about virtual and override not being consistent.Greg Clayton2015-05-251-38/+38
| | | | llvm-svn: 238128
* Don't crash if we have bad debug info that has a DW_TAG_inheritance with a ↵Greg Clayton2015-05-151-2/+9
| | | | | | | | bad DW_AT_type reference. Emit an error with instructions to file a bug. <rdar://problem/20944860> llvm-svn: 237485
* Don't crash if a function has no name by calling 'strcmp(name, "main")'.Greg Clayton2015-05-151-1/+1
| | | | | | <rdar://problem/20925061> llvm-svn: 237484
* Only check _ZN function prefix in Linux and FreeBSD targets in SymbolFileDWARFRobert Flack2015-05-151-5/+15
| | | | | | | | | | | | | | | | | | | | | | In http://reviews.llvm.org/D9754 I enabled the mangled symbol name lookup workaround used to find global and anonymous namespace symbols in linux binaries for all platforms, however we should still only check for these symbols when processing Linux or FreeBSD binaries where they are relevant. This patch makes this change. Test Plan: The tests from the original revision still pass: TestCallCPPFunction.py TestCallStopAndContinue.py TestExprs.py TestExprsChar.py TestNamespace.py TestOverloadedFunctions.py TestRvalueReferences.py TestThreadExit.py Differential Revision: http://reviews.llvm.org/D9782 llvm-svn: 237467
* Enable workaround for finding functions in global namespace on linux binaries onRobert Flack2015-05-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | all hosts. We require a workaround to be able to locate global and anonymous namespace functions in the dwarf symbols on linux binaries. This patch enables this code on all platforms so that we can still find these symbols when debugging from a different host platform. Test Plan: The following tests begin passing when running with a mac host to linux client: TestCallCPPFunction.py TestCallStopAndContinue.py TestExprs.py TestExprsChar.py TestNamespace.py TestOverloadedFunctions.py TestRvalueReferences.py TestThreadExit.py Differential Revision: http://reviews.llvm.org/D9754 llvm-svn: 237270
* Fix a few compile warningsIlia K2015-05-131-1/+1
| | | | llvm-svn: 237238
* Fixed a ton of gcc compile warningsVince Harron2015-05-132-2/+2
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Placate clang. lldb can build on FreeBSD with -Werror again.Davide Italiano2015-04-211-1/+1
| | | | llvm-svn: 235387
* This patch implements several improvements to theSean Callanan2015-04-207-14/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | module-loading support for the expression parser. - It adds support for auto-loading modules referred to by a compile unit. These references are currently in the form of empty translation units. This functionality is gated by the setting target.auto-import-clang-modules (boolean) = false - It improves and corrects support for loading macros from modules, currently by textually pasting all #defines into the user's expression. The improvements center around including only those modules that are relevant to the current context - hand-loaded modules and the modules that are imported from the current compile unit. - It adds an "opt-in" mechanism for all of this functionality. Modules have to be explicitly imported (via @import) or auto-loaded (by enabling the above setting) to enable any of this functionality. It also adds support to the compile unit and symbol file code to deal with empty translation units that indicate module imports, and plumbs this through to the CompileUnit interface. Finally, it makes the following changes to the test suite: - It adds a testcase that verifies that modules are automatically loaded when the appropriate setting is enabled (lang/objc/modules-auto-import); and - It modifies lanb/objc/modules-incomplete to test the case where a module #undefs something that is #defined in another module. <rdar://problem/20299554> llvm-svn: 235313
* Fix -Wformat-pedantic warningsDavid Blaikie2015-04-081-1/+1
| | | | llvm-svn: 234429
* Fixed a bug where we didn't return a value from aSean Callanan2015-04-011-0/+1
| | | | | | | | lambda in SymbolFileDWARFDebugMap. <rdar://problem/20261196> llvm-svn: 233858
* Fixed the way SymbolFileDWARFDebugMap iterates across objectSean Callanan2015-04-012-77/+80
| | | | | | | | | | | files. Before we'd give up if we found a .o that doesn't have DWARF associated with it; now we iterate through them all. Also made this iteration a higher-order function so that people don't have to remember to do this right. <rdar://problem/20261196> llvm-svn: 233838
* [DWARF] Generate qualified names of functions if linkage names are missing.Siva Chandra2015-03-271-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to the change introduced for variable DIEs in r233098. If the linkage names of functions are missing in the DWARF, then their fully qualified names (similar to the name that would be got by demangling their linkage name) is generated using the decl context. This change fixes TestNamespace when the test case is compiled with GCC, hence it is enabled for GCC. The test and the test case are also enhanced to cover variadic functions. Test Plan: dotest.py -C <clang|gcc> -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8623 llvm-svn: 233336
* [DWARF] Remove an unused arg to SymbolFileDWARF::ParseChildParameters.Siva Chandra2015-03-252-3/+0
| | | | | | | | | | | | Test Plan: Build LLDB Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8621 llvm-svn: 233230
* Fix error introduced by changing function signatures.Zachary Turner2015-03-244-51/+59
| | | | | | | | | | | | | | | | | Since ClangASTSource::layoutRecordType() was overriding a virtual function in the base, this was inadvertently causing a new method to be introduced rather than an override. To fix this all method signatures are changed back to taking DenseMaps, and the `override` keyword is added to make sure this type of error doesn't happen again. To keep the original fix intact, which is that fields and bases must be added in offset order, the ImportOffsetMap() function now copies the DenseMap into a vector and then sorts the vector on the value type (e.g. the offset) before iterating over the sorted vector and inserting the items. llvm-svn: 233099
* [DWARF] If linkages names are missing, use decl context to get qualified names.Siva Chandra2015-03-244-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds this alternate route only when parsing variable dies corresponding to global or static variables. The motivation for this is that GCC does not emit linkage names for functions and variables declared/defined in anonymous namespaces. Having this alternate route fixes one part of TestNamespace which fails when the test case is compiled with GCC. An alternate route to get fully qualified names of functions whose linkage names are missing will be added with a followup change. With that, the other failing part of TestNamespace will also be fixed. Test Plan: dotest.py -C gcc -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8569 llvm-svn: 233098
* Fix record layout when synthesizing class types.Zachary Turner2015-03-244-89/+66
| | | | | | | | | | | | | | | | | Prior to this patch, we would try to synthesize class types by iterating over a DenseMap of FieldDecls and adding each one to a CXXRecordDecl. Since a DenseMap doesn't provide a deterministic ordering of the elements, this would not add the fields in FieldOffset order, but rather in some random order determined by the memory layout of the DenseMap. This patch fixes the issue by changing DenseMaps to vectors. The ability to lookup a value in the DenseMap was hardly being used, and where it is sufficient to do a vector lookup. Differential Revision: http://reviews.llvm.org/D8512 llvm-svn: 233090
* Respect include_inlines when looking up functions in SymbolFileDWARFPavel Labath2015-03-132-33/+31
| | | | | | | | | | | | | | | | Summary: SymbolFileDWARF was not respecting the include_inlines argument in function lookup in all code paths. This resulted in an attempt to call an inlined function during expression evaluation, which is impossible, and usually resulted in a segfault in the inferior. This patch makes sure include_inlines is respected in all code paths. Reviewers: clayborg Subscribers: lldb-commits, sivachandra Differential Revision: http://reviews.llvm.org/D8286 llvm-svn: 232151
* Remove unused variablePavel Labath2015-03-121-2/+0
| | | | llvm-svn: 232041
* Optimize finding the Complete Definition of an ObjC class for debug with .o ↵Greg Clayton2015-02-251-7/+55
| | | | | | | | | | | | | files with lots of .o files. When we have a debug map we have an executable with a bunch of STAB symbols and each source file has a N_SO symbol which scopes a bunch of symbols inside of it. We can use this to our advantage here when looking for the complete definition of an objective C class by looking for a symbol whose name matches the class name and whose type is eSymbolTypeObjCClass. If we find one, that symbol will be contained within a N_SO symbol. This symbol gets turned into a symbol whose type is eSymbolTypeSourceFile and that symbol will contain the eSymbolTypeObjCClass which helps us to locate the correct .o file and allows us to only look in that file. To further accelerate things, if we are looking for the implementation, we can avoid looking at all .o files if we don't find a matching symbol because we have a debug map, which means the objective C symbol for the class can't have been stripped, so we can safely not search all remaining .o files. This will save us lots of time when trying to look for "NSObject" and any other AppKit and Foundation classes that we never have implementation definitions for. <rdar://problem/19234225> llvm-svn: 230562
* Keep the user data for compile units up to date since we often create ↵Greg Clayton2015-02-051-2/+11
| | | | | | | | | | lldb_private::CompileUnit objects without creating the DWARFCompileUnit objects when we do DWARF in .o files. Now we make sure to update our DWARFCompileUnit -> lldb_private::CompileUnit user data when it isn't set to ensure quick transitions between the two. <rdar://problem/18371367> llvm-svn: 228264
* Preparatory infrastructural work to support dynamically determining sizes of ↵Enrico Granata2015-01-281-1/+1
| | | | | | | | | | | | ObjC types via the runtime This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for) The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee) This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet llvm-svn: 227274
* Take extra care to ensure we don't deref a NULL pointer.Greg Clayton2015-01-161-14/+18
| | | | llvm-svn: 226299
* Moved Args::StringToXIntYZ to StringConvert::ToXIntYZVince Harron2015-01-151-3/+4
| | | | | | | | | | The refactor was motivated by some comments that Greg made http://reviews.llvm.org/D6918 and also to break a dependency cascade that caused functions linking in string->int conversion functions to pull in most of lldb llvm-svn: 226199
* Don't crash when we can't find a block for some reason, just try and do the ↵Greg Clayton2015-01-151-3/+5
| | | | | | | | right thing and fail gracefully. <rdar://problem/19196221> llvm-svn: 226087
* Don't crash when we run into lexical block address range problems, just ↵Greg Clayton2015-01-151-19/+18
| | | | | | | | ignore the bad ranges and log an error message asking the user to file a bug. <rdar://problem/19021931> llvm-svn: 226085
* Modified LLDB to be able to lookup global variables by address.Greg Clayton2015-01-152-5/+89
| | | | | | | | | | | | This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address. This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name. The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups. <rdar://problem/18945678> llvm-svn: 226084
* Make array symbol reading resilient to incomplete DWARF.Siva Chandra2015-01-051-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GCC emits DW_TAG_subrange_type for static member arrays, but with no attributes. This in turn results in wrong type/value of the array when printing with 'target variable <array var name>'. This patch fixes this so that the array value is printed in this format: (<element type> []) <array var name> = {} Earlier, the array was being interpreted to be of its element type. Note: This does not fix anything to do with 'expr' or 'p' commands. Those commands still error out complaining about incomplete types. Test Plan: dotest.py -p TestStaticVariables Reviewers: emaste, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6799 llvm-svn: 225219
* Audit uses of ConstString::AsCString() to make sure they weren't assumingJim Ingham2014-12-192-3/+3
| | | | | | | | they would always get a non-NULL string back. <rdar://problem/19298575> llvm-svn: 224602
OpenPOWER on IntegriCloud