This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Bug handling zero sized symbols in minsyms.c


> -----Original Message-----
> From: Michael Snyder [mailto:msnyder@specifix.com] 
> Sent: 02 July 2008 18:45
> To: Robert Norton
> Cc: gdb@sourceware.org
> Subject: Re: Bug handling zero sized symbols in minsyms.c
> 
> On Wed, 2008-07-02 at 09:58 -0700, Robert Norton wrote:
> > Hi,
> > 
> > In minsyms.c:lookup_minimal_symbol_by_pc_section() there is 
> some code
> > which attempts to prefer symbols with sizes over those with 
> zero size.
> > This is quite useful[1]. Unfortunately the present code 
> will only work
> > if there is at most one zero-sized symbol. The fix is 
> around line 503:
> > 
> >  if (MSYMBOL_SIZE (&msymbol[hi]) == 0
> >    && best_zero_sized == -1)
> >    {
> >    	best_zero_sized = hi;
> >       hi--;          
> >       continue;      
> >    }
> > 
> > SHOULD be:
> > 
> > if (MSYMBOL_SIZE (&msymbol[hi]) == 0)
> > 	{
> > 	      if (best_zero_sized == -1)
> > 	        best_zero_sized = hi;
> > 	      hi--;
> > 	      continue;
> > 	}
> > 
> > We keep the highest zero-sized symbol as the best but continue to
> > iterate backwards until we hit a non-zero-sized symbol or run out of
> > symbols. It's pretty clear that this is what was originally 
> intended.
> 
> Your change is good, thanks.
> 
> > I can get copyright assigment for this if required although it seems
> > pretty trivial...
> 
> Not necessary, but feel free to if you'd like.
> I think this is at least the second change you've submitted.

It turns out that we (Broadcom) already have one on file, so no problems
there.

> Could you give us a change log entry please?

How about:

2008-07-03 Robert Norton (rnorton@broadcom.com)

   * minsyms.c: Fix a bug with ignoring zero-sized symbols when looking
up the minsym for a PC.

Cheers,

Robert


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]