This question is about how to debug a GDB python extension with GDBFrontend. This is the way I've doing it on "plain GDB", but it only works sub-optimal on command line:
(gdb) source /path/to/extension/myext.py
(gdb) py import pdb
(gdb) py pdb.run('gdb.execute("myext-command")')
> <string>(1)<module>()
(Pdb) import sys
(Pdb) import myext
(Pdb) sys.path.insert(0, '/path/to/extension')
(Pdb) from myext import MyCommand
(Pdb) b MyCommand.invoke
(Pdb) b CPrint.invoke
Breakpoint 1 at /path/to/extension/myext.py:688
(Pdb) c
> /path/to/extension/myext.py(688)invoke()
-> try:
Is debugging python extensions for GDB possible in a way that GDBFrontend will show all the variables and let us use step/next/... directly (not in the command line)?
The docs have https://rohanrhu.github.io/gdb-frontend/tutorials/python-c-extension-debugging/ which is "kind of the other way around".
This question is about how to debug a GDB python extension with GDBFrontend. This is the way I've doing it on "plain GDB", but it only works sub-optimal on command line:
Is debugging python extensions for GDB possible in a way that GDBFrontend will show all the variables and let us use step/next/... directly (not in the command line)?