I'm using Python to control GDB via batch commands. Here's how I'm calling GDB:
$ gdb --batch --command=cmd.gdb myprogram
The cmd.gdb
listing just contains the line calling the Python script
source cmd.py
And the cmd.py
script tries to create a breakpoint and attached command list
bp = gdb.Breakpoint("myFunc()") # break at function in myprogram
gdb.execute("commands " + str(bp.number))
# then what? I'd like to at least execute a "continue" on reaching breakpoint...
gdb.execute("run")
The problem is I'm at a loss as to how to attach any GDB commands to the breakpoint from the Python script. Is there a way to do this, or am I missing some much easier and more obvious facility for automatically executing breakpoint-specific commands?