ping [Fwd: [RFC] User choice for multiply-defined symbols]

Markus Deuling deuling@de.ibm.com
Tue Aug 26 07:51:00 GMT 2008


Hi,

any opinions on this patch?

Regards,
Markus

-------- Original-Nachricht --------
Betreff: [RFC] User choice for multiply-defined symbols
Datum: Thu, 14 Aug 2008 17:34:45 +0200
Von: Markus Deuling <deuling@de.ibm.com>
An: GDB Patches <gdb-patches@sourceware.org>
CC: Ulrich Weigand <uweigand@de.ibm.com>

Hi,

I'd like to continue the discussion about a patch I began here: http://sourceware.org/ml/gdb-patches/2008-05/msg00190.html

When looking up a symbol (for example invoked by "break foo") GDB returns the first symbol it finds.  The 
search normally begins in the main executable (there is a special case when an application was built using 
the -Bsymbolic linker option.  Then the lookup prefers the symbol definition in the current shared library ).

Multi-location breakpoints handle the case where a single instance of a function (at a particular source file/line)
is implemented at multiple locations in the object file(s).  This new feature is intended to handle the case where 
we have *multiple* definitions of functions with the same name, so that just specifying the name does not fully identify 
the target function.  With this patch, GDB would query the user which of those definitions was meant.

What I try to achieve with this patch is to do a complete lookup in all object file(s) as well.  If this 
search finds more than one symbol "foo" like seen in the following example, GDB should let the user choose, which
one (or even more than one symbol) to use.

(gdb) break foo
[0] cancel
[1] all
[2] foo at ../../../../src/gdb/testsuite/gdb.base/multiple_symbols_mod.c:5
[3] foo at ../../../../src/gdb/testsuite/gdb.base/multiple_symbols.c:14

GDB's default behaviour isn't changed by the patch. User has to "set multiple-symbols ask" to invoke the 
search.  If > 1 symbols are found, the user is given the choice as seen above.

Attached you find the rebased patch. I'd like to hear your opinion about this patch.

Regards,
Markus

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff-multi-symbol
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080826/d0575be1/attachment.ksh>


More information about the Gdb-patches mailing list