Skip to content

Continue from the breakpoint command list

Andrea Cardaci edited this page Apr 4, 2021 · 1 revision

GDB allows to execute commands when a breakpoint is reached. A common pattern is to use this feature for side effects only and do not stop the program execution when the command list is executed, the canonical way to do that is to end the command list with a continue command.

Unfortunately, due to what we think is a GDB bug (see #218), this approach causes GDB to hang when the dashboard is used. As a workaround, define a custom continue command in a personal configuration file:

define continue-breakpoint
python gdb.post_event(lambda: gdb.execute('continue'))
end

Then use it in the command list in place of the regular continue:

break main
commands
# other commands here...
continue-breakpoint
end