summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb][NFC] Extract enum parsing from DWARFASTParserClang::ParseTypeFromDWARFRaphael Isemann2019-11-262-100/+113
| | | | Part of the work to split up this monolithic parsing function.
* [lldb][NFCI] Extract subroutine parsing from ↵Raphael Isemann2019-11-262-374/+384
| | | | | | | | | DWARFASTParserClang::ParseTypeFromDWARF Part of the work to split up this monolithic parsing function. Should be NFC but due to the kafkaesque control flow in this case statement this might have some unintended side effects.
* [lldb][NFC] Extract array type parsing from ↵Raphael Isemann2019-11-262-84/+95
| | | | | | DWARFASTParserClang::ParseTypeFromDWARF Part of the work to split up this monolithic parsing function.
* [lldb][NFC] Extract pointer to member type parsing from ↵Raphael Isemann2019-11-262-18/+28
| | | | | | DWARFASTParserClang::ParseTypeFromDWARF Part of the work to split up this monolithic parsing function.
* [lldb][NFC] NULL -> nullptr in ↵Raphael Isemann2019-11-261-4/+4
| | | | DWARFASTParserClang::UpdateSymbolContextScopeForType
* [DWARF] Handle call sites with indirect call targetsVedant Kumar2019-11-224-23/+77
| | | | | | | | | | Split CallEdge into DirectCallEdge and IndirectCallEdge. Teach DWARFExpression how to evaluate entry values in cases where the current activation was created by an indirect call. rdar://57094085 Differential Revision: https://reviews.llvm.org/D70100
* Complete complete types early when importing types from Clang module DWARF.Adrian Prantl2019-11-221-1/+14
| | | | | | | | | | | | | | | | | | | | | This affects -gmodules only. Under normal operation pcm_type is a shallow forward declaration that gets completed later. This is necessary to support cyclic data structures. If, however, pcm_type is already complete (for example, because it was loaded for a different target before), the definition needs to be imported right away, too. Type::ResolveClangType() effectively ignores the ResolveState inside type_sp and only looks at IsDefined(), so it never calls ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(), which does extra work for Objective-C classes. This would result in only the forward declaration to be visible. An alternative implementation would be to sink this into Type::ResolveClangType ( https://github.com/llvm/llvm-project/blob/88235812a71d99c082e7aa2ef9356d43d1f83a80/lldb/source/Symbol/Type.cpp#L5809) though it isn't clear to me how to best do this from a layering perspective. rdar://problem/52134074 Differential Revision: https://reviews.llvm.org/D70415
* [lldb][NFC] Remove ClangASTContext::GetAsDeclContextRaphael Isemann2019-11-201-9/+3
| | | | Everything we pass to this function is already a DeclContext.
* Replace bitfield in lldb::Type with byte-sized members. (NFC)Adrian Prantl2019-11-183-37/+37
| | | | | | Due to alginment and packing using separate members takes up the same amount of space, but makes it far less cumbersome to deal with it in constructors etc.
* [-gmodules] Let LLDB log a warning if the Clang module hash mismatches.Adrian Prantl2019-11-152-12/+70
| | | | | | | | This feature is mostly there to aid debugging of Clang module issues, since the only useful actual the end-user can to is to recompile their program. Differential Revision: https://reviews.llvm.org/D70272
* Add RTTI support to the SymbolFile class hierarchyAdrian Prantl2019-11-1516-0/+103
| | | | Differential Revision: https://reviews.llvm.org/D70322
* Comment the fact that DWARFDebugInfoEntry isn't copyable.Adrian Prantl2019-11-151-0/+4
|
* Fix incorrect comment.Adrian Prantl2019-11-141-3/+5
|
* Convert condition to early exit (NFC)Adrian Prantl2019-11-141-43/+45
|
* Convert UpdateExternalModuleListIfNeeded to use early exits.Adrian Prantl2019-11-141-59/+59
|
* Rename DWO -> Clang module to avoid confusion. (NFC)Adrian Prantl2019-11-141-22/+26
|
* Use ForEachExternalModule in ParseTypeFromClangModule (NFC)Adrian Prantl2019-11-146-34/+87
| | | | | | | | | | | I wanted to further simplify ParseTypeFromClangModule by replacing the hand-rolled loop with ForEachExternalModule, and then realized that ForEachExternalModule also had the problem of visiting the same leaf node an exponential number of times in the worst-case. This adds a set of searched_symbol_files set to the function as well as the ability to early-exit from it. Differential Revision: https://reviews.llvm.org/D70215
* [lldb] Fix dwo variant of TestLibCxxFunctionPavel Labath2019-11-141-1/+2
| | | | | | | | | | The test was failing due to a bug in SymbolFileDWARF::FindFunctions -- the function was searching the main dwarf unit for DW_TAG_subprograms, but the main unit is empty in case of split dwarf. The fix is simple -- search the non-skeleton unit instead. This bug went unnoticed because this function is expensive, and so one generally avoids calling it.
* Remove redundant check. (NFC)Adrian Prantl2019-11-131-3/+0
|
* Use cheaper, equivalent predicate. (NFC)Adrian Prantl2019-11-131-1/+1
|
* Rename clang-module-related *DWO* functions to *ClangModule* (NFC)Adrian Prantl2019-11-135-46/+41
| | | | | | | This avoids confusing them with fission-related functionality. I also moved two accessor functions from DWARFDIE into static functions in DWARFASTParserClang were their only use is located.
* Rename ParseTypeFromDWO to ParseTypeFromClangModule (NFC)Adrian Prantl2019-11-132-26/+27
| | | | | Because that is what this function really does. The old name is misleading.
* [LLDB] Fix a bunch of -Wdocumentation warningsJonas Devlieghere2019-11-131-2/+2
|
* [LLDB][Formatters] Re-enable std::function formatter with fixes to improve ↵shafik2019-11-121-0/+2
| | | | | | | | | non-cached lookup performance Performance issues lead to the libc++ std::function formatter to be disabled. We addressed some of those performance issues by adding caching see D67111 This PR fixes the first lookup performance by not using FindSymbolsMatchingRegExAndType(...) and instead finding the compilation unit the std::function wrapped callable should be in and then searching for the callable directly in the CU. Differential Revision: https://reviews.llvm.org/D69913
* Performance: Add a set of visited SymbolFiles to the other FindFiles variant.Adrian Prantl2019-11-129-16/+28
| | | | | | | | | | | | | | This is basically the same bug as in r260434. SymbolFileDWARF::FindTypes has exponential worst-case when digging through dependency DAG of .pcm files because each object file and .pcm file may depend on an already-visited .pcm file, which may again have dependencies. Fixed here by carrying a set of already visited SymbolFiles around. rdar://problem/56993424 Differential Revision: https://reviews.llvm.org/D70106
* Fix a regression in macOS-style path remapping.Adrian Prantl2019-11-111-19/+21
| | | | | | | | | | | | | | | | When we switched to the LLVM .debug_line parser, the .dSYM-style path remapping logic stopped working for relative paths because of how RemapSourceFile silently fails for relative paths. This patch both makes the code more readable and fixes this particular bug. One interesting thing I learned is that Module::RemapSourceFile() is a macOS-only code path that operates on on the lldb::Module level and is completely separate from target.source-map, which operates on a per-Target level. Differential Revision: https://reviews.llvm.org/D70037 rdar://problem/56924558
* [lldb] Comment typo fixJan Kratochvil2019-11-071-1/+1
|
* Add support for DW_AT_export_symbols for anonymous structsshafik2019-10-282-1/+5
| | | | | | | | | Summary: We add support for DW_AT_export_symbols to detect anonymous struct on top of the heuristics implemented in D66175 This should allow us to differentiate anonymous structs and unnamed structs. We also fix TestTypeList.py which was incorrectly detecting an unnamed struct as an anonymous struct. Differential Revision: https://reviews.llvm.org/D68961
* [lldb][NFC] Fix typo in DWARFASTParserClang.cppRaphael Isemann2019-10-171-2/+2
| | | | llvm-svn: 375187
* (NFC) Delete variable made unused by llvm-svn: 375160Sterling Augustine2019-10-171-1/+0
| | | | | | | | | | | | Reviewers: aprantl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69143 llvm-svn: 375174
* Modernize the rest of the Find.* API (NFC)Adrian Prantl2019-10-1710-224/+144
| | | | | | | | | | | | This patch removes the size_t return value and the append parameter from the remainder of the Find.* functions in LLDB's internal API. As in the previous patches, this is motivated by the fact that these parameters aren't really used, and in the case of the append parameter were frequently implemented incorrectly. Differential Revision: https://reviews.llvm.org/D69119 llvm-svn: 375160
* [lldb] Don't emit artificial constructor declarations as global functionsRaphael Isemann2019-10-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When we have a artificial constructor DIE, we currently create from that a global function with the name of that class. That ends up causing a bunch of funny errors such as "must use 'struct' tag to refer to type 'Foo' in this scope" when doing `Foo f`. Also causes that constructing a class via `Foo()` actually just calls that global function. The fix is that when we have an artificial method decl, we always treat it as handled even if we don't create a CXXMethodDecl for it (which we never do for artificial methods at the moment). Fixes rdar://55757491 and probably some other radars. Reviewers: aprantl, vsk, shafik Reviewed By: aprantl Subscribers: jingham, shafik, labath, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68130 llvm-svn: 375151
* [NativePDB] Remove unused references to ClangASTImporterAlex Langford2019-10-112-3/+0
| | | | llvm-svn: 374587
* [lldb-test] Modify lldb-test to print out ASTs from symbol fileShafik Yaghmour2019-10-111-4/+13
| | | | | | | | | | | Summary: Currently when invoking lldb-test symbols -dump-ast it parses all the debug symbols and calls print(...) on the TranslationUnitDecl. While useful the TranslationUnitDecl::print(...) method gives us a higher level view then the dump from ASTDumper which is what we get when we invoke dump() on a specific AST node. The main motivation for this change is allow us to verify that the AST nodes we create when we parse DWARF. For example in order to verify we are correctly using DIFlagExportSymbols added by D66667 Differential Revision: https://reviews.llvm.org/D67994 llvm-svn: 374570
* Speed up accelerator table lookupsAdrian Prantl2019-10-101-3/+24
| | | | | | | | | | | | | | | | | | | When debugging a large program like clang and doing "frame variable *this", the ValueObject pretty printer is doing hundreds of scoped FindTypes lookups. The ones that take longest are the ones where the DWARFDeclContext ends in something like ::Iterator which produces many false positives that need to be filtered out *after* extracting the DIEs. This patch demonstrates a way to filter out false positives at the accerator table lookup step. With this patch lldb clang-10 -o "b EmitFunctionStart" -o r -o "f 2" -o "fr v *this" -b -- ... goes (in user time) from 5.6s -> 4.8s or (in wall clock) from 6.9s -> 6.0s. Differential Revision: https://reviews.llvm.org/D68678 llvm-svn: 374401
* Remove the is_mangled flag from Mangled and SymbolAdrian Prantl2019-10-092-3/+2
| | | | | | | | | | | | | | | Testing whether a name is mangled or not is extremely cheap and can be done by looking at the first two characters. Mangled knows how to do it. On the flip side, many call sites that currently pass in an is_mangled determination do not know how to correctly do it (for example, they leave out Swift mangling prefixes). This patch removes this entry point and just forced Mangled to determine the mangledness of a string itself. Differential Revision: https://reviews.llvm.org/D68674 llvm-svn: 374180
* Revert Trust the arange accelerator tables in dSYMsAdrian Prantl2019-10-081-13/+7
| | | | | | | This reverts r374117 (git commit 6399db2f6fd64fa250093368be40eb5ae3af513b) while inspecting bot breakage. llvm-svn: 374121
* Trust the arange accelerator tables in dSYMsAdrian Prantl2019-10-081-7/+13
| | | | | | | | | | | | | | | | When ingesting aranges from a dSYM it makes sense to always trust the contents of the accelerator table since it always comes from dsymutil. According to Instruments, skipping the decoding of all CU DIEs to get at the DW_AT_ranges attribute removes ~3.5 seconds from setting a breakpoint by file/line when debugging clang with a dSYM. Interestingly on the wall clock the speedup is less noticeable, but still present. rdar://problem/56057688 Differential Revision: https://reviews.llvm.org/D68655 llvm-svn: 374117
* [DWARFASTParserClang] Factor out structure-like type parsing, NFCVedant Kumar2019-10-074-432/+473
| | | | | | | | | | | Split out the logic to parse structure-like types into a separate function, in an attempt to reduce the complexity of ParseTypeFromDWARF. Inspired by discussion in https://reviews.llvm.org/D68130. Differential Revision: https://reviews.llvm.org/D68422 llvm-svn: 373927
* [DWARFASTParserClang] Delete commented-out typedef, NFCVedant Kumar2019-10-071-18/+19
| | | | | | (& group together all the protected members & typedefs) llvm-svn: 373926
* [lldb] [cmake] Support linking against clang-cpp dylibMichal Gorny2019-10-043-7/+10
| | | | | | | | | Link against clang-cpp dylib rather than split libs when CLANG_LINK_CLANG_DYLIB is enabled. Differential Revision: https://reviews.llvm.org/D68456 llvm-svn: 373734
* [lldb] Fix evaluation of nested classes with parent from other CURaphael Isemann2019-10-021-0/+2
| | | | | | | | | | | | | | This makes sure that we associate DIEs that are imported from other CUs with the appropriate decl context. Without this fix, nested classes can be dumped directly into their CU context if their parent was imported from another CU. Reviewed By: teemperor, labath Differential Revision: https://reviews.llvm.org/D68278 Patch by Jaroslav Sevcik! llvm-svn: 373470
* [lldb] Fix unused variable warningJordan Rupprecht2019-10-011-1/+0
| | | | llvm-svn: 373399
* Fix a condition-flip regression introduced in r373344.Adrian Prantl2019-10-011-1/+1
| | | | llvm-svn: 373354
* Typo (NFC)Adrian Prantl2019-10-011-3/+3
| | | | llvm-svn: 373353
* Remove size_t return parameter from FindTypesAdrian Prantl2019-10-0111-128/+92
| | | | | | | | | | | | | | | In r368345 I accidentally introduced a regression that would over-report the number of matches found by FindTypes if the DeclContext Filter was hit. This patch simply removes the size_t return parameter altogether — it's not that useful. rdar://problem/55500457 Differential Revision: https://reviews.llvm.org/D68169 llvm-svn: 373344
* Update SymbolFilePDB for FindTypes API change.Adrian Prantl2019-10-012-22/+17
| | | | | | This is untested, I don't have access to a Windows machine. llvm-svn: 373342
* Remove unused "append" parameter from FindTypes APIAdrian Prantl2019-09-3011-104/+69
| | | | | | | | | | | | | I noticed that SymbolFileDWARFDebugMap::FindTypes was implementing it incorrectly (passing append=false in a for-loop to recursive calls to FindTypes would yield only the very last set of results), but instead of fixing it, removing it seemed like an even better option. rdar://problem/54412692 Differential Revision: https://reviews.llvm.org/D68171 llvm-svn: 373224
* Unwind: Add a stack scanning mechanism to support win32 unwindingPavel Labath2019-09-272-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Windows unwinding is weird. The unwind rules do not (always) describe the precise layout of the stack, but rather expect the debugger to scan the stack for something which looks like a plausible return address, and the unwind based on that. The reason this works somewhat reliably is because the the unwinder also has access to the frame sizes of the functions on the stack. This allows it (in most cases) to skip function pointers in local variables or function arguments, which could otherwise be mistaken for return addresses. Implementing this kind of unwind mechanism in lldb was a bit challenging because we expect to be able to statically describe (in the UnwindPlan) structure, the layout of the stack for any given instruction. Giving a precise desription of this is not possible, because it requires correlating information from two functions -- the pushed arguments to a function are considered a part of the callers stack frame, and their size needs to be considered when unwinding the caller, but they are only present in the unwind entry of the callee. The callee may end up being in a completely different module, or it may not even be possible to determine it statically (indirect calls). This patch implements this functionality by introducing a couple of new APIs: SymbolFile::GetParameterStackSize - return the amount of stack space taken up by parameters of this function. SymbolFile::GetOwnFrameSize - the size of this function's frame. This excludes the parameters, but includes stuff like local variables and spilled registers. These functions are then used by the unwinder to compute the estimated location of the return address. This address is not always exact, because the stack may contain some additional values -- for instance, if we're getting ready to call a function then the stack will also contain partially set up arguments, but we will not know their size because we haven't called the function yet. For this reason the unwinder will crawl up the stack from the return address position, and look for something that looks like a possible return address. Currently, we assume that something is a valid return address if it ends up pointing to an executable section. All of this logic kicks in when the UnwindPlan sets the value of CFA as "isHeuristicallyDetected", which is also the final new API here. Right now, only SymbolFileBreakpad implements these APIs, but in the future SymbolFilePDB will use them too. Differential Revision: https://reviews.llvm.org/D66638 llvm-svn: 373072
* [Dwarf] Fix switch cases that take an dw_tag_t.Jonas Devlieghere2019-09-253-0/+10
| | | | | | Now that dw_tag_t is an enum, a default case is required. llvm-svn: 372920
OpenPOWER on IntegriCloud