OSDN Git Service

Recommit r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF target."
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 15 Jul 2019 11:53:39 +0000 (11:53 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 15 Jul 2019 11:53:39 +0000 (11:53 +0000)
commit70b7545abcf87d13445337540a6b4b3dae9a569c
tree9a376e5f0c367abbba4d100f08feb9d7744c0d4e
parentda0d3e17551d507ec8149bda60b6fc538bb72d6b
Recommit r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF target."

No changes, LLD code was updated in r366057.

Original commit message:

ELF.h contains two getSymbol methods
which seems to be used only from obj2yaml.

One of these methods calls another, which in turn
contains untested error message which doesn't
provide enough information.

Problem is that after improving only just that message,
obj2yaml will not show it,
("Error reading file: yaml: Invalid data was
encountered while parsing the file" message will be shown instead),
because internal errors handling of tool is based on ErrorOr<> class which
stores a error code and as a result can only show a predefined error string, what
actually isn't very useful.

In this patch, I rework obj2yaml's error reporting system
for ELF targets to use Error  Expected<> classes.
Also, I improve the error message produced
by getSymbol for demonstration of the new functionality.

Differential revision: https://reviews.llvm.org/D64631

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366058 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/ELF.h
test/tools/obj2yaml/section-group.test
test/tools/obj2yaml/special-symbol-indices.yaml
tools/obj2yaml/elf2yaml.cpp
tools/obj2yaml/obj2yaml.cpp
tools/obj2yaml/obj2yaml.h