Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

break linenum Set a breakpoint at line linenum in the current source file.
The current source file is the last file whose source text was
printed. The breakpoint will stop your program just before it
executes any of the code on that line.
break filename:linenum Set a breakpoint at line linenum in source file filename.
break filename:function Set a breakpoint at entry to function function found in file
filename. Specifying a fie name as well as a function name
is superfluous except when multiple files contain similarly
named functions.
break *address Set a breakpoint at address address. You can use this to
set breakpoints in parts of your program which do not have
debugging information or source files.
break When called without any arguments, break sets a breakpoint
at the next instruction to be executed in the selected stack
frame (see Chapter 6 (page 50)). In any selected frame but
the innermost, this makes your program stop as soon as
control returns to that frame. This is similar to the effect of a
finish command in the frame inside the selected
frame―except that finish does not leave an active
breakpoint. If you use break without an argument in the
innermost frame, GDB stops the next time it reaches the current
location; this may be useful inside loops.
GDB normally ignores breakpoints when it resumes execution,
until at least one instruction has been executed. If it did not
do this, you would be unable to proceed past a breakpoint
without first disabling the breakpoint. This rule applies whether
or not the breakpoint already existed when your program
stopped.
break ... if cond Set a breakpoint with condition cond; evaluate the expression
cond each time the breakpoint is reached, and stop only if
the value is nonzero―that is, if cond evaluates as true. '...'
stands for one of the possible arguments described above (or
no argument) specifying where to break. See “Break
conditions” (page 41), for more information on breakpoint
conditions.
tbreak args Set a breakpoint enabled only for one stop. args are the
same as for the break command, and the breakpoint is set
in the same way, but the breakpoint is automatically deleted
after the first time your program stops there. See “Disabling
breakpoints” (page 41).
hbreak args Set a hardware-assisted breakpoint. args are the same as
for the break command and the breakpoint is set in the same
way, but the breakpoint requires hardware support and some
target hardware may not have this support. The main purpose
of this is EPROM/ROM code debugging, so you can set a
breakpoint at an instruction without changing the instruction.
This can be used with the new trap-generation provided by
SPARClite DSU and some x86-based targets. These targets
will generate traps when a program accesses some data or
instruction address that is assigned to the debug registers.
However, the hardware breakpoint registers can take a limited
number of breakpoints. For example, on the DSU, only two
Breakpoints 37