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

Markus Deuling
2008-01-16T10:40:13Z

Joel Brobecker schrieb:
>>> 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.
>
> Actually, I was asking you to confirm what the current "normal" symbol
> lookup does. AFAIK, it picks one symbol at random, which is a bug.
> So my question still stands :), but the answer is not critical for
> my part of the patch - we can talk about that later when you make
> your own adjustments inside linespec.

As far as I see there are two paths GDB can follow currently:

1. If GDB currently stands in a shared library which was built using
-Bsymbolic it will pick the first symbol matching from exactly that library.

2. "default"
In all other cases (so without -Bsymbolc in a shared library) GDB's lookup starts in the
main executables binary. If the user for example stand in a shared library and invokes "br foo"
and there is a symbol in that library and in the main executable as well, GDB will pick the
one in the meain executable.
If the symbol is not found in the main executable GDB iterates over the shared libraries and picks
the first symbol found.

>
> Deal. A new patch should be sent soon.
>

Great, standing by ... :-)

Regards,
Markus

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