Debugging with GDB (February 2008)

Table Of Contents
Chapter 21: The gdb/mi Interface 279
Synopsis
-break-insert [ -t ] [ -h ] [ -r ]
[ -c condition ] [ -i ignore-count ]
[ -p thread ] [ line | addr ]
If specified, line, can be one of:
function
filename:linenum
filename:function
*address
The possible optional parameters of this command are:
-t Insert a temporary breakpoint.
-h Insert a hardware breakpoint.
-c condition
Make the breakpoint conditional on condition.
-i ignore-count
Initialize the ignore-count.
-r Insert a regular breakpoint in all the functions whose names match the given
regular expression. Other flags are not applicable to regular expression.
Result
The result is in the form:
^done,bkptno="number ",func="funcname",
file="filename ",line="lineno"
where number is the GDB number for this breakpoint, funcname is the name of the function
where the breakpoint was inserted, filename is the name of the source file which contains
this function, and lineno is the source line number within that file.
Note: this format is open to change.
GDB command
The corresponding GDB commands are break’, tbreak’, hbreak’, thbreak’, and
rbreak’.
Example
(gdb)
-break-insert main
^done,bkpt=number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0001072c",
file="recursive2.c",line="4",times="0"
(gdb)
-break-insert -t foo