summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove dead code from SymbolFileDWARF:Greg Clayton2014-12-042-188/+0
| | | | | | | | | | | | | | | | | | lldb::TypeSP SymbolFileDWARF::FindDefinitionTypeForDIE ( DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, const lldb_private::ConstString &type_name); This function isn't used as it has been replaced by: lldb::TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext ( const DWARFDeclContext &die_decl_ctx); I am about to change the way we resolve C/C++ class/struct/union types and want to clean up SymbolFileDWARF before I start. llvm-svn: 223376
* Fixed an issue where a DW_FORM_ref{2,4,8} might be extracted incorrectly ↵Greg Clayton2014-11-226-116/+103
| | | | | | | | | | because the wrong compile unit was being used to calculate the compile unit relative offset. This was fixed by making the DWARFFormValue contain the compile unit that it needs so it can decode its form value correctly. Any form value that requires a compile unit will now assert. If any of the assertions that were added are triggered, then code that led to the extraction of the form value without properly setting the compile unit must be fixed immediately. <rdar://problem/19035440> llvm-svn: 222602
* Setting breakpoints with name mask eFunctionNameTypeBase was broken for ↵Jim Ingham2014-10-251-5/+5
| | | | | | | | straight C names by 220432. Get that working again. llvm-svn: 220602
* Remove dead store.Jason Molenda2014-10-161-1/+1
| | | | | | clang static analyzer fixit. llvm-svn: 219908
* Guard against NULL derefs.Jason Molenda2014-10-161-3/+3
| | | | | | clang static analyzer fixits. llvm-svn: 219889
* It's possible for this function to not be passed a CompUnit*; addJason Molenda2014-10-161-3/+16
| | | | | | | guards around a few additional uses of the cu local pointer. clang static analyzer fixit. llvm-svn: 219885
* Make sure local var cu is non-NULL before dereferencing.Jason Molenda2014-10-151-2/+3
| | | | | | | (it was checked for NULL-ness in some places, not in others) clang static analyzer fixit. llvm-svn: 219771
* dwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.Todd Fiala2014-09-292-2/+10
| | | | | | | | See http://reviews.llvm.org/D5533 for details. Change by Tong Shen. llvm-svn: 218641
* DWARF64 FixesTodd Fiala2014-09-1110-65/+145
| | | | | | | | | | | | | | | | 1. DW_FORM_strp and DW_FORM_sec_offset are 64bits for DWARF64 / 32bits for DWARF32 They are different from DW_FORM_addr, whose size is specified in .debug_info 2. Bump DWARF version support form [2,3] to [2,4] in DWARFDebugLine.cpp 3. Fix DWARFDebugLine to support DWARF64 See http://reviews.llvm.org/D5307 for more details. Reviewed by Greg Clayton and Jason Molenda. Change by Tong Shen. llvm-svn: 217607
* Remove the hostname part from compilation directories, if supplied by Matthew Gardiner2014-08-261-0/+40
| | | | | | DWARF2/3 compliant producers. llvm-svn: 216440
* Patch to enable LLDB to extract value bytes from DWARF block forms and ↵Enrico Granata2014-08-111-2/+22
| | | | | | udata/sdata forms. By Greg Clayton llvm-svn: 215379
* Cleanup the iOS simulator code.Greg Clayton2014-07-101-1/+7
| | | | | | | | | | | Fixes include: - Don't say that "<arch>-apple-ios" is compatible with "<arch>-apple-macosx" - Fixed DynamicLoaderMacOSXDYLD so specify an architecture that was converted solely from a cputype and subtype, just specify the file + UUID. - Fixed PlatformiOSSimulator::GetSupportedArchitectureAtIndex() so it returns the correct archs - Fixed SymbolFileDWARFDebugMap to load .o files correctly by just specifying the architecture without the vendor and OS now that "<arch>-apple-ios" is not compatible with "<arch>-apple-macosx" so we can load .o files correctly for DWARF with debug map - Fixed the coded in TargetList::CreateTarget() so it does the right thing with an underspecified triple where just the arch is specified. llvm-svn: 212783
* Fix typos.Bruce Mitchener2014-07-0810-16/+16
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-013-11/+11
| | | | llvm-svn: 212132
* Minumum -> Minimum.Bruce Mitchener2014-07-011-3/+3
| | | | llvm-svn: 212129
* Fix Windows warnings.Todd Fiala2014-05-281-3/+3
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* Remove > 1 check against a boolean.Hafiz Abid Qadeer2014-04-151-1/+1
| | | | | | | I saw a complain about this code on the LLVM channel. It looks wrong to me as has_tag is a boolean. I am committing it as obvious. llvm-svn: 206270
* Accept DWARF version 2 and 3 in debug_line tablesEd Maste2014-04-081-2/+2
| | | | | | | Issue reported by Matthew Gardiner. Further work is necessary to synchronize LLDB's DWARF classes with the derivatives now in LLVM. llvm-svn: 205771
* Xcode 5 crashes if lldb stops at breakpoint if long c++ template lists are ↵Greg Clayton2014-04-043-45/+37
| | | | | | | | | | | | | | | present. This fix reduces the stack size of SymbolFileDWARF::ParseType(). It seems that clang is not very good at sharing locations on the stack with local variables in large functions that have many blocks and each variable gets unique locations. The reduction in size was done by: 1 - removing some large locals that were default constructed by not used 2 - Placing some larger local variables into std::unique_ptr<> to make them on the heap 3 - removing local variables there were large and being populated but not being used 4 - reducing the size of some typedefs to llvm::SmallVector<T, N> so that N wasn’t excessively large <rdar://problem/16431645> llvm-svn: 205640
* Don’t crash when we get an invalid .debug_aranges set, just ignore it. ↵Greg Clayton2014-04-041-29/+65
| | | | | | | | Also print out warning messages if LLDB_CONFIGURATION_DEBUG is defined. <rdar://problem/16516343> llvm-svn: 205634
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-044-200/+198
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-1/+1
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-0/+1
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Add support for dumping DW_LNE_set_discriminator line table extended entries.Greg Clayton2014-03-201-1/+7
| | | | llvm-svn: 204369
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-202-64/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Parse DW_AT_ranges for compile units on Darwin when .debug_aranges is not ↵Greg Clayton2014-03-146-15/+77
| | | | | | | | available for the current compile unit. <rdar://problem/16321434> llvm-svn: 203985
* If DWARF debug info and verbose mode is enabled ("log enable dwarf info ↵Greg Clayton2014-03-121-4/+8
| | | | | | verbose"), then dump all DIEs for a compile unit after all DIEs have been parsed for a compile unit. llvm-svn: 203692
* Allow verbose logging in the "dwarf" log channel.Greg Clayton2014-03-121-0/+2
| | | | llvm-svn: 203684
* Remove unused code.Greg Clayton2014-03-072-103/+0
| | | | llvm-svn: 203292
OpenPOWER on IntegriCloud