This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf/obj] - Improve error reporting when dumping group sections.
ClosedPublic

Authored by grimar on Nov 19 2020, 7:31 AM.

Details

Summary

Our code that dumps groups has 3 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.

Diff Detail

Event Timeline

grimar created this revision.Nov 19 2020, 7:31 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar requested review of this revision.Nov 19 2020, 7:31 AM
grimar edited the summary of this revision. (Show Details)
MaskRay accepted this revision.Nov 19 2020, 10:07 AM

Looks great!

llvm/tools/llvm-readobj/ELFDumper.cpp
173

Place in an anonymous namespace

This revision is now accepted and ready to land.Nov 19 2020, 10:07 AM
grimar marked an inline comment as done.Nov 19 2020, 10:51 PM
grimar added inline comments.
llvm/tools/llvm-readobj/ELFDumper.cpp
173

It is already here. See line 113.

This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.