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

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 14:29:23 PST 2017


> 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. 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.

Greg

> On Mon, Jan 9, 2017 at 2:21 PM Greg Clayton via Phabricator <reviews at reviews.llvm.org <mailto: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 <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/f8bb0c4b/attachment.html>


More information about the llvm-commits mailing list