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: Rerequesting dwarf_tag on a die with invalid abbrev code


On Wed, 2011-03-16 at 14:27 -0700, Roland McGrath wrote:
> > <pedantic> The comment and the return inside the while loop was
> > confusing me at first. It would maybe be slightly easier on the reader
> > to replace the "return DWARF_END_ABBREV;" with a "break;", so that your
> > "at the end already" logic triggers always instead of only on the second
> > (or third, etc.) call. </pedantic>
> 
> I'm looking at
> http://git.fedorahosted.org/git/?p=elfutils.git;a=commitdiff;h=bd1d16c3a17c227d1379df10e97f6c7865ad1440
> and I can't see what you're referring to.  
> Are we talking about the same change?

Yes.

My confusion was about the comment "second (or third, etc.) call". It
took me a while to understand that above that change, there is a while
loop which on the first call intercepts the abb == NULL itself and
returns a value, but on subsequent calls, when last_abbrev_offset == -1,
it drops out of the loop, and so then this logic triggers. Like I said,
pedantic...


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