summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
Commit message (Collapse)AuthorAgeFilesLines
...
* Run all threads when extending a next range over a call.Jim Ingham2019-12-167-87/+190
| | | | | | | | | If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
* [lldb] Use file-based synchronization in TestVSCode_attachPavel Labath2019-12-162-14/+26
| | | | The is the best method we have at the moment for attach-style tests.
* [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHONJonas Devlieghere2019-12-131-1/+1
| | | | | | | This matches the naming scheme used by LLVM and all the other optional dependencies in LLDB. Differential revision: https://reviews.llvm.org/D71482
* LanguageRuntime: Simplify NSException::GetSummary() outputMed Ismail Bennani2019-12-133-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Right now, NSException::GetSummary() has the following output: "name: $exception_name - reason: $exception_reason" It would be better to simplify the output by removing the name and only showing the exception's reason. This way, annotations would look nicer in the editor, and would be a shorter summary in the Variables Inspector. Accessing the exception's name can still be done by expanding the NSException object in the Variables Inspector. rdar://54770115 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com> Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71311 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* [lldb/Test] C++ test should use CXXFLAGS_EXTRASJonas Devlieghere2019-12-131-1/+1
| | | | Thanks Ted Woodward for noticing this.
* [lldb][NFC] Remove all `setUp` overrides that only call the parent ↵Raphael Isemann2019-12-1355-202/+0
| | | | | | | | | | | | | | | | | | | | | | | | | implementation Summary: A lot of our tests copied the setUp code from our TestSampleTest.py: ``` def setUp(self): # Call super's setUp(). TestBase.setUp(self) ``` This code does nothing unless we actually do any setUp work in there, so let's remove all these method definitions. Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71454
* [lldb][NFC] Remove 'from __future__ import print_function' from all tests ↵Raphael Isemann2019-12-13514-536/+0
| | | | | | | | | | | | | | | | | | | | | that don't actually call 'print()' Summary: A lot of tests do this trick but the vast majority of them don't even call `print()`. Most of this patch was generated by a script that just looks at all the files and deletes the line if there is no `print (` or `print(` anywhere else in the file. I checked the remaining tests manually and deleted the import if we never call print (but instead do stuff like `expr print(...)` and similar false-positives). I also corrected the additional empty lines after the import in the files that I manually edited. Reviewers: JDevlieghere, labath, jfb Reviewed By: labath Subscribers: dexonsmith, wuzish, nemanjai, kbarton, christof, arphaman, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71452
* [lldb][NFC] Add reminder to TestSampleTest that setUp should be deleted if ↵Raphael Isemann2019-12-131-0/+2
| | | | it not needed.
* [lldb] Remove xpasses after pr44037 fix committedMuhammad Omair Javaid2019-12-134-24/+1
| | | | | | | This patch removes xpass decorator from tests which were failing due to pr44037. pr44037 was fixed by rev 6ce1a897b6a82e18059fd3b75b8d52ff12c2a605
* [lldb][dotest] Add `#include <algorithm>` to libc++ detectionJordan Rupprecht2019-12-111-1/+1
| | | | | | | | | | | | Summary: Speculative fix after 34ef51b5f979 broke the lldb buildbot on libc++ tests. Reviewers: echristo, EricWF Subscribers: ldionne, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71376
* [lldb][dotest] Improve libc++ detectionJordan Rupprecht2019-12-111-3/+10
| | | | | | | | | | | | Summary: The test logic for running libc++ tests only looks to see if `/usr/include/c++/v1` exists. This adds a fallback for including libc++ tests as long as `$(CC) -stdlib=libc++` works. Reviewers: labath, EricWF Subscribers: ldionne, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71319
* return-object-by-reference ("non trivial") xfail on arm64 in TestTrivialABI.pyJason Molenda2019-12-112-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this test case can be handled correctly on AAPCS64. The ABI says that the caller passes the address of the return object in x8. x8 is a caller-spilled (aka "volatile") register, and the function is not required to preserve x8 or to copy the address back into x8 on function exit like the SysV x86_64 ABI does with rax. (from aapcs64: "there is no requirement for the callee to preserve the value stored in x8") From my quick reading of ABISysV_arm64, I worry that it may actually be using the value in x8 at function exit, assuming it still has the address of the return object - if (is_return_value) { // We are assuming we are decoding this immediately after returning from // a function call and that the address of the structure is in x8 reg_info = reg_ctx->GetRegisterInfoByName("x8", 0); This will work on trivial test programs / examples, but if the function does another function call, or overwrites x8 as a scratch register, lldb will provide incorrect values to the user. ABIMacOSX_arm64 doesn't do this, but it also doesn't flag the value as unavailable so we're providing incorrect values to the user all the time. I expect my fix will be to make ABIMacOSX_arm64 flag the return value as unretrievable, unless I've misread the ABI.
* update TestThreadStepOut.py to expect correct source line on arm64.Jason Molenda2019-12-112-3/+3
|
* Don't run expect based tests remotely.Jason Molenda2019-12-112-2/+2
|
* Change the mtc Makefile to check $SDKROOT value insteadJason Molenda2019-12-101-3/+8
| | | | | | | | | | of depending on it being set in the environment. Fred's change from October assumed that SDKROOT was set in the environment so that 'xcrun --show-sdk-path' would print the path. If it was passed in as a Makefile variable, it wouldn't be set in the environment and xcrun --show-sdk-path would always show the macOS SDK path. When running the lldb testsuite against an ios device via lit, this seems to be the case.
* Do not cache hardcoded formats in FormatManagerAdrian Prantl2019-12-104-0/+45
| | | | | | | | | | | | | | The cache in FormatCache uses only a type name as key. The hardcoded formats, synthetic children, etc inspect an entire ValueObject to determine their eligibility, which isn't modelled in the cache. This leads to bugs such as the one in this patch (where two similarly named types in different files have different hardcoded summary providers). The problem is exaggerated in the Swift language plugin due to the language's dynamic nature. rdar://problem/57756763 Differential Revision: https://reviews.llvm.org/D71233
* Skip TestGuiBasic.py on ios etc device testing.Jason Molenda2019-12-101-0/+1
|
* Skip TestMultilineCompletion.py on ios testsuite runs.Jason Molenda2019-12-101-0/+1
|
* Assert launch success in run_to_breakpoint_do_runVedant Kumar2019-12-101-0/+2
|
* [lldb] Actually enable wchar support in Editline when it is defined in the ↵Raphael Isemann2019-12-101-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | host config Summary: Our Editline implementation in LLDB supports using the wchar interface of Editline which should improve handling of unicode input when using Editline. At the moment we essentially just ignore unicode input and echo the escaped unicode code point (`\U1234`) to the command line (which we then also incorrectly treat as multiple characters, so console navigation is also broken afterwards). This patch just adds the include to the host config file which already contains the LLDB_EDITLINE_USE_WCHAR define to enable the Editline support (we just never included it in the file before). With this we now actually echo back unicode characters on macOS and we no longer ignore unicode input. On Linux this doesn't seem to improve the echoing back of characters but at least it fixes that we ignore unicode input. Reviewers: labath Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71251
* The field ‘totalFrames’ which is total number of frames available, is ↵Serhiy Redko2019-12-092-7/+27
| | | | | | | | | | | | mandatory in StackTraces response for VSCode extension that implements DAP and declares capability 'supportsDelayedStackTraceLoading': "The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the 'StackTrace' request are supported." Lack of this field makes VSCode incorrectly display stack traces information D71034
* [lldb] Clean up accidentally passing TestDeadStrip.pyPavel Labath2019-12-092-11/+5
| | | | | | | | | | | | | | | | | This test was accidentally passing on non-darwin OS because it was explicitly setting the CFLAGS make variable. This meant that (in the default config) it was building with absolutely no debug info, and so setting a breakpoint on a stripped symbol failed, because there was really no trace of it remaining. In other configurations, we were generating the debug info (-gsplit-dwarf implies -g) and the test failed because we did not treat the zeroed out debug info address specially. The test was also xfailed in pretty much every non-standard configuration. This patch fixes the makefile to avoid messing with CFLAGS (use CFLAGS_EXTRAS instead). This causes it to fail in all configurations (except darwin), and so I replace the various decorators with a simple os!=darwin check.
* [lldb] Remove Xfail decorators from steadily passing testsMuhammad Omair Javaid2019-12-0913-70/+5
| | | | | This patch removes xfail decorator from some lldb testcases which are passing steadily now for past few week/months on aarch64/linux buildbot.
* [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
|
OpenPOWER on IntegriCloud