Chapter 7. Stopping and Continuing
37
for one of the possible arguments described above (or no argument) specifying where to break.
Refer to Section 7.1.6
Break conditions
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. Refer to Section 7.1.5
Disabling breakpoints
.
hbreak
args
Set a hardware-assisted breakpoint.
args
are the same as for the
break
command and the break-
point is set in the same way, but the breakpoint requires hardware support and some target hard-
ware 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 data breakpoints can be set at a time, and gdb
will reject this command if more than two are used. Delete or disable unused hardware break-
points before setting new ones (refer to Section 7.1.5
Disabling breakpoints
and Section 7.1.6
Break conditions
.
thbreak
args
Set a hardware-assisted breakpoint enabled only for one stop.
args
are the same as for the
hbreak
command and the breakpoint is set in the same way. However, like the
tbreak
com-
mand, the breakpoint 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. Refer to Section 7.1.5
Disabling breakpoints
and Section 7.1.6
Break
conditions
.
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
command. 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
o
s. There is an implicit
.*
leading and trailing the regular
expression you supply, so to match only functions that begin with
foo
, use
^foo
.
When debugging C
++
programs,
rbreak
is useful for setting breakpoints on overloaded func-
tions that are not members of any special classes.
info breakpoints [
n
]
info break [
n
]
info watchpoints [
n
]
Print a table of all breakpoints, watchpoints, and catchpoints set and not deleted, with the follow-
ing columns for each breakpoint:
Breakpoint Numbers
Type
Breakpoint, watchpoint, or catchpoint.
Summary of Contents for ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Page 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......