public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* curious check in dwarf2_gen_line_info()
@ 2004-12-29 10:06 David Mosberger
  2004-12-29 18:32 ` Geoff Keating
  0 siblings, 1 reply; 7+ messages in thread
From: David Mosberger @ 2004-12-29 10:06 UTC (permalink / raw)
  To: geoffk; +Cc: binutils, davidm

[Resend^2: I mistakenly typed .com instead of .org for his domain... ;-( ]

In dwarf2dbg.c:dwarf2_gen_line_info(), one finds this curious code and
comment:

  /* Don't emit sequences of line symbols for the same line when the
     symbols apply to assembler code.  It is necessary to emit
     duplicate line symbols when a compiler asks for them, because GDB
     uses them to determine the end of the prologue.  */
  if (debug_type == DEBUG_DWARF2
        && line == loc->line && filenum == loc->filenum)
    return;

The "debug_type == DEBUG_DWARF2" checks has the effect that for
compiler-generated files, the line info is replicated for each
instruction, even when that info doesn't change at all.

The change seems to have been introduced back in 2002:

  2002-04-17  Geoffrey Keating  <geoffk@redhat.com>
        * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line
        numbers, gdb relies on them to detect the start of the prologue.

but there is no hint on which platform needed this workaround.

I looked at gdb's symtab.c:skip_prologue_using_sal() and as near as I
can tell, that doesn't rely on having duplicate line-info.

To evaluate the size impact of the line-info duplication, I compiled a
fairly large Linux kernel file (sched.c).  For that file, the
.debug_line size changed as follows:

	original gas:	0x3b93 (+46%)
	fixed gas:	0x28cd

So the workaround bloats the .debug_line section by almost 50%.

Is there a platform which really needs this workaround?  If so,
perhaps the workaround could be enabled for that platform only?

Thanks,

	--david

^ permalink raw reply	[flat|nested] 7+ messages in thread
* curious check in dwarf2_gen_line_info()
@ 2004-12-29 10:02 David Mosberger
  0 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2004-12-29 10:02 UTC (permalink / raw)
  To: geoffk; +Cc: binutils, davidm

[Resend with Geoff's email-address corrected; I hope...]

In dwarf2dbg.c:dwarf2_gen_line_info(), one finds this curious code and
comment:

  /* Don't emit sequences of line symbols for the same line when the
     symbols apply to assembler code.  It is necessary to emit
     duplicate line symbols when a compiler asks for them, because GDB
     uses them to determine the end of the prologue.  */
  if (debug_type == DEBUG_DWARF2
        && line == loc->line && filenum == loc->filenum)
    return;

The "debug_type == DEBUG_DWARF2" checks has the effect that for
compiler-generated files, the line info is replicated for each
instruction, even when that info doesn't change at all.

The change seems to have been introduced back in 2002:

  2002-04-17  Geoffrey Keating  <geoffk@redhat.com>
        * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line
        numbers, gdb relies on them to detect the start of the prologue.

but there is no hint on which platform needed this workaround.

I looked at gdb's symtab.c:skip_prologue_using_sal() and as near as I
can tell, that doesn't rely on having duplicate line-info.

To evaluate the size impact of the line-info duplication, I compiled a
fairly large Linux kernel file (sched.c).  For that file, the
.debug_line size changed as follows:

	original gas:	0x3b93 (+46%)
	fixed gas:	0x28cd

So the workaround bloats the .debug_line section by almost 50%.

Is there a platform which really needs this workaround?  If so,
perhaps the workaround could be enabled for that platform only?

Thanks,

	--david

^ permalink raw reply	[flat|nested] 7+ messages in thread
* curious check in dwarf2_gen_line_info()
@ 2004-12-29 10:00 David Mosberger
  0 siblings, 0 replies; 7+ messages in thread
From: David Mosberger @ 2004-12-29 10:00 UTC (permalink / raw)
  To: geoffk; +Cc: binutils

In dwarf2dbg.c:dwarf2_gen_line_info(), one finds this curious code and
comment:

  /* Don't emit sequences of line symbols for the same line when the
     symbols apply to assembler code.  It is necessary to emit
     duplicate line symbols when a compiler asks for them, because GDB
     uses them to determine the end of the prologue.  */
  if (debug_type == DEBUG_DWARF2
        && line == loc->line && filenum == loc->filenum)
    return;

The "debug_type == DEBUG_DWARF2" checks has the effect that for
compiler-generated files, the line info is replicated for each
instruction, even when that info doesn't change at all.

The change seems to have been introduced back in 2002:

  2002-04-17  Geoffrey Keating  <geoffk@redhat.com>
        * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line
        numbers, gdb relies on them to detect the start of the prologue.

but there is no hint on which platform needed this workaround.

I looked at gdb's symtab.c:skip_prologue_using_sal() and as near as I
can tell, that doesn't rely on having duplicate line-info.

To evaluate the size impact of the line-info duplication, I compiled a
fairly large Linux kernel file (sched.c).  For that file, the
.debug_line size changed as follows:

	original gas:	0x3b93 (+46%)
	fixed gas:	0x28cd

So the workaround bloats the .debug_line section by almost 50%.

Is there a platform which really needs this workaround?  If so,
perhaps the workaround could be enabled for that platform only?

Thanks,

	--david

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-31  2:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-29 10:06 curious check in dwarf2_gen_line_info() David Mosberger
2004-12-29 18:32 ` Geoff Keating
2004-12-29 18:51   ` David Mosberger
2004-12-29 19:01     ` Daniel Jacobowitz
2004-12-31  2:16       ` David Mosberger
  -- strict thread matches above, loose matches on Subject: below --
2004-12-29 10:02 David Mosberger
2004-12-29 10:00 David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).