Add more error checking to llvm-objdump and MachODump

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 14:28:21 PST 2015


Hi Rafael

This is the start of error handling when we encounter errors in __eh_frame parsing.

I add a bool return to printMachOEHFrameSection which returns true if we printed an error.  This is then propagated all the way up the call stack to main().

I think returning a bool makes more sense that report_fatal_error as upon getting an error, we want to continue to dump other sections, and even other eh_frame entries.  I do check this error and ensure we return 1 from main though.

I also started to change some of the asserts in printMachOEHFrameSection to 'errs() << …’ and setting the error code to true.  I’ll finish up that method and add suitable tests in another commit.

Thanks,
Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: errors.diff
Type: application/octet-stream
Size: 18210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151214/e2b1ff6b/attachment.obj>


More information about the llvm-commits mailing list