This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]