diff options
| author | Dave Lee <davelee.com@gmail.com> | 2025-07-31 13:10:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-31 13:10:04 -0700 |
| commit | 68b9bb5e9bc3dcd5ff33fe250184debd3cc3dff5 (patch) | |
| tree | 6ff4675552e610e74e82f638356f1ab51118cc51 /lldb/test/API/functionalities | |
| parent | 2737d013a0194304b026826cfa46ba302dd4dadc (diff) | |
| download | llvm-68b9bb5e9bc3dcd5ff33fe250184debd3cc3dff5.tar.gz llvm-68b9bb5e9bc3dcd5ff33fe250184debd3cc3dff5.tar.bz2 llvm-68b9bb5e9bc3dcd5ff33fe250184debd3cc3dff5.zip | |
[lldb] Add stop_description Python property to SBThread (#151568)
Add `stop_description` as a Python convenience property to `SBThread`.
Diffstat (limited to 'lldb/test/API/functionalities')
7 files changed, 16 insertions, 18 deletions
diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py index 12b464d3397e..67c5d7d55846 100644 --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py @@ -594,7 +594,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase): process = self.connect(target) self.assertEqual(process.threads[0].GetStopReason(), lldb.eStopReasonSignal) - self.assertEqual(process.threads[0].GetStopDescription(100), "signal SIGBUS") + self.assertEqual(process.threads[0].stop_description, "signal SIGBUS") def test_signal_lldb_old(self): class MyResponder(MockGDBServerResponder): @@ -620,7 +620,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase): process = self.connect(target) self.assertEqual(process.threads[0].GetStopReason(), lldb.eStopReasonSignal) - self.assertEqual(process.threads[0].GetStopDescription(100), "signal SIGUSR1") + self.assertEqual(process.threads[0].stop_description, "signal SIGUSR1") def test_signal_lldb(self): class MyResponder(MockGDBServerResponder): @@ -643,7 +643,7 @@ class TestGDBRemoteClient(GDBRemoteTestBase): process = self.connect(target) self.assertEqual(process.threads[0].GetStopReason(), lldb.eStopReasonSignal) - self.assertEqual(process.threads[0].GetStopDescription(100), "signal SIGUSR1") + self.assertEqual(process.threads[0].stop_description, "signal SIGUSR1") def do_siginfo_test(self, platform, target_yaml, raw_data, expected): class MyResponder(MockGDBServerResponder): diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py index 0d06a9da6535..dc555dd28636 100644 --- a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py +++ b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py @@ -123,5 +123,5 @@ class TestOSPluginStepping(TestBase): os_thread = self.get_os_thread() self.assertTrue(os_thread.IsValid(), "The OS thread is back after continue") self.assertIn( - "step out", os_thread.GetStopDescription(100), "Completed step out plan" + "step out", os_thread.stop_description, "Completed step out plan" ) diff --git a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py index 8776d72ecbc0..4b7d24ef58e7 100644 --- a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py +++ b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py @@ -117,7 +117,7 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonSignal) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertIn("SIGSEGV", stop_description) @skipIfLLVMTargetMissing("X86") @@ -153,7 +153,7 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonNone) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertEqual(stop_description, "") def test_snapshot_minidump_null_exn_code(self): @@ -164,7 +164,7 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonNone) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertEqual(stop_description, "") def check_register_unsigned(self, set, name, expected): @@ -198,7 +198,7 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonNone) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertEqual(stop_description, "") registers = thread.GetFrameAtIndex(0).GetRegisters() # Verify the GPR registers are all correct @@ -261,7 +261,7 @@ class MiniDumpNewTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonNone) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertEqual(stop_description, "") registers = thread.GetFrameAtIndex(0).GetRegisters() # Verify the GPR registers are all correct @@ -522,7 +522,7 @@ class MiniDumpNewTestCase(TestBase): for i in range(2): thread = self.process.GetThreadAtIndex(i) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonSignal) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertIn("SIGSEGV", stop_description) def test_breakpoint_on_minidump(self): @@ -539,7 +539,7 @@ class MiniDumpNewTestCase(TestBase): process = target.LoadCore(core) self.assertTrue(process, VALID_PROCESS) thread = process.GetThreadAtIndex(0) - stop_reason = thread.GetStopDescription(256) + stop_reason = thread.stop_description self.assertIn("breakpoint 1.1", stop_reason) finally: if os.path.isfile(core): diff --git a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py index 8fe5d2a1d856..362b21905597 100644 --- a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py +++ b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py @@ -32,7 +32,7 @@ class MiniDumpTestCase(TestBase): self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonException) - stop_description = thread.GetStopDescription(256) + stop_description = thread.stop_description self.assertIn("0xc0000005", stop_description) def test_modules_in_mini_dump(self): diff --git a/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py b/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py index 736bb69397f9..ee5ae32144b5 100644 --- a/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py +++ b/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py @@ -204,9 +204,7 @@ class StackCoreScriptedThread(ScriptedThread): if self.is_stopped: if "arm64" in self.scripted_process.arch: stop_reason["type"] = lldb.eStopReasonException - stop_reason["data"][ - "desc" - ] = self.corefile_thread.GetStopDescription(100) + stop_reason["data"]["desc"] = self.corefile_thread.stop_description elif self.scripted_process.arch == "x86_64": stop_reason["type"] = lldb.eStopReasonSignal stop_reason["data"]["signal"] = signal.SIGTRAP diff --git a/lldb/test/API/functionalities/step_scripted/TestStepScripted.py b/lldb/test/API/functionalities/step_scripted/TestStepScripted.py index 52763694541e..343236a9e4e3 100644 --- a/lldb/test/API/functionalities/step_scripted/TestStepScripted.py +++ b/lldb/test/API/functionalities/step_scripted/TestStepScripted.py @@ -41,7 +41,7 @@ class StepScriptedTestCase(TestBase): frame = thread.GetFrameAtIndex(0) self.assertEqual("main", frame.GetFunctionName()) - stop_desc = thread.GetStopDescription(1000) + stop_desc = thread.stop_description self.assertIn("Stepping out from", stop_desc, "Got right description") def run_until_branch_instruction(self): @@ -153,7 +153,7 @@ class StepScriptedTestCase(TestBase): self.assertTrue(foo_val.GetValueDidChange(), "Foo changed") # And we should have a reasonable stop description: - desc = thread.GetStopDescription(1000) + desc = thread.stop_description self.assertIn("Stepped until foo changed", desc, "Got right stop description") def test_stop_others_from_command(self): diff --git a/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py b/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py index 435e18084a79..aa2d1d9feadc 100644 --- a/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py +++ b/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py @@ -49,7 +49,7 @@ class TsanMultipleTestCase(TestBase): stop_description = ( self.dbg.GetSelectedTarget() .process.GetSelectedThread() - .GetStopDescription(100) + .stop_description ) self.assertTrue( |
