Differentiating symbols in multiple copies of shared libraries

Avi Gozlan avi@checkpoint.com
Sun Jan 23 12:07:00 GMT 2011


A developer in our organization added some code to allow differentiation between symbols with the same name in different object files. This feature is enabled once a GDB variable called symlib is set.

Presumably this addition is not written according to GNU policy or GDB conventions, yet this feature is important as discussed below.

Could you recommend on a procedure for promoting this required feature (or anyway merge the source code to GDB)? Is there any contact for working with for forwarding the implementation (currently diff in 4 files: minsym.c, stack.c, symtab.h, symtab.c)?

BR,

Avi

-----Original Message-----
From: Tom Tromey [mailto:tromey@redhat.com] 
Sent: Thursday, December 09, 2010 11:53 PM
To: Avi Gozlan
Cc: 'gdb@sourceware.org'
Subject: Re: Differentiating symbols in multiple copies of shared libraries

>>>>> "Avi" == Avi Gozlan <avi@checkpoint.com> writes:

Avi> We did not find a way for GDB to refer to a symbol in a specific
Avi> copy of the object file (other then referring to the specific
Avi> address).

There is currently no way to do this.

Avi> Please note that we need to differentiate between symbols not only
Avi> for defining breakpoints but for other needs such as disassembly,
Avi> backtrace as well.

Avi> Your input regarding this issue will be appreciated.

I think it would be a welcome addition to gdb.

The dbx syntax doesn't seem particular gdb-ish to me, but it would do.
HPD-like syntax along the lines of "#libfoo.so#function" has also been
suggested.

If you implement this in linespecs, which is the natural approach, then
it will automatically work for disassembly.

For "backtrace", I guess you mean that at least ambiguous symbols should
be printed in this syntax in a backtrace.  I'm sure that is doable as
well.

I am not sure whether anybody is working on this.  At the very least,
please file a bug.

Tom



More information about the Gdb mailing list