summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [lldb][DataFormatters] Support pretty printing std::string when built with ↵Jordan Rupprecht2019-11-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -funsigned-char. Summary: When built w/ `-funsigned-char`, `std::string` becomes equivalent to `std::basic_string<unsigned char>`, causing these formatters to not match. This patch adds overloads for both libstdc++ and libc++ string formatters that accepts unsigned char. Motivated by the following example: ``` $ cat pretty_print.cc template <typename T> void print_val(T s) { std::cerr << s << '\n'; // Set a breakpoint here! } int main() { std::string val = "hello"; print_val(val); return 0; } $ clang++ -stdlib=libc++ -funsigned-char -fstandalone-debug -g pretty_print.cc $ lldb ./a.out -b -o 'b pretty_print.cc:6' -o r -o 'fr v' ... (lldb) fr v (std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char> >) s = { __r_ = { std::__1::__compressed_pair_elem<std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char> >::__rep, 0, false> = { __value_ = { = { __l = (__cap_ = 122511465736202, __size_ = 0, __data_ = 0x0000000000000000) __s = { = (__size_ = '\n', __lx = '\n') __data_ = { [0] = 'h' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' [5] = '\0' ... ``` Reviewers: labath, JDevlieghere, shafik Subscribers: christof, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70517
* 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] Modernize string handling in ↵Raphael Isemann2019-11-211-11/+8
| | | | ClangExpressionDeclMap::FindExternalVisibleDecl
* [lldb][NFC] Move searching functions in ClangExpressionDeclMap to own functionRaphael Isemann2019-11-212-89/+121
|
* [lldb][NFC] Reduce scope of some variables in ↵Raphael Isemann2019-11-211-5/+3
| | | | ClangExpressionDeclMap::FindExternalVisibleDecls
* [lldb][NFC] Move searching local variables into own functionRaphael Isemann2019-11-212-39/+74
|
* [lldb][NFC] Move searching the ClangModulesDeclVendor into own functionRaphael Isemann2019-11-212-72/+86
|
* [lldb][NFC] Move searching for the local variable namespace into own functionRaphael Isemann2019-11-212-24/+38
|
* [lldb][NFC] Early exit in ClangExpressionDeclMap::FindExternalVisibleDeclsRaphael Isemann2019-11-211-302/+302
|
* Handle the case where the 'g' packet doesn't get all regs.Jason Molenda2019-11-201-0/+15
| | | | | | | | | | lldb would silently accept a response to the 'g' packet (read all registers) which was too large; this handles the case where it is too small. Differential Revision: https://reviews.llvm.org/D70417 <rdar://problem/34916465>
* [lldb] Fix NSURL data formatter truncation issueDavide Italiano2019-11-201-21/+33
| | | | | | | | | | | | Remove hardcoded string prefix length assumption causing issues when concatenating summary for NSURL in NSURLSummaryProvider. Provider relies on concatenation of NSStringProvider results for summary, and while the strings are prefixed with '@' in Objective-C, that is not the case in Swift causing part of the description to be truncated. This will be tested in the downstream fork. Patch by Martin Svensson!
* [lldb][NFC] Move searching for $__lldb_objc_class into its own functionRaphael Isemann2019-11-202-122/+134
| | | | Same as in commit e7cc833ddafdca10be4ef1322ab96ffee774045b but with $__lldb_objc_class.
* [lldb][NFC] Move searching for $__lldb_class into its own function in ↵Raphael Isemann2019-11-202-94/+117
| | | | ClangExpressionDeclMap
* [lldb][NFC] Move ClangExpressionDeclMap's persistent decl search into its ↵Raphael Isemann2019-11-202-53/+73
| | | | | | | | own function Searching persistent decls is a small subset of the things FindExternalVisibleDecls does. It should be its own function instead of being encapsulated in this `do { } while(false);` pattern.
* [lldb][NFC] Simplify ClangASTContext::GetBasicTypesRaphael Isemann2019-11-201-13/+12
| | | | | static convenience methods that do the clang::ASTContext -> ClangASTContext conversion and handle errors by simply ignoring them are not a good idea.
* [lldb][NFC] Remove ClangASTContext::GetAsDeclContextRaphael Isemann2019-11-201-9/+3
| | | | Everything we pass to this function is already a DeclContext.
* [lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overloadRaphael Isemann2019-11-201-4/+6
| | | | | | This overload is only used in one place and having static overloads for all methods that only do an additional clang::ASTContext -> ClangASTContext conversion is just not sustainable.
* [lldb] Remove ClangExpressionDeclMap::ResolveUnknownTypesRaphael Isemann2019-11-193-90/+0
| | | | | | | | | | | | | | | | | | | | | Summary: This is some really shady code. It's supposed to kick in after an expression already failed and then try to look up "unknown types" that for some undocumented reason can't be resolved during/before parsing. Beside the fact that we never mark any type as `EVUnknownType` in either swift-lldb or lldb (which means this code is unreachable), this code doesn't even make the expression evaluation succeed if if would ever be executed but instead seems to try to load more debug info that maybe any following expression evaluations might succeed. This patch removes ClangExpressionDeclMap::ResolveUnknownTypes and the related data structures/checks/calls. Reviewers: davide Reviewed By: davide Subscribers: aprantl, abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70388
* [lldb-server] Use LLDB_LOG_ERROR to consume Error<> even if logging is disabledMartin Storsjö2019-11-193-12/+12
| | | | Differential Revision: https://reviews.llvm.org/D70386
* 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.
* [lldb][NFC] Cleanup comments in ClangASTSource.hRaphael Isemann2019-11-181-22/+23
| | | | | The current file doesn't follow the 80 character limit and uses this cramped comment style that is hard to read.
* [lldb] [Process/NetBSD] Implement thread name gettingMichał Górny2019-11-181-1/+38
| | | | | | | Implement thread name getting sysctl() on NetBSD. Also fix the incorrect type in pthread_setname_np() in the relevant test. Differential Revision: https://reviews.llvm.org/D70363
* Avoid including Builtins.h in Preprocessor.hReid Kleckner2019-11-151-0/+1
| | | | | | Builtins are rarely if ever accessed via the Preprocessor. They are typically found on the ASTContext, so there should be no performance penalty to using a pointer indirection to store the builtin context.
* Fix -Wunused-result warnings in LLDBReid Kleckner2019-11-152-4/+4
| | | | | | | | | | Three uses of try_lock intentionally ignore the result, as explained in the comment. Make that explicit with a void cast. Add what appears to be a missing return in the clang expression parser code. It's a functional change, but presumably the right one. Differential Revision: https://reviews.llvm.org/D70281
* [-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
|
* [LLDB] Fix more -Wdocumentation issues (NFC)Jonas Devlieghere2019-11-141-7/+7
|
* 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-147-43/+100
| | | | | | | | | | | 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.
* [lldb] Fix that trailing backslashes in source lines break the Clang highlighterRaphael Isemann2019-11-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: Clang's raw Lexer doesn't produce any tokens for trailing backslashes in a line. This doesn't work with LLDB's Clang highlighter which builds the source code to display from the list of tokens the Lexer returns. This causes that lines with trailing backslashes are lacking the backslash and the following newline when rendering source code in LLDB. This patch removes the trailing newline from the current line we are highlighting. This way Clang doesn't drop the backslash token and we just restore the newline after tokenising. Fixes rdar://57091487 Reviewers: JDevlieghere, labath Reviewed By: JDevlieghere, labath Subscribers: labath, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70177
* [LLDB] Cleanup the DataEncoder utility. (NFC)Jonas Devlieghere2019-11-131-1/+1
| | | | | This commit removes unused methods from the DataEncoder class and cleans up the API by making all the internal methods private.
* [LLDB] Fix another set of -Wdocumentation warningsJonas Devlieghere2019-11-131-1/+1
| | | | | At this point I'm just fixing issues as I see them pop up locally in incremental builds.
* [RegisterContext] Remove now unneded vestiges.Davide Italiano2019-11-134-24/+0
|
* [LLDB] Fix a bunch of -Wdocumentation warnings in ExpressionParserJonas Devlieghere2019-11-136-111/+35
|
* 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-137-18/+8
|
* [LLDB][Formatters] Re-enable std::function formatter with fixes to improve ↵shafik2019-11-123-78/+128
| | | | | | | | | 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
* [ObjectFileMachO] Fix the build for __arm64__.Davide Italiano2019-11-121-2/+1
| | | | Catch up with an API change.
* 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
* [lldb] Fix some warnings in the python pluginPavel Labath2019-11-122-2/+3
|
* [lldb] [Process/NetBSD] Use PT_STOP to stop the process [NFCI]Michał Górny2019-11-122-6/+7
| | | | Differential Revision: https://reviews.llvm.org/D70060
OpenPOWER on IntegriCloud