This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch]: User choice for multiply-defined symbols
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 05 May 2008 12:35:35 +0400
- Subject: Re: [patch]: User choice for multiply-defined symbols
- References: <481EBD33.6090704@de.ibm.com>
Markus Deuling wrote:
> Hello,
>
> the following patch makes use of the new "multiple-symbols" command introduced by Joel.
>
> If there is more than one symbol associated with a name and the multiple-symbols flag is set
> to "ask", the user is asked to choose which of the symbols 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
>> 3
> Breakpoint 6 at 0x100004b0: file ../../../../src/gdb/testsuite/gdb.base/multiple_symbols.c, line
> 14.
>
> I extended "search_symbols" by a distinct flag. If set the new function "distinct_search_syms" is
> called before returning the search result. As the name says, this function removes duplicates from
> the search result.
>
> For exmaple:
>
> If GDB debugs a threaded application with a symbol "foo" in every thread, there would be a user
> choice like:
>
> [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_mod.c:5
> [4] foo at ../../../../src/gdb/testsuite/gdb.base/multiple_symbols_mod.c:5
I'm not sure -- are we searching for a symbol in each thread? That seems a little
bit strange -- did I miss some recent development?
- Volodya