allow gas to emit duplicate line numbers
Michael Snyder
msnyder@redhat.com
Tue Apr 16 14:10:00 GMT 2002
Nick Clifton wrote:
>
> Hi Geoff, Hi Michael,
>
> > GDB uses duplicate line numbers to detect the end of the prologue.
> > GCC would carefully emit them... and gas was stripping them out.
> >
> > I don't believe this patch will significantly affect the size of the
> > debug info for assembler source, because having multiple instructions
> > on a line is rare.
> >
> > I tested this by running the GAS and GDB testsuites on
> > powerpc-eabisim.
> >
> > OK to commit?
>
> Hmm, well the test was deliberately added by Michael Snyder. I
> wonder if he had a specific reason ?
>
> 2001-11-16 Michael Snyder <msnyder@redhat.com>
>
> * stabs.c (stabs_generate_asm_lineno): Remember file and line number
> from one call to the next, and eliminate consecutive duplicates
> (thereby emitting only one line symbol per source line).
> * dwarf2dbg.c (dwarf2_gen_line_info): Ditto.
>
> I think that at the very least rather than just eliminating the test
> you should replace it with a comment explaining why duplicate line
> number entries are allowed, and possibly even add code to limit the
> number of duplicates to 2, in case there are situations where many
> duplicate entries are being generated. Also shouldn't a similar patch
> be applied to stabs.c ?
I endorse Geoff's second, modified patch.
Michael
>
> Cheers
> Nick
>
> > Index: dwarf2dbg.c
> > ===================================================================
> > RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
> > retrieving revision 1.44
> > diff -p -u -p -r1.44 dwarf2dbg.c
> > --- dwarf2dbg.c 4 Dec 2001 23:07:26 -0000 1.44
> > +++ dwarf2dbg.c 12 Apr 2002 19:31:05 -0000
> > @@ -237,10 +237,6 @@ dwarf2_gen_line_info (ofs, loc)
> > if (loc->filenum == 0 || loc->line == 0)
> > return;
> >
> > - /* Don't emit sequences of line symbols for the same line. */
> > - if (line == loc->line && filenum == loc->filenum)
> > - return;
> > -
> > line = loc->line;
> > filenum = loc->filenum;
> >
> > ============================================================
More information about the Binutils
mailing list