This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: DIE chains not ending with null entry
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 09 Mar 2011 15:59:06 +0100
- Subject: Re: DIE chains not ending with null entry
On Wed, 2011-03-09 at 15:18 +0100, Petr Machata wrote:
> Alas, the case that we see here is special:
>
> Dwarf_Die die_mem, *die = dwarf_offdie (dw, 0xab, &die_mem);
> Dwarf_Die child;
> dwarf_child (die, &child); // this actually passes
>
> So libdw happily gives us a DIE that supposedly lies at 0xb1,
> interpreting the first bytes of .debug_abbrev as DIE.
>
> I might turn that combination (empty chain + no null entry) into a hard
> error in dwarflint, but that seems rather convoluted. I think this is
> something that should be fixed in libdw. I've done that, the result is
> on the branch pmachata/dwarf_child_overrun.
That makes sense to me. dwarf_child () falls off the end of the
debug_info section, so should return an error.