3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Breakpoint%20Menus">Breakpoint Menus
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Error-in-Breakpoints.html#Error%20in%20Breakpoints">Error in Breakpoints
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Break-Commands.html#Break%20Commands">Break Commands
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Breakpoints.html#Breakpoints">Breakpoints
</a>
19 <h4 class=
"subsection">Breakpoint menus
</h4>
21 <p>Some programming languages (notably C
<tt>++
</tt>) permit a single function name
22 to be defined several times, for application in different contexts.
23 This is called
<dfn>overloading
</dfn>. When a function name is overloaded,
24 <code>break
</code><var>function
</var><code></code> is not enough to tell GDB where you want
25 a breakpoint. If you realize this is a problem, you can use
26 something like
<code>break
</code><var>function
</var><code>(
</code><var>types
</var><code>)
</code> to specify which
27 particular version of the function you want. Otherwise, GDB offers
28 you a menu of numbered choices for different possible breakpoints, and
29 waits for your selection with the prompt
<code>></code>. The first two
30 options are always
<code>[
0] cancel
</code> and
<code>[
1] all
</code>. Typing
<kbd>1</kbd>
31 sets a breakpoint at each definition of
<var>function
</var>, and typing
32 <kbd>0</kbd> aborts the
<code>break
</code> command without setting any new
35 <p>For example, the following session excerpt shows an attempt to set a
36 breakpoint at the overloaded symbol
<code>String::after
</code>.
37 We choose three particular definitions of that function name:
39 <pre class=
"smallexample"> (gdb) b String::after
42 [
2] file:String.cc; line number:
867
43 [
3] file:String.cc; line number:
860
44 [
4] file:String.cc; line number:
875
45 [
5] file:String.cc; line number:
853
46 [
6] file:String.cc; line number:
846
47 [
7] file:String.cc; line number:
735
49 Breakpoint
1 at
0xb26c: file String.cc, line
867.
50 Breakpoint
2 at
0xb344: file String.cc, line
875.
51 Breakpoint
3 at
0xafcc: file String.cc, line
846.
52 Multiple breakpoints were set.
53 Use the
"delete" command to delete unwanted