![script debugger run on the main thread script debugger run on the main thread](https://olaz1storemk1.blob.core.windows.net/olaz1-wpmk3/2019/05/2019-1-script-debugger-dialog.png)
#Script debugger run on the main thread software
usr/share/gdb/auto-load/usr/bin/) and gdb auto-loads them.Įxample with a simple threaded python script: #!/usr/bin/env python3Ĭopyright (C) 2021 Free Software Foundation, Inc.
![script debugger run on the main thread script debugger run on the main thread](https://hwdebugger.com/wp-content/uploads/2016/05/xilinx1.png)
On Debian (since at least Buster) the extensions are part of the Them, gdb can attach to a running program, select a thread and print its (Shoutout for Dan's blog for some key information for me, notably the threading fix!) You can parse what the objects are with the "pyo" macro. With this stuff in place, you can do stuff like gdb> attach Otherwise commands like pystack won't terminate on threads other than the main thread. With the following: while ($pc Py_GetArgcArgv) & ($pc thread_PyThread_start_new_thread) You need to replace lines like this while $pc Py_GetArgcArgv However it's broken for multi-threaded debugging (!).
![script debugger run on the main thread script debugger run on the main thread](https://devblogs.microsoft.com/wp-content/uploads/sites/29/2019/02/7271.wes-3-30-13-5.png)
The Python folks have included a sample ".gdbinit" in their Misc directory, which has some useful macros. You can then attach to it with GDB at any time. Make sure your workload is running on that version of the interpreter. Sudo ln -s /usr/local/pydbg/bin/python /usr/local/bin/dbgpy If you don't have one, you need to download source from and build it yourself. To make sense of what's going on, you need the Python interpreter to be compiled with symbols. You can attach a debugger to a multi-threaded Python process, but you need to do it at the C level.