stabs at function entry point?

Daniel Jacobowitz drow@mvista.com
Sun Mar 17 12:05:00 GMT 2002


On Sun, Mar 17, 2002 at 11:34:07AM -0800, Richard Henderson wrote:
> On Sat, Mar 16, 2002 at 10:50:32PM -0500, Daniel Jacobowitz wrote:
> > Revised patch attached.  This works fairly well, because GCC 2.95 does
> > things like this:
> > main:
> >         pushl %ebp
> >         movl %esp,%ebp
> >         subl $24,%esp
> > .stabn 68,0,2,.LM1-main
> > .LM1:
> > .stabn 68,0,3,.LM2-main
> > .LM2:
> > .LBB2:
> >         movl $1,-4(%ebp)
> > 
> > i.e. the stab which probably ought to be before the prologue is in fact
> > after it.
> 
> Yes, I remember fixing this bug.  IMO you shouldn't spend any
> extra effort catering to it.

Except for the fact that all 2.95.x versions of GCC have the same
problem.  That's still the system compiler for Debian, and looks like
it will be for some time to come.  The MIPS lists still have people
using egcs 1.1.2.  Etc.  Sure, it's a compiler bug, but I'd think it
was worth catering to given the prevalence of affected compilers.

On Sun, Mar 17, 2002 at 11:31:53AM -0800, Richard Henderson wrote:
> On Sat, Mar 16, 2002 at 08:14:32PM -0500, Daniel Jacobowitz wrote:
> > As for DWARF2 - we don't do this correctly there either.  For the first
> > function in a compilation unit, we will return ??:0, because the first
> > entry in the line table will be just after the prologue.
> 
> Err, since when?
> 
> 	void foo()
> 	{
> 	  bar();
> 	}

You probably realized this after my other message, but: In gcc 2.95.

 Line Number Statements:
  Extended opcode 2: set Address to 0x6
  Special opcode 12: advance Address by 0 to 0x6 and Line by 2 to 3
  Extended opcode 2: set Address to 0x6
  Special opcode 11: advance Address by 0 to 0x6 and Line by 1 to 4
  Extended opcode 2: set Address to 0xb
  Special opcode 11: advance Address by 0 to 0xb and Line by 1 to 5
  Extended opcode 2: set Address to 0xd

(where foo begins at 0x0).

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



More information about the Binutils mailing list