summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb] s/assertTrue/assertEqual in TestStepTarget.pyPavel Labath2019-12-041-9/+7
| | | | this improves error messages.
* Revert "[LiveDebugValues] Introduce entry values of unmodified params"Djordje Todorovic2019-12-032-59/+15
| | | | This reverts commit rG4cfceb910692 due to LLDB test failing.
* [lldb] Remove all remaining tabs from TestReturnValue.pyRaphael Isemann2019-12-031-5/+5
| | | | | | I assumed this was just a single typo, but it seems we actually have a whole bunch of tabs in this file which cause Python to complain about mixing tabs and spaces.
* [lldb][NFC] Test going up/down one line in the multiline expression editorRaphael Isemann2019-12-031-0/+67
|
* Fixup 6d18e53: xfail TestShowLocationDwarf5.py properlyDiana Picus2019-12-031-1/+1
| | | | Forgot to squash this...
* [lldb] Remove tab from TestReturnValue.pyRaphael Isemann2019-12-031-1/+1
| | | | | | | | | Mixing tabs and spaces makes Python exit with this error: File "llvm/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py", line 23 return (self.getArchitecture() == "aarch64" and self.getPlatform() == "linux") ^ TabError: inconsistent use of tabs and spaces in indentation
* [lldb] Move register info "augmentation" from gdb-remote into ABIPavel Labath2019-12-032-96/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously the ABI plugin exposed some "register infos" and the gdb-remote code used those to fill in the missing bits. Now, the "filling in" code is in the ABI plugin itself, and the gdb-remote code just invokes that. The motivation for this is two-fold: a) the "augmentation" logic is useful outside of process gdb-remote. For instance, it would allow us to avoid repeating the register number definitions in minidump code. b) It gives more implementation freedom to the ABI classes. Now that these "register infos" are essentially implementation details, classes can use other methods to obtain dwarf/eh_frame register numbers -- for instance they can consult llvm MC layer. Since the augmentation code was not currently tested anywhere, I took the opportunity to create a simple test for it. Reviewers: jasonmolenda, clayborg, tatyana-krasnukha Subscribers: aprantl, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70906
* [LiveDebugValues] Introduce entry values of unmodified paramsDjordje Todorovic2019-12-032-15/+59
| | | | | | | | | | | | | | | | | | | | | The idea is to remove front-end analysis for the parameter's value modification and leave it to the value tracking system. Front-end in some cases marks a parameter as modified even the line of code that modifies the parameter gets optimized, that implies that this will cover more entry values even. In addition, extending the support for modified parameters will be easier with this approach. Since the goal is to recognize if a parameter’s value has changed, the idea at very high level is: If we encounter a DBG_VALUE other than the entry value one describing the same variable (parameter), we can assume that the variable’s value has changed and we should not track its entry value any more. That would be ideal scenario, but due to various LLVM optimizations, a variable’s value could be just moved around from one register to another (and there will be additional DBG_VALUEs describing the same variable), so we have to recognize such situation (otherwise, we will lose a lot of entry values) and salvage the debug entry value. Differential Revision: https://reviews.llvm.org/D68209
* Mark some tests as xfail on AArch64 LinuxDiana Picus2019-12-0310-5/+36
| | | | | | | | | I have either opened new bug reports for these tests, or added links to existing bugs. This should help make the lldb-aarch64-ubuntu buildbot green (there will still be some unexpected passes that someone should look into, but those can be handled later).
* [lldb] Fix TestFormattersSBAPI testAntónio Afonso2019-12-021-7/+10
| | | | | | | | | | | | | | | | | Summary: This test was broken in two ways: * Using the wrong API (e.g.: format = instead of SetFormat) * The hex checker was only checking "01" which will pass with 0x0000001 Reviewers: clayborg, lanza, wallace Reviewed By: clayborg Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70884
* [lldb][NFC] Add 'breakpoint command list' testRaphael Isemann2019-12-022-0/+62
| | | | | | The command has zero test coverage and I'll have to touch the code formatting the output commands, so let's start by adding a test for it.
* Revert "Revert "As a follow-up to my initial mail to llvm-dev here's a first ↵Eric Christopher2019-11-2610-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass at the O1 described there."" This reapplies: 8ff85ed905a7306977d07a5cd67ab4d5a56fafb4 Original commit message: As a follow-up to my initial mail to llvm-dev here's a first pass at the O1 described there. This change doesn't include any change to move from selection dag to fast isel and that will come with other numbers that should help inform that decision. There also haven't been any real debuggability studies with this pipeline yet, this is just the initial start done so that people could see it and we could start tweaking after. Test updates: Outside of the newpm tests most of the updates are coming from either optimization passes not run anymore (and without a compelling argument at the moment) that were largely used for canonicalization in clang. Original post: http://lists.llvm.org/pipermail/llvm-dev/2019-April/131494.html Tags: #llvm Differential Revision: https://reviews.llvm.org/D65410 This reverts commit c9ddb02659e3ece7a0d9d6b4dac7ceea4ae46e6d.
* [lldb] [test] Un-XFAIL lldb-server tests fixed on NetBSDMichał Górny2019-11-261-2/+0
|
* [lldb] [Process/NetBSD] Fix handling concurrent watchpoint eventsMichał Górny2019-11-256-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2510-11/+0
| | | | | | | | | | | | | 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-2522-24/+149
| | | | | | | | | | | | | | | | | | | | | | | | | 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-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
* Remove extraneous log enabling.Jason Molenda2019-11-221-1/+0
|
* [DWARF] Handle call sites with indirect call targetsVedant Kumar2019-11-221-0/+31
| | | | | | | | | | 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-224-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-226-0/+95
| | | | | | | | | | | | | | | | | | | | | 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] Fix exception breakpoint not being resolved when set on dummy targetMartin Svensson2019-11-221-0/+35
| | | | | | | | | | | | | | 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!
* [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.
* [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.
* Handle the case where the 'g' packet doesn't get all regs.Jason Molenda2019-11-202-1/+199
| | | | | | | | | | 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] [test] Un-XFAIL one lldb-server test on NetBSDMichał Górny2019-11-201-1/+0
|
* Reland "[clang] Remove the DIFlagArgumentNotModified debug info flag"Djordje Todorovic2019-11-201-1/+2
| | | | | | | | | | It turns out that the ExprMutationAnalyzer can be very slow when AST gets huge in some cases. The idea is to move this analysis to the LLVM back-end level (more precisely, in the LiveDebugValues pass). The new approach will remove the performance regression, simplify the implementation and give us front-end independent implementation. Differential Revision: https://reviews.llvm.org/D68206
* [lldb][test] Prevent \n in calls to lldb's expect() test helper.Jordan Rupprecht2019-11-192-17/+15
| | | | | | | | | | | | | | | | | Summary: expect() forwards its command to sendline(). This can be problematic if the command already contains a newline: sendline() unconditionally adds a newline to the command, which causes the command to run twice (hitting enter in lldb runs the previous command). The expect() helper looks for the prompt and finds the first one, but because the command has run a second time, the buffer will contain the contents of the second time the command ran, causing potential erroneous matching. Simplify the editline test, which was using different commands to workaround this misunderstanding. Reviewers: labath Reviewed By: labath Subscribers: merge_guards_bot, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70324
* [lldb] Also test Get[De]mangledName of SBType in TestSBTypeClassMembers.pyRaphael Isemann2019-11-191-0/+14
| | | | | | I just used the mangled names as this test is anyway a Darwin-only ObjC++ test. We probably should also test this on other platforms but that will be another commit as we need to untangle the ObjC and C++ parts first.
* Mark PR44037 tests as XFAIL on AArch64 Linux dwoDiana Picus2019-11-194-1/+24
| | | | | | | | | | | | These tests are failing with various assertion failures, but they all throw the following error message first: error: a.out 0x0000002d: adding range [0x14-0x24) which has a base that is less than the function's low PC 0x40060c. See llvm.org/pr44037. Differential Revision: https://reviews.llvm.org/D70381
* [lldb] [test] XFAIL more lldb-server tests on NetBSDMichał Górny2019-11-181-0/+11
|
* [lldb] [test] Mark segv-related tests XFAIL on NetBSDMichał Górny2019-11-183-0/+3
| | | | | There seems to be a regression in the kernel causing those tests to fail. Mark them XFAIL, to be addressed later.
* [lldb] [Process/NetBSD] Implement thread name gettingMichał Górny2019-11-182-2/+1
| | | | | | | 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
* [lldb] [test] Enable lldb-server tests on NetBSD, and set XFAILsMichał Górny2019-11-1811-2/+28
| | | | Differential Revision: https://reviews.llvm.org/D70335
* Remove +x permission on some filesSylvestre Ledru2019-11-161-0/+0
|
* [lldb-vscode] support the completion requestWalter Erquinigo2019-11-156-2/+154
| | | | | | | | | | | | | | | | Summary: The DAP has a completion request that has been unimplemented. It allows showing autocompletion tokens inside the Debug Console. I implemented it in a very simple fashion mimicking what the user would see when autocompleting an expression inside the CLI. There are two cases: normal variables and commands. The latter occurs when a text is prepepended with ` in the Debug Console. These two cases work well and have tests. Reviewers: clayborg, aadsm Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69873
* Add a testcase for Clang modules being updated within one LLDB session.Adrian Prantl2019-11-156-0/+87
| | | | This actually works as expected, but wasn't explicitly tested before.
* dotest: Add a way for the run_to_* helpers to register dylibsFred Riss2019-11-152-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To run the testsuite remotely the executable needs to be uploaded to the target system. The Target takes care of this by default. When the test uses additional shared libraries, those won't be handled by default and need to be registered with the target using test.registerSharedLibrariesWithTarget(target, dylib). Calling this API requires a target, so it doesn't mesh well with the run_to_* helpers that we've been advertising as the right way to write tests. This patch adds an extra_images argument to all the helpers and does the registration automatically when running a remote testsuite. TestWeakSymbols.py was converted to use this new scheme. Reviewers: jingham Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70134
* [-gmodules] Let LLDB log a warning if the Clang module hash mismatches.Adrian Prantl2019-11-155-1/+83
| | | | | | | | 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
* Fix TestFormatters.py stepping too farDiana Picus2019-11-152-6/+5
| | | | | | | | | | | | | TestFormatters.py has a sequence of three 'next' commands to get past all the initializations in the test function. On AArch64 (and potentially other platforms), this was one 'next' too many and we ended up outside our frame. This patch replaces the sequence with a 'thread until ' the line of the return from the function, so we should stop after all the initializations but before actually returning. Differential Revision: https://reviews.llvm.org/D70303
* [lldb][Editline] Support ctrl+left/right arrow word navigation.Jordan Rupprecht2019-11-141-0/+49
| | | | | | | | | | | | | | | | | Summary: This adds several 5C/5D escape codes that allow moving forward/backward words similar to bash command line navigation. On my terminal, `ctrl+v ctrl+<left arrow>` prints `^[[1;5D`. However, it seems inputrc also maps other escape variants of this to forward/backward word, so I've included those too. Similar for 5C = ctrl+right arrow. Reviewers: JDevlieghere, labath Reviewed By: JDevlieghere, labath Subscribers: merge_guards_bot, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70137
* [LLDB] Fix whitespace/tabs mismatch in lldbsuite Makefile.rulesMuhammad Omair Javaid2019-11-141-34/+34
| | | | | | | | | | | | This patch fixes whitespace/tabs mismatch in lldb/packages/Python/lldbsuite/test/make/Makefile.rules Legacy make files always used tabs though modern make version can work with white-spaces I have chosen the legacy just to be safe. Signed-off-by: Muhammad Omair Javaid <omair.javaid@linaro.org> Differential Revision: https://reviews.llvm.org/D70154
* [LLDB] Add core definition for armv8l and armv7lMuhammad Omair Javaid2019-11-132-2/+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-123-15/+19
| | | | | | | | | 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
* [lldb][test] Macros in expressions require DWARF 5Tatyana Krasnukha2019-11-122-1/+4
|
* [lldb] Re-enable VSCode testsJonas Devlieghere2019-11-118-24/+3
| | | | | | | The VSCode tests were all disabled on macOS because the implementation had some issues that resulted in flakiness on Darwin. It seems most of these issues have been addressed. I've re-enabled all the tests that consistently passed locally.
* Replace tabs with spaces. (NFC)Adrian Prantl2019-11-111-11/+11
|
OpenPOWER on IntegriCloud