This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

Re: coffgen.c:coff_find_nearest_line ?


> 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


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