summaryrefslogtreecommitdiff
path: root/lldb/test/API/api/multithreaded/TestMultithreaded.py
AgeCommit message (Collapse)Author
2024-12-12Convert the StackFrameList mutex to a shared mutex. (#117252)jimingham
In fact, there's only one public API in StackFrameList that changes the list explicitly. The rest only change the list if you happen to ask for more frames than lldb has currently fetched and that always adds frames "behind the user's back". So we were much more prone to deadlocking than we needed to be. This patch uses a shared_mutex instead, and when we have to add more frames (in GetFramesUpTo) we switches to exclusive long enough to add the frames, then goes back to shared. Most of the work here was actually getting the stack frame list locking to not require a recursive mutex (shared mutexes aren't recursive). I also added a test that has 5 threads progressively asking for more frames simultaneously to make sure we get back valid frames and don't deadlock.
2024-02-16[lldb] Don't overwrite the dynamic loader library path for "driver tests"Jonas Devlieghere
We have a handful of tests that build a driver which links against LLDB. When running those binaries, we overwrite the dynamic loader library path to point to the build directory's libs dir, presumably to make sure we load LLDB from there. This above becomes an issue when you have libc++ enabled and the driver is linked against the system's libc++, but the dynamic loader flag forces it to pick up libc++ from the libs dir. We could try to make the logic for building the driver smarter and have it pick up the just-built libc++ like we do for our test binaries, but I don't think we need to overwrite the library path in the first place. The build logic to build these drivers already takes care to set the correct RPATH in the linker. This patch removes the logic and simplifies the tests.
2024-02-16[lldb] Fix and rename skipIfHostIncompatibleWithRemoteJonas Devlieghere
Fix and rename the broken and confusingly named decorator skipIfHostIncompatibleWithRemote. The decorator is meant to skip test which uses the inferior test build system (i.e. to build test inferiors) to build host binaries (e.g. lldb drivers). The decorator was broken on macOS, where the host and target platform report macosx, but the decorator overwrote it with Darwin, resulting in tests incorrectly being skipped. The decorator was also missing on a handful of tests that use the buildDriver helper, which this commit fixes as well.
2024-01-26[lldb] Remove obsolete signBinary helper (#79656)Jonas Devlieghere
On Darwin, the Makefile already (ad-hoc) signs everything it builds. There's also no need to use lldb_codesign for this.
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2022-11-17[test] Allow skipTestIfFn to apply to entire classes for skipIfNoSBHeadersJordan Rupprecht
Some test cases are already marked @skipIfNoSBHeaders, but they make use of SBAPI headers in test setup. The setup will fail if the headers are missing, so it is too late to wait until the test case to apply the skip annotation. In addition to allowing this to apply to entire classes, I also changed all the existing annotations from test cases to test classes where necessary/appropriate. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D138181
2022-09-12[lldb] Add SBBreakpointLocation::SetCallbackLaura Chaparro-Gutierrez
* Include SetCallback in SBBreakpointLocation, similar as in SBBreakpoint. * Add test_breakpoint_location_callback test as part of TestMultithreaded. Reviewed By: werat, JDevlieghere Differential Revision: https://reviews.llvm.org/D133689 Co-authored-by: Andy Yankovsky <weratt@gmail.com>
2022-08-15[LLDB] Remove __future__ imports from testsDavid Spickett
Not needed now that we require python 3. Reviewed By: kastiglione, JDevlieghere Differential Revision: https://reviews.llvm.org/D131761
2022-06-17[lldb][tests] Automatically call compute_mydir (NFC)Dave Lee
Eliminate boilerplate of having each test manually assign to `mydir` by calling `compute_mydir` in lldbtest.py. Differential Revision: https://reviews.llvm.org/D128077
2022-06-08[lldb] Update TestMultithreaded to report FAIL for a non-zero exit codeJonas Devlieghere
A non-zero exit code from the test binary results in a CalledProcessError. Without catching the exception, that would result in a error (unresolved test) instead of a failure. This patch fixes that.
2020-12-17[lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hitMichał Górny
Explicitly consider the libraries reported on the initial rendezvous breakpoint hit added. This is necessary on FreeBSD since the dynamic loader issues only a single 'consistent' state rendezvous breakpoint hit for all the libraries present in DT_NEEDED. It is also helpful on Linux where it ensures that ld-linux is considered loaded as well as the shared system libraries reported afterwards. Reenable memory maps on FreeBSD since this fixed the issue triggered by them. Differential Revision: https://reviews.llvm.org/D92187
2020-12-07Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action"Michał Górny
This reverts commit 09b08833f301ea375137931d26b7193101f82ceb. This code is wrong on Linux, and causes ld-linux and linux-vdso to be reported twice. I need to work on it more.
2020-12-07[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot actionMichał Górny
Explicitly consider the libraries reported on the initial eTakeSnapshot action added, through adding them to the added soentry list in DYLDRendezvous::SaveSOEntriesFromRemote(). This is necessary on FreeBSD since the dynamic loader issues only a single 'consistent' state rendezvous breakpoint hit for all the libraries present in DT_NEEDED (while Linux issues an added-consistent event pair). Reenable memory maps on FreeBSD since this fixed the issue triggered by them. Differential Revision: https://reviews.llvm.org/D92187
2020-12-07[lldb] [test] Link FreeBSD test failures to bugsMichał Górny
Differential Revision: https://reviews.llvm.org/D92740
2020-11-03[lldb] [test] Update XFAILs/skips for FreeBSDMichał Górny
Update expected failures and test skips based on common results for the old and new FreeBSD plugins.
2020-10-29Mark the execution of stop-hooks as non-interactive.Jim Ingham
The intention is not to allow stop-hook commands to query the user, so this is correct. It also works around a deadlock in switching to the Python Session to execute python based commands in the stop hook when the Debugger stdin is backed by a FILE *. Differential Revision: https://reviews.llvm.org/D90332
2020-02-11[lldb][test] Remove symlink for API tests.Jordan Rupprecht
Summary: Moves lldbsuite tests to lldb/test/API. This is a largely mechanical change, moved with the following steps: ``` rm lldb/test/API/testcases mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}} mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done ``` lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure. Reviewers: labath, JDevlieghere Tags: #lldb Differential Revision: https://reviews.llvm.org/D71151