This is the mail archive of the
mailing list for the binutils project.
Re: allow gas to emit duplicate line numbers
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: geoffk at redhat dot com, msnyder at redhat dot com
- Cc: binutils at sources dot redhat dot com
- Date: 13 Apr 2002 07:26:44 +0100
- Subject: Re: allow gas to emit duplicate line numbers
- References: <200204121941.g3CJfQ014640@pride.sfbay.redhat.com>
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
> 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 <firstname.lastname@example.org>
* 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 ?
> 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)
> - /* 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;