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

Markus Deuling
2008-01-16T07:32:03Z

Hi Joel,

Joel Brobecker schrieb:
> Hi Markus,

> The principle is indeed the same. The semantics of your command
> are a little unclear to me, as you didn't say what should happen
> if symbol-user-choice is off and you have more than one symbol matching.
> Do you cancel the lookup, choose all symbols, and pick one at random?

no, if it is set to off the default behaviour of GDB takes place. GDB executes
the "normal" symbol lookup routines as-is now.

If set to "on" and >= 1 symbol is found, decode_line_2 is called to let the user choose one ore more
symbols.

>
> We have one non-technical issue to solve if we are to merge the two
> ideas into one setting: You suggest the default to be off, which means
> no menu. But in Ada, we want the default to be "on" because we have
> always printed these menus in Ada, and removing them now would be
> a change of behavior.

Hm, I guess it should be ok to have "on" as default. I could change the patch a bit so the
the user menu only gets invoked if > 1 symbol is found and the normal lookup routines if <= 1 symbol is found.
Then there would only be a choice if there are multiple symbols.

>> Maybe we can merge the patches? I'd like to see the "set
>> symbol-user-choice on|off" command rather in a language-undependent
>> place like linespec.c as in a language-specific file like ada. What do
>> you think? Do you see the possibility for that?
>
> Absolutely. The reason why I posted this patch as a RFC is that
> I realized that this feature could be used for all languages,
> not just Ada. It's still on my plate to adjust the patch to put
> this in linespec instead of ada-lang - I will get to it soon.
>
> Would you be ok with using my command, however? I like the name better,
> but most of all, it's a little more complete: It's a tri-state setting
> as opposed to a binary one. We need to resolve the issue of the default.

Sure, if you put your command in linespec.c and set default to "on" I'll rework the patch
to make use of the command and invoke the user menu if there are > 1 symbols found.

For me this would be a good way to go. What do you think ?

Regards,
Markus

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com