This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: <dwarf>: iteration over attributes swallows the last one
- From: Roland McGrath <roland at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 25 Mar 2009 12:10:04 -0700
- Subject: Re: <dwarf>: iteration over attributes swallows the last one
> The changes that you requested, and the testcase, are on pmachata/dwarf.
Thanks.
@@ -637,7 +637,7 @@ namespace elfutils
inline attribute operator* () const
{
- if (unlikely (_m_offset == 1))
+ if (unlikely (_m_offset == 1 && _m_attr.valp == NULL))
throw std::runtime_error ("dereferencing end iterator");
return attribute (_m_die, _m_attr);
}
We don't really need the _m_offset check here, do we?
Why do we need the new dwarf-attributes test program instead of testing the
expected output of dwarf-print? I guess its output is kind of long on any
nontrivial file. Perhaps just tweak dwarf-print with an optional less
verbose mode rather than cut&paste most of it?
Thanks,
Roland