gdb: Save Breakpoints
5.1.9 How to save breakpoints to a file
---------------------------------------
To save breakpoint definitions to a file use the 'save breakpoints'
command.
'save breakpoints [FILENAME]'
This command saves all current breakpoint definitions together with
their commands and ignore counts, into a file 'FILENAME' suitable
for use in a later debugging session. This includes all types of
breakpoints (breakpoints, watchpoints, catchpoints, tracepoints).
To read the saved breakpoint definitions, use the 'source' command
(Command Files). Note that watchpoints with expressions
involving local variables may fail to be recreated because it may
not be possible to access the context where the watchpoint is valid
anymore. Because the saved breakpoint definitions are simply a
sequence of GDB commands that recreate the breakpoints, you can
edit the file in your favorite editing program, and remove the
breakpoint definitions you're not interested in, or that can no
longer be recreated.