I’ve been working on Python bindings for exposing GDB’s
frame_info, the internal structure it uses to keep track of the frame stack in the debuggee (or inferior, in GDB parlance). I got just enough working to be able to implement an equivalent of GDB’s backtrace command entirely in Python. The difference is that my version of the command prints older frames first and newer last, which feels more natural to me.
Here’s the output I get:
#2 0x080483bb in main at ../../src/examples/funcs.c:15
#1 0x08048391 in f1 at ../../src/examples/funcs.c:10
#0 f2 at ../../src/examples/funcs.c:5