GDB can decode Python stack traces as Python code, as long as you have have python-gdb.py from the Python source distribution in the same place as your Python executable.
GDB does so much cool. It just sucks that it's missing a high quality front-end. I know there are a bunch out there, but they all seem pretty janky and get confused a lot; I just want a really serious group of people (some Red Hat people for example) to make a high quality native debugging app which properly speaks the GDB protocol and handles all the edge cases.
What I would love is also to be able to set python breakpoints from gdb. And integration with rr, so I could reverse-continue to said breakpoints. And ponies.
Wow, that's pretty amazing. I wonder how it's implemented, and if there are any tutorials on implementing something similar, for programming language designers/creators.
> There's Voltron, which is an extensible Python debugger UI that supports LLDB, GDB, VDB, and WinDbg/CDB (via PyKD) and runs on macOS, Linux and Windows. For the first three it supports x86, x86_64, and arm with even arm64 support for lldb while adding even powerpc support for gdb.
https://github.com/snare/voltron
Comments
GDB can decode Python stack traces as Python code, as long as you have have python-gdb.py from the Python source distribution in the same place as your Python executable.
GDB does so much cool. It just sucks that it's missing a high quality front-end. I know there are a bunch out there, but they all seem pretty janky and get confused a lot; I just want a really serious group of people (some Red Hat people for example) to make a high quality native debugging app which properly speaks the GDB protocol and handles all the edge cases.
(And no, I don't want it integrated into an IDE.)
What I would love is also to be able to set python breakpoints from gdb. And integration with rr, so I could reverse-continue to said breakpoints. And ponies.
Wow, that's pretty amazing. I wonder how it's implemented, and if there are any tutorials on implementing something similar, for programming language designers/creators.
Theres also Py Spy, a profiling tool that can generate flame charts containing a mix of python and C (or C++) calls.
https://github.com/benfred/py-spy
It's worked really well for my needs
py-spy also makes it very easy to scrape from existing processes, which is invaluable if you are e.g. ever trying to diagnose a deadlock
I think it uses gdb's frame filter API: https://sourceware.org/gdb/onlinedocs/gdb/Writing-a-Frame-Fi...
GDB itself is fully scriptable in Python:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Pytho...
This has been packaged as Tools/gdb/libpython.py lately.
From https://github.com/jupyterlab/debugger/issues/284 en ENH: Mixed Python/C debugging (GDB,) #284
These days, we have CFFI and Apache Arrow for C+Python etc.
https://wiki.python.org/moin/DebuggingWithGdb lists the GDB debugging symbol packages for various distros
FWIU Fedora GDB now optionally automatically installs debug syms; from attempting to debug TuxMath SDL with GDB before just installing the Flatpak.
https://developers.redhat.com/articles/2021/09/08/debugging-... (2021) describes more recent efforts to improve Python debugging with c extensions