Debugging with GDB (February 2008)

Table Of Contents
36 Debugging with GDB
Breakpoint Numbers
Type Breakpoint, watchpoint, or catchpoint.
Disposition
Whether the breakpoint is marked to be disabled or deleted when
hit.
Enabled or Disabled
Enabled breakpoints are marked with y’. n marks breakpoints
that are not enabled.
Address Where the breakpoint is in your program, as a memory address.
What Where the breakpoint is in the source for your program, as a file
and line number.
If a breakpoint is conditional, info break shows the condition on the line fol-
lowing the affected breakpoint; breakpoint commands, if any, are listed after
that.
info break with a breakpoint number n as argument lists only that break-
point. The convenience variable $_ and the default examining-address for the
x command are set to the address of the last breakpoint listed (see Section 8.5
[Examining memory], page 67).
info break displays a count of the number of times the breakpoint has been
hit. This is especially useful in conjunction with the ignore command. You
can ignore a large number of breakpoint hits, look at the breakpoint info to see
how many times the breakpoint was hit, and then run again, ignoring one less
than that number. This will get you quickly to the last hit of that breakpoint.
GDB allows you to set any number of breakpoints at the same place in your program.
There is nothing silly or meaningless about this. When the breakpoints are conditional,
this is even useful (see Section 5.1.5 [Break conditions], page 40).
GDB itself sometimes sets breakpoints in your program for special purposes, such as
proper handling of longjmp (in C programs). These internal breakpoints are assigned
negative numbers, starting with -1; info breakpoints does not display them.
You can see these breakpoints with the GDB maintenance command maint info
breakpoints’.
maint info breakpoints
Using the same format as info breakpoints’, display both the breakpoints
you’ve set explicitly, and those GDB is using for internal purposes. Internal
breakpoints are shown with negative breakpoint numbers. The type column
identifies what kind of breakpoint is shown:
breakpoint
Normal, explicitly set breakpoint.
watchpoint
Normal, explicitly set watchpoint.
longjmp Internal breakpoint, used to handle correctly stepping through
longjmp calls.