summaryrefslogtreecommitdiffstats
path: root/lldb
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
* [lldb] [Process/NetBSD] Fix handling concurrent watchpoint eventsMichał Górny2019-11-2510-30/+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
* [lldb] [Process/NetBSD] Copy watchpoints to newly-created threadsMichał Górny2019-11-2520-19/+114
| | | | | | | | | | | | | NetBSD ptrace interface does not populate watchpoints to newly-created threads. Solve this via copying the watchpoints from the current thread when new thread is reported via TRAP_LWP. Add a test that verifies that when the user does not have permissions to set watchpoints on NetBSD, the 'watchpoint set' errors out gracefully and thread monitoring does not crash on being unable to copy watchpoints to new threads. Differential Revision: https://reviews.llvm.org/D70023
* [lldb] [Process/NetBSD] Improve threading supportMichał Górny2019-11-2526-110/+405
| | | | | | | | | | | | | | | | | | | | | | | | | Implement major improvements to multithreaded program support. Notably, support tracking new and exited threads, associate signals and events with correct threads and support controlling individual threads when resuming. Firstly, use PT_SET_EVENT_MASK to enable reporting of created and exited threads via SIGTRAP. Handle TRAP_LWP events to keep track of the currently running threads. Secondly, update the signal (both generic and SIGTRAP) handling code to account for per-thread signals correctly. Signals delivered to the whole process are reported on all threads, while per-thread signals and events are reported only to the specific thread. The remaining threads are marked as 'stopped with no reason'. Note that NetBSD always stops all threads on debugger events. Thirdly, implement the ability to set every thread as running, stopped or single-stepping separately while continuing the process. This also provides the ability to send a signal to the whole process or to one of its thread while resuming. Differential Revision: https://reviews.llvm.org/D70022
* [lldb] [test] XFAIL ASAN tests on NetBSDMichał Górny2019-11-252-0/+2
|
* [lldb][NFC] Allow range-based for-loops on VariableListRaphael Isemann2019-11-2512-87/+66
| | | | | | | | | | | | | | | | 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-258-316/+125
| | | | | | | | | | | | | | | | | | | | | 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
* [lldb-vscode] Fix a race in test_extra_launch_commandsPavel Labath2019-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The test used a non-stopping "run" command to launch the process. This is different from the regular launch with no extra launch commands, which uses eLaunchFlagStopAtEntry to ensure that the process stops straight away. I'm not really sure what's supposed to happen in non-stop-at-entry mode, or if that's even supported, but what ended up happening was the launch packet got a reply while the process was running. Then the test case did a continue_to_next_stop(), which queued a *second* resume request (along with the internal "resumes" which were being issued as a part of normal process startup). These two resumes ended up chasing each other's tails inside lldb in a way which produced hilarious log traces. Surprisingly, the test ended up passing most of the time, but it did cause spurious failures when the test seemed to miss a breakpoint. This changes the test to use stop-at-entry mode in the manual launch sequence too, which seems to be enough to make the test pass reliably. Reviewers: clayborg, kusmour, jankratochvil Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70127
* [lldb][NFC] Do an early exit in LookupLocalVarNamespace and LookUpLldbObjCClassRaphael Isemann2019-11-232-48/+56
|
* [lldb][NFC] NFC refactoring for ↵Raphael Isemann2019-11-231-55/+30
| | | | | | ClangExpressionDeclMap::LookupInModulesDeclVendor Early exiting and deduplicating copy-pasted code.
* [lldb][NFC] NFC refactoring ClangExpressionDeclMap::LookupLocalVariableRaphael Isemann2019-11-231-36/+33
| | | | | Adding an early exits and moving variable declarations closer to their actual use.
* [lldb][NFC] Fix LLDB build after ModuleManager->ASTReader renameRaphael Isemann2019-11-232-2/+2
| | | | That happened in 20d51b2f14ac4488f684f8f but LLDB wasn't updated.
* [Examples] Move structured-data unpacking out of the loop. (NFC)Jonas Devlieghere2019-11-221-1/+1
| | | | There's no need to repeat this work in the loop.
* [Examples] Add in_call_stack breakpoint function.Jonas Devlieghere2019-11-221-0/+24
| | | | | | | | | | | | | | | | | | | | | The in_call_stack Python script makes it possible to modify the last breakpoint to only stop if a given function is present in the call stack. It will check both the symbol name and the function name (coming from the debug info, in case the binary is stripped). To use this, you have to: 1. Import the script into lldb. (lldb) command script import in_call_stack.py 2. Set a breakpoint and use the in_call_stack alias. (lldb) b foo (lldb) in_call_stack bar Note that this alias operates on the last set breakpoint. You can re-run the in_call_stack command to modify the condition.
* Remove extraneous log enabling.Jason Molenda2019-11-221-1/+0
|
* [DWARF] Handle call sites with indirect call targetsVedant Kumar2019-11-2210-99/+257
| | | | | | | | | | 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-225-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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
* Reformat code for readability.Adrian Prantl2019-11-221-2/+2
|
* Complete complete types early when importing types from Clang module DWARF.Adrian Prantl2019-11-227-1/+109
| | | | | | | | | | | | | | | | | | | | | 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
* Register Objective-C property accessors with their property decls.Adrian Prantl2019-11-225-32/+77
| | | | | | | | | | This is a correctness fix for the Clang DWARF parser that primarily matters for swift-lldb's ability to import Clang types that were reconstructed from DWARF into Swift. rdar://problem/55025799 Differential Revision: https://reviews.llvm.org/D70580
* [lldb] [test] XFAIL TestExpressionEvaluation on NetBSDMichał Górny2019-11-221-0/+1
|
* [lldb] Fix exception breakpoint not being resolved when set on dummy targetMartin Svensson2019-11-222-1/+38
| | | | | | | | | | | | | | Summary: Ensure that breakpoint ivar is properly set in exception breakpoint resolver so that exception breakpoints set on dummy targets are resolved once real targets are created and run. Reviewers: jingham Reviewed By: jingham Subscribers: teemperor, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69880
* [lldb] Don't enable expression log in TestEmptyStdModule.pyRaphael Isemann2019-11-221-1/+0
| | | | Thanks for pointing this out Jason!
* Early-exitify ClangASTContext::AddObjCClassProperty() (NFC)Adrian Prantl2019-11-211-178/+162
|
* [Driver] Fix newline at the end of help outputJonas Devlieghere2019-11-211-3/+2
| | | | | Print a regular newline at the end of the help output. The current string literal seems to throw off shells.
* [Reproducer] Make 'reproducer xcrash' behave the same during capture & replayJonas Devlieghere2019-11-211-2/+3
| | | | | There's no point in preventing this command from running during replay. We should simulate the same crash as during capture.
* [Reproducer] Instruct users to replay reproducerJonas Devlieghere2019-11-211-4/+12
| | | | | | | | | | | | | | | | | | | | Improve the message printed when LLDB crashes by asking the user to replay the reproducer before attaching it to a bugreport.. ******************** Crash reproducer for lldb version 10.0.0 (git@github.com:llvm/llvm-project.git revision ...) clang revision ... llvm revision ... Reproducer written to '/path/to/reproducer' Before attaching the reproducer to a bug report: - Look at the directory to ensure you're willing to share its content. - Make sure the reproducer works by replaying the reproducer. Replay the reproducer with the following command: ./bin/lldb -replay /path/to/reproducer ********************
* [test] Mark TestEditline as skipped with ASan.Jonas Devlieghere2019-11-211-0/+1
| | | | As discussed in https://reviews.llvm.org/D70324.
* [Test] Split up TestIntegerTypes.pyJonas Devlieghere2019-11-2110-217/+297
| | | | | The unsplit test is timing out on GreenDragon's sanitized bot. By splitting the test we avoid this issue and increase parallelism.
* [Docs] Generate the LLDB man page with SphinxJonas Devlieghere2019-11-215-156/+324
| | | | | | | | | | | This patch replaces the existing out-of-date man page for lldb and replaces it with an RST file from which sphinx generates the actual troff file. This is similar to how man pages are generated for the rest of the LLVM utilities. The man page is generated by building the `docs-lldb-man` target. Differential revision: https://reviews.llvm.org/D70514
* [NFC] Refactor and improve comments in CommandObjectTargetAdrian McCarthy2019-11-211-145/+141
| | | | | | | | | | | | | | Made small improvements while debugging through CommandObjectTarget::AddModuleSymbols. 1. Refactored error case for an early out, reducing the indentation of the rest of this long function. 2. Clarified some comments by correcting spelling and punctuation. 3. Reduced duplicate code at the end of the function. Tested with `ninja check-lldb` Differential Review: https://reviews.llvm.org/D70458
* [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] Remove test directory completelyTatyana Krasnukha2019-11-213-2/+0
| | | | | | The test was moved to "completion-in-lambda-and-unnamed-class" by D66175. + Fix typo in the directory name.
* [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
|
* [Reproducer] Limit signals to macro define sin <csignal>Jonas Devlieghere2019-11-202-10/+0
| | | | SIGBUS is not part of the signal macros defined in the header <csignal>.
* Handle the case where the 'g' packet doesn't get all regs.Jason Molenda2019-11-203-1/+214
| | | | | | | | | | 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>
* [Driver] Fix missing space in lldb --help output.Jonas Devlieghere2019-11-201-1/+1
|
* [Docs] Fix Sphinx warning (treated as error)Jonas Devlieghere2019-11-201-8/+8
| | | | | Fixes "undefined label" warning: if the link has no caption the label must precede a section header.
* [Reproducer] Generate LLDB reproducer on crashJonas Devlieghere2019-11-208-4/+194
| | | | | | | | | | | | | | | | | | | | 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] 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] [test] Un-XFAIL one lldb-server test on NetBSDMichał Górny2019-11-201-1/+0
|
OpenPOWER on IntegriCloud