This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Improve error messages on invalid binaries
ClosedPublic

Authored by sbc100 on May 8 2017, 4:41 PM.

Details

Summary

The previous code was discarding the error message from
createBinary() by calling errorToErrorCode().
This meant that such error were always reported unhelpful
as "Invalid data was encountered while parsing the file".

Other tools such as llvm-objdump already produce a more
useful error message in this case.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.May 8 2017, 4:41 PM
sbc100 retitled this revision from Improve error messages from llvm-readobj to [llvm-readobj] Improve error messages on invalid binaries.May 8 2017, 4:43 PM
lhames accepted this revision.May 9 2017, 5:18 PM

Looks good to me. Thanks Sam!

This revision is now accepted and ready to land.May 9 2017, 5:18 PM
sbc100 edited the summary of this revision. (Show Details)May 9 2017, 5:19 PM
This revision was automatically updated to reflect the committed changes.