lanza added a comment. I guess if the intention of that is maintain the debugger instance around it should work, but at the moment it segfaults pretty quick with Xcode's lldb using:
import threading import lldb import time def background(debugger: lldb.SBDebugger): while True: time.sleep(1) print(debugger) def __lldb_init_module( debugger: lldb.SBDebugger, internal_dict: dict ): threading.Thread() threading.Thread(target=background, args=(debugger,)).start() and $ lldb a.out (lldb) command script import test.py (lldb) // do a few things 0 lldb 0x00000001058d8575 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37 1 lldb 0x00000001058d7b55 llvm::sys::RunSignalHandlers() + 85 2 lldb 0x00000001058d8dd6 SignalHandler(int) + 262 3 libsystem_platform.dylib 0x00007fff20394d7d _sigtramp + 29 4 libsystem_platform.dylib 0x000000010762d680 _sigtramp + 18446603344394422560 5 liblldbPluginScriptInterpreterPython3.dylib 0x00000001059f1802 _wrap_SBDebugger___str__(_object*, _object*) + 130 6 Python3 0x0000000105bf6453 cfunction_call_varargs + 323 7 Python3 0x0000000105bf5dd6 _PyObject_MakeTpCall + 374 8 Python3 0x0000000105cd613c call_function + 652 9 Python3 0x0000000105cd26d6 _PyEval_EvalFrameDefault + 29782 10 Python3 0x0000000105bf678d function_code_fastcall + 237 11 Python3 0x0000000105bf7192 _PyObject_FastCall_Prepend + 178 12 Python3 0x0000000105c4e527 slot_tp_str + 183 13 Python3 0x0000000105c37a62 PyObject_Str + 146 14 Python3 0x0000000105c09b95 PyFile_WriteObject + 149 15 Python3 0x0000000105cc96f2 builtin_print + 450 16 Python3 0x0000000105c34a82 cfunction_vectorcall_FASTCALL_KEYWORDS + 130 17 Python3 0x0000000105cd6012 call_function + 354 18 Python3 0x0000000105cd278a _PyEval_EvalFrameDefault + 29962 19 Python3 0x0000000105bf678d function_code_fastcall + 237 20 Python3 0x0000000105bf6124 PyVectorcall_Call + 100 21 Python3 0x0000000105cd2a34 _PyEval_EvalFrameDefault + 30644 22 Python3 0x0000000105bf678d function_code_fastcall + 237 23 Python3 0x0000000105cd6012 call_function + 354 24 Python3 0x0000000105cd26b9 _PyEval_EvalFrameDefault + 29753 25 Python3 0x0000000105bf678d function_code_fastcall + 237 26 Python3 0x0000000105cd6012 call_function + 354 27 Python3 0x0000000105cd26b9 _PyEval_EvalFrameDefault + 29753 28 Python3 0x0000000105bf678d function_code_fastcall + 237 29 Python3 0x0000000105bf91e2 method_vectorcall + 322 30 Python3 0x0000000105bf6124 PyVectorcall_Call + 100 31 Python3 0x0000000105d7800a t_bootstrap + 74 32 Python3 0x0000000105d29829 pythread_wrapper + 25 33 libsystem_pthread.dylib 0x00007fff20350950 _pthread_start + 224 34 libsystem_pthread.dylib 0x00007fff2034c47b thread_start + 15 fish: 'lldb' terminated by signal SIGSEGV (Address boundary error) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93926/new/ https://reviews.llvm.org/D93926 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits