diff options
| author | Ebuka Ezike <yerimyah1@gmail.com> | 2025-10-30 21:43:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-30 21:43:53 +0000 |
| commit | c46bfed1a484d30cd251a9a225649d74e3bf0af5 (patch) | |
| tree | 6b1beefe494e0e518a2eaee28e9f87526c565b19 /lldb/test/API/python_api/thread/TestThreadAPI.py | |
| parent | 6c1678abce2c31b0db22634aa19368095a75ca77 (diff) | |
[lldb] Add alternative SBThread::GetStopDescription (#165379)
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.
Diffstat (limited to 'lldb/test/API/python_api/thread/TestThreadAPI.py')
| -rw-r--r-- | lldb/test/API/python_api/thread/TestThreadAPI.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/thread/TestThreadAPI.py b/lldb/test/API/python_api/thread/TestThreadAPI.py index 5583434a742a..acad7583eec1 100644 --- a/lldb/test/API/python_api/thread/TestThreadAPI.py +++ b/lldb/test/API/python_api/thread/TestThreadAPI.py @@ -138,6 +138,11 @@ class ThreadAPITestCase(TestBase): "breakpoint 1.1", thread.GetStopDescription(len("breakpoint 1.1") + 100) ) + # Test the stream variation + stream = lldb.SBStream() + self.assertTrue(thread.GetStopDescription(stream)) + self.assertEqual("breakpoint 1.1", stream.GetData()) + def step_out_of_malloc_into_function_b(self, exe_name): """Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b().""" exe = self.getBuildArtifact(exe_name) |
