Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.458 diff -u -p -r1.458 gdb.texinfo --- gdb.texinfo 19 Jan 2008 13:37:13 -0000 1.458 +++ gdb.texinfo 24 Jan 2008 21:02:37 -0000 @@ -3798,19 +3798,31 @@ end @subsection Breakpoint Menus @cindex overloading @cindex symbol overloading +@cindex Ada generics +@cindex C++ templates -Some programming languages (notably C@t{++} and Objective-C) permit a -single function name -to be defined several times, for application in different contexts. -This is called @dfn{overloading}. When a function name is overloaded, -@samp{break @var{function}} is not enough to tell @value{GDBN} where you want -a breakpoint. You can use explicit signature of the function, as in -@samp{break @var{function}(@var{types})}, to specify which -particular version of the function you want. Otherwise, @value{GDBN} offers -you a menu of numbered choices for different possible breakpoints, and -waits for your selection with the prompt @samp{>}. The first two -options are always @samp{[0] cancel} and @samp{[1] all}. Typing @kbd{1} -sets a breakpoint at each definition of @var{function}, and typing +A breakpoint location expression (@ref{Specify Location}) is sometimes +ambiguous. For instance, some programming languages (notably Ada, +C@t{++} and Objective-C) permit a single function name to be defined +several times, for application in different contexts. This is called +@dfn{overloading}. Another example involving Ada is generics. A +@dfn{generic package} is similar to C@t{++} templates and is typically +instantiated several times, resulting in the same function name being +defined in different contexts. + +In some cases and depending on the language, it is possible to make +the location unambiguous. For instance in C@t{++}, you can specify +the signature of the function you want to break on, as in @samp{break +@var{function}(@var{types})}. In Ada, using the fully qualified +name of your function often makes the location expression unambiguous. + +By default when the location expression is ambiguous, @value{GDBN} +automatically selects all possible locations. But this behavior +can be configured so that a menu is of numbered choices for different +possible breakpoints is displayed (see below). In that case, +the @value{GDBN} waits for your selection with the prompt @samp{>}. +The first two options are always @samp{[0] cancel} and @samp{[1] all}. +Typing @kbd{1} sets a breakpoint at each possible locations and typing @kbd{0} aborts the @code{break} command without setting any new breakpoints. @@ -3841,6 +3853,26 @@ Use the "delete" command to delete unwan @end group @end smallexample +@table @code +@kindex set multiple-choice-auto-select +@item set multiple-choice-auto-select @var{mode} +@cindex menu auto select +This option allows you to adjust the debugger behavior when a location +expression is ambiguous. When set to @var{off}, the debugger does not +perform any automatic selection, and instead asks you to select from +a multiple-choice menu which choices should be used. When set to @var{all}, +@value{GDBN} automatically selects all possible choices. This is strictly +equivalent to selecting choice @var{1} in the multiple-choice menu, +except that the menu is not displayed. And finally, this option can be +set to @var{cancel}, which causes the abort of the command if the +location expression is ambiguous. By default, this option is set to +@var{all}. + +@kindex show multiple-choice-auto-select +@item show multiple-choice-auto-select +Show the current value of the multiple-choice-auto-select setting. +@end table + @c @ifclear BARETARGET @node Error in Breakpoints @subsection ``Cannot insert breakpoints''