summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb] Xfail TestCallOverriddenMethod.py for aarch64/linuxMuhammad Omair Javaid2019-12-091-0/+1
| | | | | | | This test still fails on Linux aarch64. Tested by buildbot running Ubuntu Bionic Differential Revision: https://reviews.llvm.org/D70722
* [lldb] Add a test for how we lazily create Clang AST nodesRaphael Isemann2019-12-093-0/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: One of the ways we try to make LLDB faster is by only creating the Clang declarations (and loading the associated types) when we actually need them for something. For example an evaluated expression might need to load types to type check and codegen the expression. Currently this mechanism isn't really tested, so we currently have no way to know how many Clang nodes we load and when we load them. In general there seems to be some confusion when and why certain Clang nodes are created. As we are about to make some changes to the code which is creating Clang AST nodes we probably should have a test that at least checks that the current behaviour doesn't change. It also serves as some kind of documentation on the current behaviour. The test in this patch is just evaluating some expressions and checks which Clang nodes are created due to this in the module AST. The check happens by looking at the AST dump of the current module and then scanning it for the declarations we are looking for. I'm aware that there are things missing in this test (inheritance, template parameters, non-expression evaluation commands) but I'll expand it in follow up patches. Also this test found two potential bugs in LLDB which are documented near the respective asserts in the test: 1. LLDB seems to always load all types of local variables even when we don't reference them in the expression. We had patches that tried to prevent this but it seems that didn't work as well as it should have (even though we don't complete these types). 2. We always seem to complete the first field of any record we run into. This has the funny side effect that LLDB is faster when all classes in a project have an arbitrary `char unused;` as their first member. We probably want to fix this. Reviewers: shafik Subscribers: abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71056
* [lldb][test] Handle .categories lookup for inline tests.Jordan Rupprecht2019-12-061-2/+9
| | | | | | | | | | | | | | | Summary: When creating a test with `lldbinline.MakeInlineTest()`, the reported `inspect.getfile(test.__class__)` is `lldbtest.pyc`, meaning any `.categories` file will be ineffective for those tests. Check for the test_filename first, which inline tests will set. Additionally, raise an error with the starting dir if `.categories` is not found. This makes the problem more obvious when it occurs: when the test is separated from the test framework tree. Reviewers: labath, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71099
* [lldb/IRExecutionUnit] Stop searching based on demangled namesPavel Labath2019-12-061-1/+0
| | | | | | | | | | | | | | | | | | | | | Summary: This was causing problems on linux, where we'd end up calling the deleting destructor instead of a regular one (because they have the same demangled name), making a lot of mischief in the process. The only place where this was necessary (according to the test suite, at least) was to call a base structor instead of a complete one, but this is now handled in a more targeted fashion. TestCallOverriddenMethod is now re-enabled as it now passes reliably. Reviewers: teemperor, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70722
* [lldb] Update hardcoded Makefile.rules inclusions.Jordan Rupprecht2019-12-054-9/+3
| | | | | | This replaces `include $(LEVEL)/Makefile.rules` with `include Makefile.rules`. The lldb test driver already passes the include path when running make, and specifically looking for "../../Makefile.rules" forces the test to be in a specific location. Removing this hardcoded relative path will make it possible to move this test as-is.
* Reland "[LiveDebugValues] Introduce entry values of unmodified params"Djordje Todorovic2019-12-053-16/+60
| | | | Relanding this after resolving the cause of the test failure.
* Clear out the python class name in OptionParsingStarted for the ↵Jim Ingham2019-12-041-2/+18
| | | | | | | | OptionGroupPythonClassWithDict options class. This value was hanging around so for instance if you made a scripted breakpoint resolver, then went to set another breakpoint, it would still think you had passed in a class name and the breakpoint wouldn't do what you expected.
* Change Target::FindBreakpointsByName to return Expected<vector>Joseph Tremoulet2019-12-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Using a BreakpointList corrupts the breakpoints' IDs because BreakpointList::Add sets the ID, so use a vector instead, and update the signature to return the vector wrapped in an llvm::Expected which can propagate any error from the inner call to StringIsBreakpointName. Note that, despite the similar name, SBTarget::FindBreakpointsByName doesn't suffer the same problem, because it uses a SBBreakpointList, which is more like a BreakpointIDList than a BreakpointList under the covers. Add a check to TestBreakpointNames that, without this fix, notices the ID getting mutated and fails. Reviewers: jingham, JDevlieghere Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70907
* [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
OpenPOWER on IntegriCloud