[PATCH] D91798: [llvm-readelf/obj] - Improve error reporting when dumping group sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 07:31:45 PST 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar requested review of this revision.

Our code that dumps groups has 2 noticeable issues:

1. It uses `unwrapOrError` in many places.
2. It doesn't allow reporting unique warnings, because the `getGroups` helper is not a member of `DumpStyle<ELFT>`.
3. It might just crash. See the comment for `StrTableOrErr->data() + Sym.st_name` line.

In this patch I am starting addressing these points.
For start I've converted one of `unwrapOrError` calls to a unique warning.


https://reviews.llvm.org/D91798

Files:
  llvm/test/tools/llvm-readobj/ELF/groups.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91798.306410.patch
Type: text/x-patch
Size: 6842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201119/b86306df/attachment.bin>


More information about the llvm-commits mailing list