I use Python to control GDB using command commands. This is how I call GDB:
$ gdb --batch --command=cmd.gdb myprogram
The cmd.gdb list contains only a line that calls a Python script
source cmd.py
And the cmd.py script tries to create a breakpoint and a list of connected commands
bp = gdb.Breakpoint("myFunc()")
The problem is that I don’t understand how to connect any GDB commands to the breakpoint from the Python script. Is there a way to do this, or am I missing a much simpler and more obvious way to automatically execute commands related to a breakpoint?
source share