Fwd: Re: coffgen.c:coff_find_nearest_line ?

Mark E. snowball3@bigfoot.com
Thu Jan 25 09:26:00 GMT 2001


[The reply-to field was empty, so I ended up with the reply instead of Tom 
Rix.]

> In coffgen.c, coff_find_nearest_line, some code has been added to use 
dwarf2
> to find line numbers.  The logic looks wrong.  Here is the code snippet 
from
> sources cvs ver 1.17

I think I can explain your confusion.

>   if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, 
offset,

This function returns false when it does find debug info. That's why there is 
a
'!'.

>       if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,

And this function returns true when it does find debug info. That's why no 
'!'.

> It looks like if the stab passes, its effect is wiped out by the call the
> dwarf2.  If stab fails, dwarf2 isn't given a chance.

It does look that way, but the code is correct because of the 
opposite meanings of the return value.

Mark



More information about the Binutils mailing list