From ac0ad5093ab451a36ea9ed34b0d3d461e759f4ea Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 14 Aug 2025 12:41:49 -0500 Subject: [lldb] Use PyThread_get_thread_ident instead of accessing PyThreadState (#153460) Use `PyThread_get_thread_ident`, which is part of the Stable API, instead of accessing a member of the PyThreadState, which is opaque when using the Stable API. --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 5b97fcb..15ea5e99 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -909,11 +909,11 @@ bool ScriptInterpreterPythonImpl::Interrupt() { Log *log = GetLog(LLDBLog::Script); if (IsExecutingPython()) { - PyThreadState *state = PyThreadState_GET(); + PyThreadState *state = PyThreadState_Get(); if (!state) state = GetThreadState(); if (state) { - long tid = state->thread_id; + long tid = PyThread_get_thread_ident(); PyThreadState_Swap(state); int num_threads = PyThreadState_SetAsyncExc(tid, PyExc_KeyboardInterrupt); LLDB_LOGF(log, -- cgit v1.1