Re: [RFA] new set/show multiple-choice-auto-select commands

Eli Zaretskii
2008-01-01T20:16:20Z

> Date: Tue, 1 Jan 2008 06:36:21 -0800
> From: Joel Brobecker <brobecker@adacore.com>
>
> The user sometimes enters an expression which is ambiguous. For instance,
> the name of a function or a variable which has homonyms... In that case,
> the debugger is expected to display the list of possibilities and ask
> the user to choose which one he meant (with an additional 2 possible
> choices: "all" and "cancel").
>
> This has been a very practical solution when in interactive mode
> (ie when a user is driving the session), but an annoyance when driving
> the debugger with a tool.

Please explain why, I'm not sure I understand. When driving GDB with
a tool, the tool is responsible for doing TRT, so why is this a
nuisance? And how does your solution alleviates that nuisance?

> So we added a new set/show command that
> allowed the user to configure the behavior of the debugger so that:
> 1. Either the menu is still displayed (default behavior);
> 2. The choice "all" is always automatically selected;
> 3. The choice "cancel" is always automatically selected.
> Some of the AdaCore engineers actually disliked the menu and started
> using this new command to always select all options, even in
> interactive mode.
>
> The syntax is as follow:
>
> (gdb) set multiple-choice-auto-select (off|all|cancel)
> (gdb) show multiple-choice-auto-select
>
> As said above, the default is "off", which preserves the current
> behavior by default.

Can you please give an example of the behavior under each one of these
settings? I'm afraid I cannot judge the suggestion without
understanding its effect on the users.

> + error (_("\
> +canceled because the command is ambiguous and the multiple-choice menu\n\
> +has been deactivated. See set/show multiple-choice-auto-select."));

Shouldn't "canceled" be capitalized?

> + add_setshow_enum_cmd ("multiple-choice-auto-select", no_class,
> + auto_select_choices, &auto_select_choice,
> + _("\
> +Set the debugger behavior when part of a command is ambiguous and\n\
> +a multiple-choice menu would normally be printed."), _("\

The first line of the command's doc string should be a complete
sentence, or at least a complete phrase. That's because some help
commands only display the first line (and stop at the first comma or
period in that line, IIRC).

Thanks.