[RFA] new set/show multiple-choice-auto-select commands (take 2)
Markus Deuling
deuling@de.ibm.com
Thu Jan 17 06:37:00 GMT 2008
Joel Brobecker schrieb:
> Hello,
>
> This is a followup on:
>
> [RFA] new set/show multiple-choice-auto-select commands
> http://www.sourceware.org/ml/gdb-patches/2008-01/msg00007.html
>
> I posted a patch that introduced this new option for Ada, but saying
> that there was no reason to keep this option ada-specific.
>
> Users sometimes enter expressions that are ambiguous. For instance,
> printing the value of a variable that has homonyms. In that case,
> the debugger doesn't know which of the variables the user meant,
> and needs to ask the user by displaying a multiple-choice menu.
>
> This option allows the user to configure the behavior of the debugger
> so that, either:
>
> 1. The menu is still displayed as before (default behavior)
> and the debugger waits for the user to select the choice he wants;
> 2. The menu is not displayed, and the choice "all" is assumed
> (or an error is triggered if the choice "all" is not available);
> 3. The menu is not displayed and the choice "cancel" is always
> assumed (resulting in an error).
>
> The syntax is as follow:
>
> (gdb) set multiple-choice-auto-select (off|all|cancel)
> (gdb) show multiple-choice-auto-select
>
> Markus will also be using this option for another case where
> a multiple-choice menu might be useful.
>
> 2008-01-16 Joel Brobecker <brobecker@adacore.com>
>
> * symtab.c (auto_select_off, auto_select_all, auto_select_cancel):
> New constants.
> (auto_select_modes, auto_select_mode): New static globals.
> (multiple_choice_auto_select_mode): New function.
> (_initialize_symtab): Add new multiple-choice-auto-select command.
> * symtab.h (auto_select_off, auto_select_all, auto_select_cancel)
> (multiple_choice_auto_select_mode): Add declarations.
> * ada-lang.c (user_select_syms): Add handling of new
> multiple-choice-auto-select setting.
>
Hi Joel,
I integrated my patch to use your command and it works fine ;-)
(gdb) br foo2
Breakpoint 2 at 0xf86444: file /home/deuling/gdb/dev/gdb/testsuite/gdb.base/solib-symbol-lib.c, line 29.
(gdb) set multiple-choice-auto-select all
(gdb) br foo2
[0] cancel
[1] all
[2] foo2 at /home/deuling/gdb/dev/gdb/testsuite/gdb.base/solib-symbol-main.c:39
[3] foo2 at /home/deuling/gdb/dev/gdb/testsuite/gdb.base/solib-symbol-lib.c:29
> 2 3
Breakpoint 3 at 0x8048523: file /home/deuling/gdb/dev/gdb/testsuite/gdb.base/solib-symbol-main.c, line 39.
Note: breakpoint 2 also set at pc 0xf86444.
Breakpoint 4 at 0xf86444: file /home/deuling/gdb/dev/gdb/testsuite/gdb.base/solib-symbol-lib.c, line 29.
warning: Multiple breakpoints were set.
Use the "delete" command to delete unwanted breakpoints.
(gdb)
I only see one issue. The the commands state is either off or all (I now ignore cancel). If set to all, my routines
offer the user choice but doesn't choose all symbols right now !.
Would it be possible to add a "on" state to the command which then would give the user a choice. I would adapt my patch
then a bit. If set to "all" automagically all symbols found are taken, if set to "on" the user is given a choice. What do you think?
I attached the adapted patch in the current version.
Regards,
Markus
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: new-diff-user-choice-symbols
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080117/bb94b4ff/attachment.ksh>
More information about the Gdb-patches
mailing list