Next: Static Probe Points, Previous: Dynamic Printf, Up: Breakpoints [Contents][Index]

#### 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 (see 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.