summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][NFC] Remove ThreadSafeSTLVector and ThreadSafeSTLMap and their use in ↵Raphael Isemann2019-12-031-11/+38
| | | | | | | | | | | | | | | | | | | | | | 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] Set the right address size on output DataExtractors from ObjectFileMartin Storsjö2019-12-021-1/+7
| | | | | | | | | | | | | | | | | | | | | If filling in a DataExtractor from an ObjectFile, e.g. via the ReadSectionData method, the output DataExtractor gets the address size from the m_data member. ObjectFile's m_data member is initialized without knowledge about the address size (so the address size is set based on the host's sizeof(void*), and at that point within ObjectFile's constructor, virtual methods implemented in subclasses (like GetAddressByteSize()) can't be called, therefore fix it up when filling in external DataExtractors. This makes sure that line tables from executables with a different address size are parsed properly; previously this tripped up DWARFDebugLine::LineTable::parse for 32 bit executables on a 64 bit host, as the address size in the line table (4) didn't match the one set in the DWARFDataExtractor. Differential Revision: https://reviews.llvm.org/D70848
* [lldb][NFC] Don't calculate member indices in ↵Raphael Isemann2019-12-021-2/+0
| | | | | | DWARFASTParserClang::ParseChildMembers We keep counting members and then don't do anything with the computed result.
* [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescriptionRaphael Isemann2019-12-025-43/+43
| | | | | 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-022-5/+7
| | | | | 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] [ARM] Use r11 as frame pointer on Windows on ARMMartin Storsjö2019-11-291-2/+6
| | | | | | | Extend EmulateMOVRdRm to identify "mov r11, sp" in thumb mode as setting the frame pointer, if r11 is the frame pointer register. Differential Revision: https://reviews.llvm.org/D70797
* [lldb][NFC] Remove unused ClangASTContext::GetBasicType(ConstString)Raphael Isemann2019-11-291-5/+0
|
* [lldb][NFC] Remove ClangASTContext::GetBuiltinTypeForEncodingAndBitSize overloadRaphael Isemann2019-11-292-37/+22
|
* [lldb][NFC] Explicitly ask for a ClangASTContext in ClangASTSourceRaphael Isemann2019-11-295-31/+25
| | | | | | | | | | | ClangASTSource currently takes a clang::ASTContext and keeps that around, but a lot of LLDB's functionality for doing operations on a clang::ASTContext is in its ClangASTContext twin class. We currently constantly recompute the respective ClangASTContext from the clang::ASTContext while we instead could just pass and store a ClangASTContext in the ClangASTSource. This also allows us to get rid of a bunch of unreachable error checking for cases where recomputation fails for some reason.
* [lldb][NFC] Early exit in ClangASTContext::CreateInstanceRaphael Isemann2019-11-291-41/+41
|
* [lldb][NFC] Simplify regex_chars in CommandCompletionsRaphael Isemann2019-11-291-4/+1
|
* [lldb][NFC] Remove dead logging code from ↵Raphael Isemann2019-11-291-70/+1
| | | | | | | | | DWARFASTParserClang::CompleteRecordType This code is behind a `if (log)` that is always a nullptr as the initializer was commented out. One could uncomment the initializer code, but then this logging code just leads to a deadlock as it tries to aquire the module lock. This removes the logging code until I get this working again.
* [lldb] Remove FileSpec->CompileUnit inheritancePavel Labath2019-11-2920-70/+72
| | | | | | | | | | | | | | | | | | | | | | | 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: refactor CompileUnit::ResolveSymbolContextKonrad Kleine2019-11-283-84/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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] On Windows, force error message formatting to EnglishAlexandre Ganea2019-11-281-1/+10
| | | | | | This fixes the Utility/StatusTest.ErrorWin32 unit test on non-English locales. Differential Revision: https://reviews.llvm.org/D70442
* [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScopeAlexandre Ganea2019-11-281-1/+1
| | | | Differential Revision: https://reviews.llvm.org/D70448
* [lldb][NFC] Remove CompilerDeclContext::IsClangRaphael Isemann2019-11-283-11/+9
| | | | | | | 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] Remove unused variable in ClangASTSource::CompleteTypeRaphael Isemann2019-11-281-1/+0
| | | | | Now that CompilerDeclContext is a trivial class, Clang started warning that this unused variable is in fact unused. Let's remove it.
* [lldb][NFC] Remove unused CompilerDecl::IsClangRaphael Isemann2019-11-281-4/+0
|
* [lldb] refactor FileSpec::EqualPavel Labath2019-11-281-13/+3
| | | | | The logic of this function was quite hard to follow. Replace it with a much simpler, equivalent, implementation.
* Revert "[lldb] NFC: refactor CompileUnit::ResolveSymbolContext"Raphael Isemann2019-11-283-67/+83
| | | | | | This reverts commit 373e2a4f69d623e59329ff801f261d8b299e12d2. This broke breakpoint setting.
* [lldb][NFC] Use llvm::StringRef instead of C-strings as multimap keyRaphael Isemann2019-11-281-10/+5
|
* [lldb] NFC: refactor CompileUnit::ResolveSymbolContextKonrad Kleine2019-11-283-83/+67
| | | | | | | | | | | | | | | | | | | | | | | 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] Remove unused CStringToDIEMap typedefRaphael Isemann2019-11-281-6/+0
|
* [lldb][NFC] Remove forward declaration of PrivateAutoCompleteMembersRaphael Isemann2019-11-281-7/+0
| | | | That's declared directly above the actual definition, so it serves no use.
* [lldb][NFC] Split up DWARFASTParserClang::CompleteTypeFromDWARFRaphael Isemann2019-11-282-222/+243
| | | | | Moving the different parts into their own functions without any additional cleanup/refactoring, so this is NFC.
* [LLDB] Always interpret arm instructions as thumb on windowsMartin Storsjö2019-11-281-0/+3
| | | | | | | | Windows on ARM always uses thumb mode, and doesn't have most of the mechanisms that are used in e.g. ELF for distinguishing between arm and thumb. Differential Revision: https://reviews.llvm.org/D70796
* [LLDB] [PECOFF] Look for the truncated ".eh_fram" section nameMartin Storsjö2019-11-281-1/+2
| | | | | | | | | | | | | | COFF section names can either be stored truncated to 8 chars, in the section header, or as a longer section name, stored separately in the string table. libunwind locates the .eh_frame section by runtime introspection, which only works for section names stored in the section header (as the string table isn't mapped at runtime). To support this behaviour, lld always truncates the section names for sections that will be mapped, like .eh_frame. Differential Revision: https://reviews.llvm.org/D70745
* [LLDB] [PECOFF] Factorize mapping section names to types using StringSwitch. ↵Martin Storsjö2019-11-282-98/+75
| | | | | | | | | NFCI. Keep the existing special cases based on combinations of section name, flags and sizes/offsets. Differential Revision: https://reviews.llvm.org/D70778
* [lldb] Remove debugging code used for LLDB_DWARF_DONT_COMPLETE_TYPENAMESRaphael Isemann2019-11-281-33/+0
| | | | | | | | | | | | Reviewers: labath, clayborg, shafik Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70802
* [lldb][NFC] Move TypeSystem RTTI to static variable to remove swift referenceRaphael Isemann2019-11-274-10/+9
|
* [lldb][NFC] Remove unused CompilerType memory functionsRaphael Isemann2019-11-271-167/+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] Avoid using InitializeContext for zero-initializing a CONTEXT. NFC.Martin Storsjö2019-11-271-9/+2
| | | | | | | | | | | | | | | | | | InitializeContext is useful for allocating a (potentially variable size) CONTEXT struct in an unaligned byte buffer. In this case, we already have a fixed size CONTEXT we want to initialize, and we only used this as a very roundabout way of zero initializing it. Instead just memset the CONTEXT we have, and set the ContextFlags field manually. This matches how it is done in NativeRegisterContextWindows_*.cpp. This also makes LLDB run successfully in Wine (for a trivial tested case at least), as Wine hasn't implemented the InitializeContext function. Differential Revision: https://reviews.llvm.org/D70742
* [lldb][NFC] Early exit in DWARFASTParserClang::ParseArrayTypeRaphael Isemann2019-11-271-74/+74
|
* [lldb] Avoid snprintf in PlatformRemoteDarwinDevicePavel Labath2019-11-261-19/+14
| | | | This quashes a -Wformat-truncation warning.
* [lldb][NFC] Modernize string handling in DWARFASTParserClang::ParseTypeModifierRaphael Isemann2019-11-261-22/+16
|
* [lldb] Use llvm::format in AppleObjCRuntimeV2.cppPavel Labath2019-11-261-8/+2
| | | | Crushing a "sprintf" buffer is null warning.
* [lldb] remove a superfluous semicolonPavel Labath2019-11-261-1/+1
|
* [lldb] remove unsigned Stream::operator<< overloadsPavel Labath2019-11-265-36/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/symbolvendorelf] Copy more sections from separate debug filesPavel Labath2019-11-261-8/+11
| | | | Include the fancier DWARF5 sections too.
* [lldb][NFC] Remove no longer unused variable in ↵Raphael Isemann2019-11-261-1/+0
| | | | DWARFASTParserClang::ParseTypeFromDWARF
* [lldb][NFC] Simplify structure parsing code in ↵Raphael Isemann2019-11-261-4/+2
| | | | | | | | DWARFASTParserClang::ParseTypeFromDWARF This way it looks more like the code around it. The assert is also gone as it just checks that the variables we declare directly above were not initialized by anyone. That made more sense when this was one large function.
* [lldb] Add boilerplate to recognize the .debug_rnglists.dwo sectionPavel Labath2019-11-265-1/+7
|
* [lldb][NFC] Extract type modifier parsing from ↵Raphael Isemann2019-11-262-208/+226
| | | | | | DWARFASTParserClang::ParseTypeFromDWARF Part of the work to split up this monolithic parsing function.
* [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
* [lldb] [Process/NetBSD] Fix handling concurrent watchpoint eventsMichał Górny2019-11-254-24/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix handling concurrent watchpoint events so that they are reported correctly in LLDB. If multiple watchpoints are hit concurrently, the NetBSD kernel reports them as series of SIGTRAPs with a thread specified, and the debugger investigates DR6 in order to establish which watchpoint was hit. This is normally fine. However, LLDB disables and reenables the watchpoint on all threads after each hit, which results in the hit status from DR6 being wiped. As a result, it can't establish which watchpoint was hit in successive SIGTRAP processing. In order to workaround this problem, clear DR6 only if the breakpoint is overwritten with a new one. More specifically, move cleaning DR6 from ClearHardwareWatchpoint() to SetHardwareWatchpointWithIndex(), and do that only if the newly requested watchpoint is different from the one being set previously. This ensures that the disable-enable logic of LLDB does not clear watchpoint hit status for the remaining threads. This also involves refactoring of watchpoint logic. With the old logic, clearing watchpoint involved wiping dr6 & dr7, and setting it setting dr{0..3} & dr7. With the new logic, only enable bit is cleared from dr7, and the remaining bits are cleared/overwritten while setting new watchpoint. Differential Revision: https://reviews.llvm.org/D70025
OpenPOWER on IntegriCloud