summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/thread/TestThreadAPI.py
AgeCommit message (Collapse)Author
2025-10-30[lldb] Add alternative SBThread::GetStopDescription (#165379)Ebuka Ezike
the function signature for `GetStopDescription` is `lldb::SBThread::GetStopDescription(char *dst_or_null, size_t len)`. To get a description you need to call the function first time to get the buffer size. a second time to get the description. This is little worse from the python size as the signature is `lldb.SBThread.GetStopDescription(int: len) -> list[str]` the user has to pass the max size as possible with no way of checking if it is enough. This patch adds a new api `lldb.SBThread.GetStopDescription(desc: lldb.SBStream()) -> bool` `bool lldb::SBThread::GetStopDescription(lldb::SBStream &description)` which handles this case. Adds new Test case for lua.
2025-05-27[lldb][NFC] update API tests which skip/expect-fail armJason Molenda
The architectures provided to skipIf / expectedFail are regular expressions (v. _match_decorator_property() in decorators.py so on Darwin systems "arm64" would match the skips for "arm" (32-bit Linux). Update these to "arm$" to prevent this, and also update three tests (TestBuiltinFormats.py, TestCrossDSOTailCalls.py, TestCrossObjectTailCalls.py) that were skipped for arm64 via this behavior, and need to be skipped or they will fail. This was moviated by the new TestDynamicValue.py test which has an expected-fail for arm, but the test was passing on arm64 Darwin resulting in failure for the CIs.
2024-07-10[lldb][test] Fix instruction test step on WindowsDavid Spickett
On Windows the function name is the full prototype including the calling convention, all we care about is that the last part is correct. This also reverts the xfail added by 07b3e2c0c68b93a3d4d89426dc7fd14cc31ca6be.
2024-07-04[LLDB] XFail on Windows TestThreadAPI.py test_StepInstructionMuhammad Omair Javaid
TestThreadAPI.py test_StepInstruction started failing after #97493 Following assertion fails but I am not sure if test will pass after changing the test. AssertionError: 'void __cdecl call_me(bool)' != 'call_me(bool)' I have marked it as xfail I ll run it on a Windows machine to find an appropriate fix. https://lab.llvm.org/buildbot/#/builders/141/builds/476
2024-07-03SBThread::StepInstruction shouldn't discard other plans (#97493)jimingham
This was just a typo, none of the external execution control functions should discard other plans. In particular, it means if you stop in a hand-called function and step an instruction, the function call thread plan gets unshipped, popping all the function call frames. I also added a test that asserts the correct behavior. I tested all the stepping operations even though only StepInstruction was wrong.
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
2023-02-08[lldb] Accept negative indexes in __getitem__Dave Lee
To the Python bindings, add support for Python-like negative indexes. While was using `script`, I tried to access a thread's bottom frame with `thread.frame[-1]`, but that failed. This change updates the `__getitem__` implementations to support negative indexes as one would expect in Python. Differential Revision: https://reviews.llvm.org/D143282
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-08-03[lldb] Add assertStopReason helper functionJonas Devlieghere
Add a function to make it easier to debug a test failure caused by an unexpected stop reason. This is similar to the assertState helper that was added in ce825e46743b. Before: self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: 5 != 10 After: self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: signal (5) != instrumentation (10) Differential revision: https://reviews.llvm.org/D131083
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-09[lldb] Use assertState in more tests (NFC)Dave Lee
Follow to D127355, converting more `assertEquals` to `assertState`. Differential Revision: https://reviews.llvm.org/D127378
2021-02-08[lldb/tests] Removed add_test_categories decorator for python API tests, NFCTatyana Krasnukha
There is a .categories file in the python_api directory that makes all nested tests belong to the category "pyapi". The decorator is unnecessary for these tests.
2021-02-03[lldb] Convert more assertTrue to assertEqual (NFC)Dave Lee
Follow up to D95813, this converts multiline assertTrue to assertEqual. Differential Revision: https://reviews.llvm.org/D95899
2021-02-02[lldb] Convert assertTrue(a == b) to assertEqual(a, b)Dave Lee
Convert `assertTrue(a == b)` to `assertEqual(a, b)` to produce better failure messages. These were mostly done via regex search & replace, with some manual fixes. Differential Revision: https://reviews.llvm.org/D95813
2020-12-20[lldb] [test] Update test status for NetBSDMichał Górny
2020-11-03[lldb] [test] Remove xfail from tests that pass on FreeBSDMichał Górny
2020-05-25[lldb/Test] Add a trace method to replace print statements.Jonas Devlieghere
Many tests use (commented out) print statement for debugging the test itself. This patch adds a new trace method to lldbtest to reuse the existing tracing infrastructure and replace these print statements. Differential revision: https://reviews.llvm.org/D80448
2020-05-21Move decorator to the correct function.Adrian Prantl
2020-05-21Disable malloc stepping test under ASAN. The output is different and I'm not ↵Adrian Prantl
sure how stable it is.
2020-05-13[LLDB] Mark some xfails for arm-linuxMuhammad Omair Javaid
This patch marks following tests as xfail for arm-linux target. lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py lldb/test/API/python_api/thread/TestThreadAPI.py lldb/test/Shell/Recognizer/assert.test Bugs have been filed for all of them for the corresponding failing component.
2020-04-07[lldb] NFC: Fix trivial typo in comments, documents, and messagesKazuaki Ishizaki
Differential Revision: https://reviews.llvm.org/D77460
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