Does gdb support weak/normal symbols?

H. J. Lu hjl@lucon.org
Mon Jan 16 18:11:00 GMT 2006


On Mon, Jan 16, 2006 at 10:58:46AM -0500, Daniel Jacobowitz wrote:
> On Mon, Jan 16, 2006 at 07:47:54AM -0800, H. J. Lu wrote:
> > On Sun, Jan 15, 2006 at 08:49:04PM -0500, Daniel Jacobowitz wrote:
> > > On Sun, Jan 15, 2006 at 04:48:31PM -0800, H. J. Lu wrote:
> > > > foo in weak.c isn't in the symbol table. But gdb sets the breakpoint
> > > > of foo on it. Shouldn't gdb be clever enough to know to check the
> > > > other one?
> > > 
> > > GDB uses the debug information in preference to the ELF symbol table. 
> > > That one says this is a definition of foo.
> > > 
> > > Eventually "break foo" will breakpoint both of them.
> > 
> > What did you mean by "Eventually"? Were you saying that it was a bug
> > and would be fixed in the future? Is anyone working on it? I'd like
> > to help.
> 
> Please read the archives for the last few days.  This is covered by the
> same general problem description as "break FILE:LINE" - you have asked
> for an ambiguous breakpoint, and instead of properly placing multiple
> breakpoints or prompting GDB has picked one at random.
> 

"break foo" may be slightly different from "break FILE:LINE". For the
global symbol, foo, there will be only one definition. It is a
matter of picking the right foo for "break foo". There is no need to
set multiple breakpoints nor prompt user.


H.J.



More information about the Gdb mailing list