This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: Some dwarf "nitpicks"
- From: Petr Machata <pmachata at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 09 Mar 2011 15:58:12 +0100
- Subject: Re: Some dwarf "nitpicks"
Mark Wielaard <mjw@redhat.com> writes:
> On Mon, 2011-03-07 at 09:56 -0800, Roland McGrath wrote:
>> This produces a zero-length .debug_line section but a CU with a
>> DW_AT_stmt_list attribute pointing to its start. That is invalid
>> DWARF and hence a GCC bug. The place where DW_AT_stmt_list points
>> must have a valid line information header, even if that says it's an
>> empty table. I think what would be most correct here is to omit the
>> DW_AT_stmt_list attribute entirely from that CU DIE.
>
> Actually, the header is there, but there are no tables.
> Reported with possible patch:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48045
>
> But since the debug_line table header is actually there, dwarflint is
> still not really happy. empty.o as produced by my patched gcc attached.
>
> $ eu-dwarflint empty.o
> warning: .debug_line: table 0: the file #1 `empty.c' is not used.
> error: .debug_line: table 0: sequence of opcodes not terminated with
> DW_LNE_end_sequence.
>
> So maybe a better solution would be to just add a dummy end_sequence.
Well, missing DW_LNE_end_sequence is quite common, as I recall. Chances
are they are all cases of empty table with no opcodes whatsoever.
Perhaps I might supress the error for these cases.
PM