[PATCH] D91867: [llvm-readobj] - Stop using `unwrapOrError` in `DumpStyle<ELFT>::getGroups()`

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 00:21:09 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/groups.test:135
+## Check what we do when we are unable to dump the signature symbol name.
+## In this case the index of the string table section, linked to group sections, is broken (section does not exist).
+## Check we report a warning in this case. Check we don't print the same warning message twice.
----------------
The string table isn't directly linked to a group section, so I found the origianl message slightly confusing.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/groups.test:186
+## In the first case we link the group section to the section with index 255, which does not exist.
+## We check that the warning is reported when we are unable to locate the symbol table.
+## In the second case we link the SHT_GROUP section to itself. This documents that we don't check the
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/groups.test:282
+
+## Check that we a warning when we are unable to read the group section name or the name of a member.
+
----------------



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3572
+template <class ELFT>
+static StringRef getSectionNameForError(const ELFFile<ELFT> &Obj,
+                                        const typename ELFT::Shdr &Sec,
----------------
I don't like this function name. It implies it is solely for use by errors, which isn't the case. How about `getSectionNameOrFallback`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91867/new/

https://reviews.llvm.org/D91867



More information about the llvm-commits mailing list