summaryrefslogtreecommitdiffstats
path: root/lldb/include
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb][NFC] Remove ThreadSafeSTLVector and ThreadSafeSTLMap and their use in ↵Raphael Isemann2019-12-033-206/+9
| | | | | | | | | | | | | | | | | | | | | | ValueObjectSynthetic Summary: ThreadSafeSTLVector and ThreadSafeSTLMap are not useful for achieving any degree of thread safety in LLDB and should be removed before they are used in more places. They are only used (unsurprisingly incorrectly) in `ValueObjectSynthetic::GetChildAtIndex`, so this patch replaces their use there with a simple mutex with which we guard the related data structures. This doesn't make ValueObjectSynthetic::GetChildAtIndex any more thread-safe, but on the other hand it at least allows us to get rid of the ThreadSafeSTL* data structures without changing the observable behaviour of ValueObjectSynthetic (beside that it is now a few bytes smaller). Reviewers: labath, JDevlieghere, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70845
* [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescriptionRaphael Isemann2019-12-023-6/+13
| | | | | Removing raw_ostream here is getting us closer to removing LLDB's Stream class.
* [lldb][NFC] Make Stream's IndentLevel an unsigned integers.Raphael Isemann2019-12-021-6/+6
| | | | | We expect it to be always positive values and LLVM/Clang's IndentLevel values are already unsigned integers, so we should do the same.
* [lldb][NFC] Remove unused ClangASTContext::GetBasicType(ConstString)Raphael Isemann2019-11-291-2/+0
|
* [lldb][NFC] Remove ClangASTContext::GetBuiltinTypeForEncodingAndBitSize overloadRaphael Isemann2019-11-291-3/+0
|
* [lldb] Remove FileSpec->CompileUnit inheritancePavel Labath2019-11-291-4/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: CompileUnit is a complicated class. Having it be implicitly convertible to a FileSpec makes reasoning about it even harder. This patch replaces the inheritance by a simple member and an accessor function. This avoid the need for casting in places where one needed to force a CompileUnit to be treated as a FileSpec, and does not add much verbosity elsewhere. It also fixes a bug where we were wrongly comparing CompileUnit& and a CompileUnit*, which compiled due to a combination of this inheritance and the FileSpec*->FileSpec implicit constructor. Reviewers: teemperor, JDevlieghere, jdoerfert Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70827
* [lldb][NFC] Fix header guard comment in ThreadSafeDenseMap.hRaphael Isemann2019-11-291-1/+1
|
* [lldb] NFC: refactor CompileUnit::ResolveSymbolContextKonrad Kleine2019-11-281-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I found the above named method hard to read because it had a) many nested blocks, b) one return statement at the end with some logic involved, c) a duplicated while-loop with just small differences in it. I decided to refactor this function by employing an early exit strategy. In order to capture the logic in the return statement and to not have it repeated more than once I chose to implement a very small lamda function that captures all the variables it needs. I also replaced the two while-loops with just one. This is a non-functional change (NFC). Reviewers: jdoerfert, teemperor Reviewed By: teemperor Subscribers: labath, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70774
* [lldb][NFC] Remove CompilerDeclContext::IsClangRaphael Isemann2019-11-281-2/+0
| | | | | | | This method is only used in ClangASTContext. Also removes the includes we only needed for the ClangASTContext RTTI check in the CompilerDecl[Context].cpp files.
* [lldb][NFC] Simplify CompilerDecl and CompilerDeclContext initializationRaphael Isemann2019-11-282-10/+6
|
* [lldb][NFC] Remove unused CompilerDecl::IsClangRaphael Isemann2019-11-281-2/+0
|
* Revert "[lldb] NFC: refactor CompileUnit::ResolveSymbolContext"Raphael Isemann2019-11-281-4/+7
| | | | | | This reverts commit 373e2a4f69d623e59329ff801f261d8b299e12d2. This broke breakpoint setting.
* [lldb][NFC] Remove unused STLUtil include and STLUtil.h headerRaphael Isemann2019-11-282-27/+0
|
* [lldb] NFC: refactor CompileUnit::ResolveSymbolContextKonrad Kleine2019-11-281-7/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: I found the above named method hard to read because it had a) many nested blocks and b) one return statement at the end with some logic involved. I decided to refactor this function by employing an early exit strategy. In order to capture the logic in the return statement and to not have it repeated more than once I chose to implement a very small lamda function that captures all the variables it needs. This is a non-functional change (NFC). Reviewers: jdoerfert Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70774
* [lldb][NFC] Make GetAsCXXRecordDecl staticRaphael Isemann2019-11-281-1/+2
| | | | | All other casting functions there are static, so this should be too.
* [lldb][NFC] Move TypeSystem RTTI to static variable to remove swift referenceRaphael Isemann2019-11-272-43/+8
|
* [lldb][NFC] Remove unused CompilerType memory functionsRaphael Isemann2019-11-271-8/+0
| | | | | | | | | | | | | | | | Summary: All these functions are unused from what I can see. Unless I'm missing something here, this code can go the way of the Dodo. Reviewers: labath Reviewed By: labath Subscribers: abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70770
* [lldb] remove unsigned Stream::operator<< overloadsPavel Labath2019-11-261-39/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I recently re-discovered that the unsinged stream operators of the lldb_private::Stream class have a surprising behavior in that they print the number in hex. This is all the more confusing because the "signed" versions of those operators behave normally. Now that, thanks to Raphael, each Stream class has a llvm::raw_ostream wrapper, I think we should delete most of our formatting capabilities and just delegate to that. This patch tests the water by just deleting the operators with the most surprising behavior. Most of the code using these operators was printing user_id_t values. It wasn't fully consistent about prefixing them with "0x", but I've tried to consistenly print it without that prefix, to make it more obviously different from pointer values. Reviewers: teemperor, JDevlieghere, jdoerfert Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70241
* [lldb] Add boilerplate to recognize the .debug_rnglists.dwo sectionPavel Labath2019-11-261-0/+1
|
* [lldb][NFC] Allow range-based for-loops on VariableListRaphael Isemann2019-11-251-2/+8
| | | | | | | | | | | | | | | | Summary: Adds support for doing range-based for-loops on LLDB's VariableList and modernises all the index-based for-loops in LLDB where possible. Reviewers: labath, jdoerfert Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70668
* [lldb] Remove lldb's own ASTDumperRaphael Isemann2019-11-251-0/+10
| | | | | | | | | | | | | | | | | | | | | Summary: LLDB's ASTDumper is just a clone of Clang's ASTDumper but with some scary code and some unrelated functionality (like dumping name/attributes of types). This removes LLDB's ASTDumper and replaces its uses with the `ClangUtils::DumpDecl` method that just calls Clang's ASTDumper and returns the result as a string. The few uses where we just want a textual representation of a type (which will print their name/attributes but not dump any AST) are now also in ClangUtil under a `ToString` name until we find a better home for them. Reviewers: labath Reviewed By: labath Subscribers: mgorny, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70663
* [DWARF] Handle call sites with indirect call targetsVedant Kumar2019-11-222-31/+66
| | | | | | | | | | 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
* [Reproducer] Generate LLDB reproducer on crashJonas Devlieghere2019-11-201-0/+2
| | | | | | | | | | | | | | | | | | | | This patch hooks the reproducer infrastructure with the signal handlers. When lldb crashes with reproducers capture enabled, it will now generate the reproducer and print a short message the standard out. This doesn't affect the pretty stack traces, which are still printed before. This patch also introduces a new reproducer sub-command that intentionally raises a given signal to test the reproducer signal handling. Currently the signal handler is doing too much work. Instead of copying over files into the reproducers in the signal handler, we should re-invoke ourselves with a special command line flag that looks at the VFS mapping and performs the copy. This is a NO-OP when reproducers are disabled. Differential revision: https://reviews.llvm.org/D70474
* [lldb][NFC] Remove unused ClangASTContext::GetUnknownAnyTypeRaphael Isemann2019-11-201-6/+0
|
* [lldb][NFC] Simplify ClangASTContext::GetBasicTypesRaphael Isemann2019-11-201-5/+1
| | | | | 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-4/+1
| | | | Everything we pass to this function is already a DeclContext.
* [lldb][NFC] Remove ClangASTContext::FieldIsBitfield overloadRaphael Isemann2019-11-201-3/+0
|
* [lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overloadRaphael Isemann2019-11-201-5/+0
| | | | | | 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-191-3/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Replace bitfield in lldb::Type with byte-sized members. (NFC)Adrian Prantl2019-11-181-26/+12
| | | | | | 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-151-1/+1
| | | | | | | | 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-152-1/+10
| | | | Differential Revision: https://reviews.llvm.org/D70322
* [LLDB] Fix more -Wdocumentation issues (NFC)Jonas Devlieghere2019-11-146-24/+24
|
* Use ForEachExternalModule in ParseTypeFromClangModule (NFC)Adrian Prantl2019-11-142-6/+44
| | | | | | | | | | | 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][NFC] Simplify IOHandler constructor/destructor setupRaphael Isemann2019-11-141-4/+2
| | | | | We only need a default constructor because of DISALLOW_COPY_AND_ASSIGN, but the non-virtual destructor isn't needed.
* Revert "Forward declare Optional<T> in STLExtras.h"Reid Kleckner2019-11-131-1/+0
| | | | | | This reverts commit a36f316390d4bc1bcb0e9de0f55831385ab24099. I did not intend to push this with the InitializePasses.h change.
* Forward declare Optional<T> in STLExtras.hReid Kleckner2019-11-131-0/+1
| | | | WIP stats
* [LLDB] Cleanup the DataEncoder utility. (NFC)Jonas Devlieghere2019-11-131-129/+40
| | | | | This commit removes unused methods from the DataEncoder class and cleans up the API by making all the internal methods private.
* Revert a hunk from 9634064cfa1b9bf7b7Reid Kleckner2019-11-131-1/+1
| | | | | | | | | | | | This causes errors when building LLDB because the Windows implementation doesn't implement this method: C:\src\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(915,19): error: allocating an object of abstract class type 'lldb_private::ConnectionGenericFile' new ConnectionGenericFile(read_file, true)); ^ C:\src\llvm-project\lldb\include\lldb/Utility/Connection.h(174,28): note: unimplemented pure virtual method 'GetReadObject' in 'ConnectionGenericFile' virtual lldb::IOObjectSP GetReadObject() = 0; ^
* [LLDB] Fix another set of -Wdocumentation warningsJonas Devlieghere2019-11-132-5/+2
| | | | | At this point I'm just fixing issues as I see them pop up locally in incremental builds.
* [LLDB] Remove dead code from StreamFileJonas Devlieghere2019-11-131-6/+0
|
* [LLDB] Fix a bunch of -Wdocumentation warningsJonas Devlieghere2019-11-1345-384/+202
|
* [Reproducer] Discard reproducer directory if not generated.Jonas Devlieghere2019-11-121-1/+1
| | | | | If lldb was run in capture mode, but no reproducer was generated, make sure we clean up the reproducer directory.
* [LLDB] Add core definition for armv8l and armv7lMuhammad Omair Javaid2019-11-131-0/+2
| | | | | | | | | | | | | This patch adds core definitions in lldb ArchSpecs for armv8l and armv7l cores. This was needed because on Linux running on 32-bit Arm v8 we are returned armv8l in case we are running 32-bit sysroot on 64bit kernel. In case of 32-bit kernel and 32-bit sysroot running on arm v8 hardware we are returned armv7l. This is quite common when we run 32 bit arm using docker container. Signed-off-by: Muhammad Omair Javaid <omair.javaid@linaro.org> Differential Revision: https://reviews.llvm.org/D69904
* [LLDB][Formatters] Re-enable std::function formatter with fixes to improve ↵shafik2019-11-121-0/+12
| | | | | | | | | 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-122-3/+12
| | | | | | | | | | | | | | 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 more -Wdeprecated-copy warningsPavel Labath2019-11-123-14/+0
| | | | | | | This warning triggers when a class defines a copy constructor but not a copy-assignment operator (which then gets auto-generated by the compiler). Fix the warning by deleting the other operator too, as the default implementation works just fine.
* [lldb][NFC] Move LLVM RTTI implementation from enum to static ID variableRaphael Isemann2019-11-125-42/+32
| | | | | | | | | | | | | | | | Summary: swift-lldb currently has to patch the ExpressionKind enum to add support for Swift expressions. If we implement LLVM's RTTI with a static ID variable instead of a centralised enum we can drop that patch. Reviewers: labath, davide Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #upstreaming_lldb_s_downstream_patches, #lldb Differential Revision: https://reviews.llvm.org/D70070
* [lldb][NFC] Remove unused CompilerType::IsPossibleCPlusPlusDynamicTypeRaphael Isemann2019-11-121-5/+0
| | | | | | | | | | | | Reviewers: davide, xiaobai Reviewed By: davide, xiaobai Subscribers: davide, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70074
* lldb: Fix some -Wdeprecated-copy warningsPavel Labath2019-11-119-59/+0
| | | | | | | | gcc-9 started warning when a class defined a copy constructor without a copy assignment operator (or vice-versa). This fixes those warnings by deleting the other special member too (after verifying it doesn't do anything non-trivial).
OpenPOWER on IntegriCloud