Skip to content

Commit 8f407b8

Browse files
committed
[lldb] Add "Trace" stop reason in Scripted Thread
This patch adds support to eStopReasonTrace to Scripted Threads. This is necessary when using a Scrited Process with a Scripted Thread Plan to report a special thread stop reason to the thread plan. rdar://109425542 Differential Revision: https://reviews.llvm.org/D151043 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent ac09a0e commit 8f407b8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lldb/source/Plugins/Process/scripted/ScriptedThread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ bool ScriptedThread::CalculateStopInfo() {
258258
stop_info_sp =
259259
StopInfo::CreateStopReasonWithSignal(*this, signal, description.data());
260260
} break;
261+
case lldb::eStopReasonTrace: {
262+
stop_info_sp = StopInfo::CreateStopReasonToTrace(*this);
263+
} break;
261264
case lldb::eStopReasonException: {
262265
#if defined(__APPLE__)
263266
StructuredData::Dictionary *mach_exception;

lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def cleanup():
186186
self.assertTrue(thread, "Invalid thread.")
187187
self.assertEqual(thread.GetThreadID(), 0x19)
188188
self.assertEqual(thread.GetName(), "DummyScriptedThread.thread-1")
189-
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonSignal)
189+
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonTrace)
190190

191191
self.assertGreater(thread.GetNumFrames(), 0)
192192

lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ def get_state(self) -> int:
6767
return lldb.eStateStopped
6868

6969
def get_stop_reason(self) -> Dict[str, Any]:
70-
return { "type": lldb.eStopReasonSignal, "data": {
71-
"signal": signal.SIGINT
72-
} }
70+
return { "type": lldb.eStopReasonTrace, "data": {} }
7371

7472
def get_register_context(self) -> str:
7573
return struct.pack(

0 commit comments

Comments
 (0)