Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85ec3b4

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 33d5b27 commit 85ec3b4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ bool ScriptedThread::CalculateStopInfo() {
257257
stop_info_sp =
258258
StopInfo::CreateStopReasonWithSignal(*this, signal, description.data());
259259
} break;
260+
case lldb::eStopReasonTrace: {
261+
stop_info_sp = StopInfo::CreateStopReasonToTrace(*this);
262+
} break;
260263
case lldb::eStopReasonException: {
261264
#if defined(__APPLE__)
262265
StructuredData::Dictionary *mach_exception;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def cleanup():
214214
self.assertTrue(thread, "Invalid thread.")
215215
self.assertEqual(thread.GetThreadID(), 0x19)
216216
self.assertEqual(thread.GetName(), "DummyScriptedThread.thread-1")
217-
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonSignal)
217+
self.assertStopReason(thread.GetStopReason(), lldb.eStopReasonTrace)
218218

219219
self.assertGreater(thread.GetNumFrames(), 0)
220220

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_state(self) -> int:
6969
return lldb.eStateStopped
7070

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

7474
def get_register_context(self) -> str:
7575
return struct.pack(

0 commit comments

Comments
 (0)