[PATCH] D28386: Add the ability to iterate across all attributes in a DIE.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 14:41:04 PST 2017


On Mon, Jan 9, 2017 at 2:29 PM Greg Clayton <clayborg at gmail.com> wrote:

> On Jan 9, 2017, at 2:23 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> I'm not sure optional error handling's ideal - seems errors should always
> be handled (which is the strong premise behind Lang's work introducing
> llvm::Error).
>
>
> What is a DWARF parser during a debug session gonna do with any of these
> errors? Emit them in the console? If we have borked DWARF we can’t just
> emit every error we come across, the user will not like that.
>

Quite possibly, yes. That seems to be what LLDB does already for DWARF it
can't handle - and I imagine not reading any attributes would start to look
like "not handling" to a user when things show up without names, address
ranges, or any other functionality?


> If we add error handling, I don’t really plan on integrating it into the
> LLDB parser, but you seemed to want this so I added it. I personally don’t
> think it is useful.
>

What should LLDB do when it encounters broken input? What does it do when
it encounters input it can't parse today?


>
> Greg
>
> On Mon, Jan 9, 2017 at 2:21 PM Greg Clayton via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
> clayborg updated this revision to Diff 83698.
> clayborg added a comment.
>
> Added optional error handling to the attributes iterators. You can now
> pass an "llvm::Error *" to the attributes():
>
>   attribute_iterator DWARFDie::attributes(llvm::Error *Err);
>
> If the error is non-NULL, then the error will be filled in. This iteration
> error is the same method used in Archive.h/Archive.cpp after I spoke with
> Lang Hames.
>
>
> https://reviews.llvm.org/D28386
>
> Files:
>   include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
>   include/llvm/DebugInfo/DWARF/DWARFAttribute.h
>   include/llvm/DebugInfo/DWARF/DWARFDie.h
>   lib/DebugInfo/DWARF/DWARFDie.cpp
>   unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170109/bc8e242d/attachment.html>


More information about the llvm-commits mailing list