Debugging a Mixed Python and C Language Stack
developer.nvidia.com
Debugging a Mixed Python and C Language Stack
1–10 of 25 posts
Re: Debugging a Mixed Python and C Language Stack
#2Re: Debugging a Mixed Python and C Language Stack
#3GDB 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.
Re: Debugging a Mixed Python and C Language Stack
#4Re: Debugging a Mixed Python and C Language Stack
#5When developing PyTorch, we also run into a lot of mixed Python/C++ language situations. We've recently been experimenting with in-process 'combined' Python/C++/PyTorch 2.0 stack traces to make it easier to understand where code is executing ( https://dev-discuss.pytorch.org/t/fast-combined-c-python-tor... ).
Re: Debugging a Mixed Python and C Language Stack
#6Re: Debugging a Mixed Python and C Language Stack
#7GDB 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.
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.
https://github.com/benfred/py-spy
It's worked really well for my needs
Re: Debugging a Mixed Python and C Language Stack
#8Re: Debugging a Mixed Python and C Language Stack
#9Also somewhat depressing that, yet again, the GIL was to blame, and that after all that impressive investigatory work, the fix was (spoiler alert!) "rewrite the offending function in C".
Re: Debugging a Mixed Python and C Language Stack
#10GDB 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.