HomePhabricator

[llvm-readobj] Reapply: Improve error message for --string-dump

Authored by StephenTozer on Apr 15 2019, 4:17 AM.

Description

[llvm-readobj] Reapply: Improve error message for --string-dump

This is a resubmission of a previous patch that caused test failures,
with the fixes for the relevant tests included.

Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630

This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.

llvm-svn: 358395

Details

Committed
StephenTozerApr 15 2019, 4:17 AM
Parents
rGcdf126ebec18: [COFF] Link crtend.o as the last object file
Branches
Unknown
Tags
Unknown