summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* [LLDB] - Simplify. NFC.George Rimar2018-10-101-8/+1
| | | | | | | | | | There are several places that call `FindRanges`, all of them use `Slide` to adjust the ranges found by the base address. All except one, which does the same manually in a loop. Patch updates it to use `Slide` for consistency. llvm-svn: 344122
* [LLDB] - Add basic support for .debug_rnglists section (DWARF5)George Rimar2018-10-105-12/+105
| | | | | | | | | This adds a basic support of the .debug_rnglists section. Only the DW_RLE_start_length and DW_RLE_end_of_list entries are supported. Differential revision: https://reviews.llvm.org/D52981 llvm-svn: 344119
* Add support for artificial tail call framesVedant Kumar2018-10-054-0/+68
| | | | | | | | | | | | | | | | This patch teaches lldb to detect when there are missing frames in a backtrace due to a sequence of tail calls, and to fill in the backtrace with artificial tail call frames when this happens. This is only done when the execution history can be determined from the call graph and from the return PC addresses of calls on the stack. Ambiguous sequences of tail calls (e.g anything involving tail calls and recursion) are detected and ignored. Depends on D49887. Differential Revision: https://reviews.llvm.org/D50478 llvm-svn: 343900
* DWARFExpression: Resolve file addresses in the linked moduleAdrian Prantl2018-10-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to https://reviews.llvm.org/D46362. When evaluating a complex expression in DWARFExpression::Evaluate, file addresses must be resolved to load addresses before we can perform operations such as DW_OP_deref on them. For this the address goes through three steps 1. Read the file address as stored in the DWARF 2. Link/relocate the file address (when reading from a .dSYM, this is a no-op) 3. Convert the file address to a load address. D46362 implemented step (3) by resolving the file address using the Module that the original DWARF came from. In the case of a dSYM that is correct, but when reading from .o files, we need to look up relocated/linked addresses, so the right place to look them up is the current frame's module. This patch fixes that by setting the expression's Module to point to the linked debugmap object. A word a bout the unorthodox testcase: The motivating testcase for this fix is in Swift, but I managed to hand-modify LLVM-IR for a trivial C program to exhibit the same problem, so we can fix this in llvm.org. rdar://problem/44689915 Differential Revision: https://reviews.llvm.org/D52678 llvm-svn: 343612
* Revert r343318 together with llvm commit r343317Luke Cheeseman2018-09-282-3/+3
| | | | llvm-svn: 343342
* Reapply the changes reverted by r343236Luke Cheeseman2018-09-282-3/+3
| | | | llvm-svn: 343318
* Revert r343193 together with r343192Luke Cheeseman2018-09-272-3/+3
| | | | llvm-svn: 343236
* Update CallFrameString API to account for r343114Luke Cheeseman2018-09-272-3/+3
| | | | | | | - CallFrameString now takes an Arch parameter to account for multiplexing overlapping CFI directives llvm-svn: 343193
* Replace pointer to C-array of PropertyDefinition with llvm::ArrayRefTatyana Krasnukha2018-09-271-3/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D52572 llvm-svn: 343181
* Replace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer ↵Tatyana Krasnukha2018-09-261-5/+4
| | | | | | | | llvm::ArrayRef Differential Revision: https://reviews.llvm.org/D49017 llvm-svn: 343130
* [LLDB] - Improved DWARF5 support.George Rimar2018-09-1311-79/+288
| | | | | | | | | This patch improves the support of DWARF5. Particularly the reporting of source code locations. Differential revision: https://reviews.llvm.org/D51935 llvm-svn: 342153
* [PDB] Parse UDT symbols and pointers to members (combined patch)Aleksandr Urakov2018-08-141-90/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: In this patch I've tried to combine the best ideas from D49368 and D49410, so it implements following: - Completion of UDTs from a PDB with a filling of a layout info; - Pointers to members; - Fixes the bug relating to a virtual base offset reading from `vbtable`. The offset was treated as an unsigned, but it can be a negative sometimes. - Support of MSInheritance attribute Reviewers: asmith, zturner, rnk, labath, clayborg, lldb-commits Reviewed By: zturner Subscribers: aleksandr.urakov, stella.stamenova, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D49980 llvm-svn: 339649
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-071-1/+1
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* [DWARFASTParser] Remove special cases for `llvm-gcc`Davide Italiano2018-08-011-26/+3
| | | | | | | | Reviewed by: aprantl, labath. Differential Revision: https://reviews.llvm.org/D48500 llvm-svn: 338638
* Remove friend class declarations from DWARFUnit and DWARFCompileUnitJan Kratochvil2018-07-292-4/+0
| | | | | | They are no longer needed since D45170. llvm-svn: 338224
* [SymbolFile] Implement GetCompleteObjCClass for .debug_namesJonas Devlieghere2018-06-272-1/+44
| | | | | | | | | | | | | | | When running the test suite with .debug_names a bunch of tests were failing because GetCompleteObjCClass was not yet implemented for DebugNamesDWARFIndex. This patch adds the required logic. We use the .debug_names to find the Objective-C class and then rely on DW_AT_APPLE_objc_complete_type to find the complete type. If we can't find it or the attribute is not supported, we return a list of potential complete types. Differential revision: https://reviews.llvm.org/D48596 llvm-svn: 335776
* Remove dead codeFrederic Riss2018-06-221-42/+20
| | | | | | | | Our DWARF parsing code had a workaorund for Objective-C "self" not being marked as artifial by the compiler. Clang has been doing this since 2010, so let's just drop the workaround. llvm-svn: 335313
* DebugNamesDWARFIndex: fix handling of compressed sectionsPavel Labath2018-06-141-0/+1
| | | | | | | | | | | | | This fixes a silly bug where we were accidentally freeing the memory used to store the decompressed .debug_names data. I had actually considered this scenario when writing the class and put appropriate precautions in place -- I just failed to wire it all up correctly. This was only an issue for compressed sections because in case of uncompressed ones we would access the data straight out of the mmapped object file. llvm-svn: 334717
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-133-7/+10
| | | | | | | | | | | | | | | | SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
* [FileSpec] Delegate common operations to llvm::sys::pathJonas Devlieghere2018-06-131-1/+1
| | | | | | | | | | | | | | | With the recent changes in FileSpec to use LLVM's path style, it is possible to delegate a bunch of common path operations to LLVM's path helpers. This means we only have to maintain a single implementation and at the same time can benefit from the efforts made by the rest of the LLVM community. This is part one of a set of patches. There was no obvious way to split this so I just worked from top to bottom. Differential revision: https://reviews.llvm.org/D48084 llvm-svn: 334615
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-133-6/+6
| | | | llvm-svn: 334614
* DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes methodPavel Labath2018-06-122-1/+13
| | | | | | | | | | | | This method is used to find complete definitions of a type when one parses a compile unit with only forward declaration available. Since it is only accessed from DWARFASTParserClang, it was not possible/easy to trigger this codepath from lldb-test. Therefore, I adapt add a debug-names variant to an existing dotest test to cover this scenario. llvm-svn: 334516
* DWARFDebugNames: Implement last GetGlobalVariables overloadPavel Labath2018-06-122-1/+23
| | | | | | | This function implements the search for all global variables within a given compilation unit. llvm-svn: 334500
* DWARFDebugNames: Fix lookup in dwo filesPavel Labath2018-06-112-9/+31
| | | | | | | | | | | | The getDIESectionOffset function is not correct for split dwarf files (and will probably be removed in D48009). This patch implements correct section offset computation for split and non-split compile units -- we first need to check if the referenced unit is a skeleton unit, and if it is, we add the die offset to the full unit base offset (as the full unit is the one which contains the die). llvm-svn: 334402
* DebugNamesDWARFIndex: Implement regex version of the GetFunctions methodPavel Labath2018-06-084-13/+34
| | | | | | | | | This also fixes a bug where SymbolFileDWARF was returning the same function multiple times - this can happen if both mangled and demangled names match the regex. Other lookup lookup functions had code to handle this case, but it was forgotten here. llvm-svn: 334277
* DebugNamesDWARFIndex: Implement GetFunctions methodPavel Labath2018-06-086-72/+105
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements the non-regex variant of GetFunctions. To share more code with the Apple implementation, I've extracted the common filtering code from that class into a utility function on the DWARFIndex base class. The new implementation also searching the accelerator table multiple times -- previously it could happen that the apple table would return the same die more than once if one specified multiple search flags in name_type_mask. This way, I separate table iteration from filtering, and so we can be sure each die is inserted at most once. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47881 llvm-svn: 334273
* DIERef: move trivial constructors into the headerPavel Labath2018-06-072-9/+4
| | | | | | | | | This enables more inlining/optimization opportunities for a fairly critical class. NFCI llvm-svn: 334198
* DebugNamesDWARFIndex: Add type lookup suportPavel Labath2018-06-072-1/+11
| | | | | | | | This implements just one of the GetTypes overloads. The other is not testable from lldb-test so I'm leaving it unimplemented until I figure out what to do with testing. llvm-svn: 334190
* DebugNamesDWARFIndex: add namespace lookup supportPavel Labath2018-06-072-1/+11
| | | | llvm-svn: 334186
* DebugNamesDWARFIndex: Add support for partial indexesPavel Labath2018-06-074-18/+46
| | | | | | | | | | | | | | | | | | | | | Summary: It possible that a single module has indexed and non-indexed compile units. In this case, we can use the fast indexed lookup for the first ones and fall back to the manual index for the others. This patch implements this functionality by adding a units_to_avoid argument to the ManualDWARFIndex constructor. Any units present in that list will be ignored for the purposes of manual index. Individual DebugNamesDWARFIndex then always consult both the manual fallback index as well as the index in the .debug_names section. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47832 llvm-svn: 334185
* DebugNamesDWARFIndex: Add ability to lookup variablesPavel Labath2018-06-078-31/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the ability to lookup variables to the DWARF v5 index class. During review we discovered an inconsistency between how the existing two indexes handle looking up qualified names of the variables: - manual index would return a value if the input string exactly matched the demangled name of some variable. - apple index ignored the context and returned any variable with the same base name. So, this patch also rectifies that situation: - it removes all context handling from the index classes. The GetGlobalVariables functions now just take a base name. For manual index, this meant we can stop putting demangled names into the variable index (this matches the behavior for functions). - context extraction is put into SymbolFileDWARF, so that it is common to all indexes. - additional filtering based on the context is also done in SymbolFileDWARF. This is done via a simple substring search, which is not ideal, but it matches what we are doing for functions (cf. Module::LookupInfo::Prune). Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47781 llvm-svn: 334181
* [DWARF] Add (empty) DebugNamesDWARFIndex class and a setting to control its usePavel Labath2018-06-067-23/+162
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the skeleton for implementing the DWARF v5 name index class. All of the methods are stubbed out and will be implemented in subsequent patches. The interesting part of the patch is the addition of a "ignore-file-indexes" setting to the dwarf plugin which enables a user to force using manual indexing path in lldb (for example as a debugging aid). I have also added a test that verifies that file indexes are used by default. Reviewers: JDevlieghere, clayborg, jingham Subscribers: mgorny, mehdi_amini, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47629 llvm-svn: 334088
* DWARFIndex: more GetFunctions cleanupPavel Labath2018-06-057-63/+14
| | | | | | | This applies similar simplification as r334004, only it touches the regex version of the method. llvm-svn: 334012
* Fix windows build broken by r334004Pavel Labath2018-06-051-1/+1
| | | | | | | The problem was a link error due to a missing =0 on an abstract method. Interestingly, this was not a problem for clang/linux. llvm-svn: 334006
* DWARFIndex: simplify GetFunctions methodsPavel Labath2018-06-056-175/+92
| | | | | | | | | | | | | | | | Now that Apple index determines method-ness straight from the debug info, we don't need to resolve the functions into SymbolContexts inside the Index classes. This removes the need for callback arguments and allows us to pull the common parts out of the two implementations of these functions back into the SymbolFileDWARF class. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47147 llvm-svn: 334004
* Fixup r333987Pavel Labath2018-06-052-2/+3
| | | | | | | - add #include <atomic> (fixes windows build) - remove std::move (fixes "using move prevents copy ellision" warnings) llvm-svn: 333996
* Protect DWARFCompileUnit::m_die_array by new mutexesJan Kratochvil2018-06-053-38/+134
| | | | | | | | | | | | | If BuildAddressRangeTable called ExtractDIEsIfNeeded(false), then another thread started processing data from m_die_array and then the first thread called final ClearDIEs() the second thread would crash. It is also required without multithreaded debugger using DW_TAG_partial_unit for DWZ. Differential revision: https://reviews.llvm.org/D40470 llvm-svn: 333987
* AppleDWARFIndex: Get function method-ness directly from debug infoPavel Labath2018-06-044-61/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When searching for methods only, we need to do extra work to make sure the functions we get from the apple tables are indeed methods. Previously we were resolving the DIE into a SymbolContext and then checked whether the enclosing CompilerDeclContext is a class (or struct, or union). This patch changes that to operate on the debug info directly. This should be: - simpler - faster - more consistent with the ManualDWARFIndex (which does the same check, only at indexing time). What we lose this ways is for the language plugin to have a say in what it considers to be a "class", but that's probably more flexibility than we need (and if we really wanted to do that in the future, we could implement a more direct way to consult the plugin about this). This also fixes the find-method-local-struct test, which was failing because we were not able to construct a CompilerDeclContext for a local struct correctly. As a drive-by, I rename the DWARFDIE's IsStructClassOrUnion method to match the name on the CompilerDeclContext class. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47470 llvm-svn: 333878
* Fix support for distinguishing archive members by timestamp on Darwin.James Y Knight2018-06-022-3/+7
| | | | | | | | | | | | | | | | | | | On Darwin, the binary's symbol table points to debug info in object files -- potentially object files within a static library. Such a library may have multiple entries with the same name, distinguished only by timestamp. The code was already _attempting_ to handle this case (see the code in ObjectContainerBSDArchive::Archive::FindObject which disambiguates via timestamp). But, unfortunately, while the timestamp was taken into account on the _first_ lookup, the result was then cached in a map keyed only off of the path. Added the timestamp to the cache, and added a test case. Differential Revision: https://reviews.llvm.org/D47660 llvm-svn: 333813
* Remove append parameter to FindGlobalVariablesPavel Labath2018-05-314-45/+28
| | | | | | | | | | | | | | | | | | | Summary: As discussed in https://bugs.llvm.org/show_bug.cgi?id=37317, FindGlobalVariables does not properly handle the case where append=false. As this doesn't seem to be used in the tree, this patch removes the parameter entirely. Reviewers: clayborg, jingham, labath Reviewed By: clayborg Subscribers: aprantl, lldb-commits, kubamracek, JDevlieghere Differential Revision: https://reviews.llvm.org/D46885 Patch by Tom Tromey <ttromey@mozilla.com>. llvm-svn: 333639
* Simplify DWARFUnit::m_die_array swap() to use shrink_to_fit()Jan Kratochvil2018-05-311-9/+1
| | | | | | | | | rL145086 introduced m_die_array.shrink_to_fit() implemented by exact_size_die_array.swap, it was before LLVM became written in C++11. Differential revision: https://reviews.llvm.org/D47492 llvm-svn: 333636
* Fix return value of DWARFUnit::ExtractDIEsIfNeeded()Jan Kratochvil2018-05-301-6/+5
| | | | | | This is a leftover regression from: https://reviews.llvm.org/D46810 llvm-svn: 333517
* Remove unused DWARFUnit::HasDIEsParsed()Jan Kratochvil2018-05-292-4/+0
| | | | | | | It was not implemented correctly after https://reviews.llvm.org/D46810 but then it has not been used anywhere anyway. llvm-svn: 333452
* Fix compiler unused variable warning in DWARFUnitJan Kratochvil2018-05-291-2/+0
| | | | | | Alex Langford has reported it from: https://reviews.llvm.org/D46810 llvm-svn: 333449
* Fix DWARFUnit::GetUnitDIEPtrOnly stale pointerJan Kratochvil2018-05-295-80/+130
| | | | | | | | | | | | | GetUnitDIEPtrOnly() needs to return pointer to the first DIE. But the first element of m_die_array after ExtractDIEsIfNeeded(true) may move in memory after later ExtractDIEsIfNeeded(false). DWARFDebugInfoEntry::collection m_die_array is std::vector, its data may move during its expansion. Differential revision: https://reviews.llvm.org/D46810 llvm-svn: 333437
* ManualDWARFIndex: Treat DW_TAG_subprogram and DW_TAG_inlined_subroutine the ↵Pavel Labath2018-05-291-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | same way Summary: We were treating subprograms and inlined subroutines differently when building the index. The difference was in which indexes were individual tags inserted (subprograms went to all indexes, where as inlined subroutines only into the basename and full name indexes). This seems like an error, because an inlined subroutine can still represent an C++ or an ObjC method. I don't see anything in the subprogram branch which should not apply to an inlined subroutine, so I propose to just treat them identically. This makes searching for an inlined method behave the same way as for the apple index. I write an assembly-based test because I did not want to depend on particular clang inlining behavior (and because I wanted to see how hard would it be). Reviewers: clayborg, JDevlieghere Subscribers: eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D47368 llvm-svn: 333398
* Remove DWARFUnit::ClearDIEs parameter keep_compile_unit_dieJan Kratochvil2018-05-253-7/+6
| | | | | | | It has been now always passed as true and during planned D46810 it would no longer make sense. llvm-svn: 333287
* ManualDWARFIndex: Fix misclassification of methods in unionsPavel Labath2018-05-253-8/+8
| | | | | | | Apple index was already treating them as methods. Not doing the same seems like an omission. llvm-svn: 333266
* ManualDWARFIndex: reduce long parameter listsPavel Labath2018-05-252-117/+93
| | | | | | | | | Several functions were passing a list of 8 NameToDIE arguments around. This puts those variables in a struct and passes that instead, reducing code duplication and the possibility of error (swapping two arguments accidentally). llvm-svn: 333264
* Use DWARFBaseDIE as a compile-time protectionJan Kratochvil2018-05-244-10/+10
| | | | | | | | | As suggested by Pavel Labath in D46810 DWARFUnit::GetUnitDIEOnly() returning a pointer to m_first_die should not permit using methods like GetFirstChild(). Differential revision: https://reviews.llvm.org/D47276 llvm-svn: 333224
OpenPOWER on IntegriCloud