Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB setting multiple breakpoints

Tags:

c

gdb

I would like to set multiple breakpoints at once in different files in GDB.

Is it possible to have a script or any other way which I can run once I enter GDB debugger and have all the breakpoints set instead of setting them one by one using traditional set break command.

All the resources I searched pointed to how to set breakpoints effectively. But, nothing seems to address my concern.

like image 540
Gaara Avatar asked Jul 05 '15 19:07

Gaara


1 Answers

You can use the source command in gdb.

You can also put the commands in the .gdbinit file which will be sourced when you start gdb. Put the commands there and they will be run without doing anything more.

like image 91
Craig S. Anderson Avatar answered Oct 24 '22 22:10

Craig S. Anderson