Debugging with GDB (September 2007)
Chapter 5: Stopping and Continuing 35
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 Sec-
tion 5.1.4 [Disabling breakp oints], page 39.
xbreak args
Set breakpoint at procedure exit. Argument may be function name, or "*"
and an address. If a function is specified, execution breaks at end of co de for
that function. If an address is specified, execution breaks at the end of the
function that contains the specified address . When no arguments are specified,
the current execution address of the selected stack frame is used by default.
This is useful for breaking on return to a stack frame.
hbreak args
Set a hardware-assisted breakpoint. args are the sam e as for the break com-
mand and the breakpoint is set in the same way, but the breakpoint re quires
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 break-
point 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 data breakpoints c an be set at a time, and GDB
will reject this command if more than two are used. Delete or disable unused
hardware breakpoints before setting new ones (see Section 5.1.4 [Disabling],
page 39). See Section 5.1.5 [Break conditions], page 40.
thbreak args
Set a hardware-assisted breakpoint enabled only for one s top. args are the
same as for the hbreak command and the breakpoint is set in the same way.
However, like the tbreak command, the breakp oint is automatically deleted
after the first time your program stops there. Also, like the hbreak command,
the breakpoint requires hardware support and some target hardware may not
have this support. See Section 5.1.4 [Disabling breakpoints], page 39. See also
Section 5.1.5 [Break conditions], page 40.
rbreak regex
Set breakpoints on all functions matching the regular expression regex. This
command sets an unconditional breakpoint on all matches, printing a list of all
breakpoints it set. Once these breakpoints are set, they are treated just like the
breakpoints set with the break com mand. You can delete them, disable them,
or make them conditional the same way as any other breakpoint.
The syntax of the regular expression is the standard one used with tools like
‘grep’. Note that this is different from the syntax used by shells, so for instance
foo* matches all functions that include an fo followed by zero or more os. There
is an implicit .* leading and trailing the regular expression you supply, so to
match only functions that be gin with foo, use ^foo.