GDB breakpoints

breakpointsgdb

I have a list of breakpoints which I want to add each time I debug a particular program.

Is there a way I can put all of the breakpoint information in a file and use it at the start of each debug session? In other words can I provide a script file with breakpoint information to GDB before I give the 'run' command?

Best Answer

From man gdb(1):

  -x file
           Execute GDB commands from file file.

You could then put your breakpoints in a file:

break [file:]function
break [file:]function
...