This is the mail archive of the gdb@sourceware.cygnus.com 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]

RE: Suggested (easier) fix to ... RE: Regressions problem (200 failures)


Remember this one?  I finally found time (or rather desperation :-) )
to look at it more closely.

The problem (at least in part... there may be more to it that will
show up when next I run gdb regressions, but this applies anyway) is
that the code in gcc that emits the prologue knows how to handle
the line number, but in the case of main(), and if a call to __main is 
emitted by the compiler, does not skip the call to __main, which normally
appears to be still at the line of the "{" of main.  Thus the
"end of prolouge" line number emitted by the compiler still
appears to be at the "{" rather than at the first 'real' statement.

There are lots of fixes possible: I have coded up a simple one
that simply tests to see if the next insn is a CALL_INSN to
__main, and if so, calls next_nonnote_insn(insn) again to advance
one more (real) insn.  This could also be done in gdb by having it
look for the call (but that's messier).  It could also be done
by having expand_main_function set a flag to coach the prologue
code to know it should skip this (not knowing what the optimizer
might do to this variant, I stayed away from it).

Code available as soon as I can get releases signed, but it's
easy enough to reproduce.

Donn

> -----Original Message-----
> From: Mark Mitchell [mailto:mark@codesourcery.com]
> Sent: Thursday, March 02, 2000 9:07 AM
> To: kettenis@wins.uva.nl
> Cc: Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE; kingdon@redhat.com;
> Donn Terry; gdb@sourceware.cygnus.com
> Subject: Re: Regressions problem (200 failures)
> 
> 
> >>>>> "Mark" == Mark Kettenis <kettenis@wins.uva.nl> writes:
> 
>     Mark> some bit rot since then.  Are the prologue's generated by
>     Mark> GCC any different from those generated back in 1994?
> 
> I dunno, but my guess is that's not the bug.
> 
> Right now, the problem is:
> 
>   o We put line notes in the prologue
> 
>   o We weren't putting line notes before the first real code, so
>     GCC was skipping over that too.
> 
>   o I promoted the last line note in the prologue to appear before
>     the first real code, bringing GCC back to seme-sensible behavior.
> 
> We could try to:
> 
>   o Not emit line notes in the prologue that correspond to the '{'
>     line.
>  
>   o Try to find the first line note in the real code, instead of
>     the last line note in the prologue.
> 
> The latter is probably easiest, but is still harder that what I did.
> 
> --
> Mark Mitchell                   mark@codesourcery.com
> CodeSourcery, LLC               http://www.codesourcery.com
> 

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