This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stabs at function entry point?
On Thu, Mar 14, 2002 at 01:32:24AM +0000, John Levon wrote:
> On Wed, Mar 13, 2002 at 08:18:05PM -0500, Daniel Jacobowitz wrote:
>
> > Have you looked at the find_nearest_line code for stabs? It's in
> > bfd/syms.c. It reads the line numbers from function stabs into the
> > line table. The presence or absence of a matching line number marking
> > should be No Big Deal for this interface.
>
> Browsing the code, it looks like if I look up the very start of the
> function, and there's no entry at the given vma (so that :
>
> 1185 if (offset >= info->indextable[mid].val
> 1186 && offset < info->indextable[mid + 1].val)
>
> would catch it), then the above binary search will find the previous
> stab entry. So for example the first function in a file will come out as
> :
>
> file.c:0
>
> since *pline never gets set properly.
>
> And we've recently seen this problem with a user using 2.95.3.
>
> So either our definitions of Big Deal differ, or I'm just wrong and
> the problem we've been seeing is unrelated to what's being discussed
> here.
Both right again... the line information for the N_FUN stab is entered,
but then not used in the line number search. I believe this is simply
a bug in BFD. I'll test a patch later this week.
In other words, I don't believe this function needs the initial stab.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer