[PATCH] D104613: [llvm-readobj][XCOFF] Add support for printing the String Table.

EsmeYi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 03:04:10 PDT 2021


Esme added inline comments.


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:463-464
+  Expected<DenseMap<uint64_t, StringRef>> StrTableOrErr = Obj.getStringTable();
+  if (!StrTableOrErr)
+    reportUniqueWarning("unable to get the string table: " +
+                        toString(StrTableOrErr.takeError()));
----------------
jhenderson wrote:
> You need to add a test case that will exercise this warning. You also need to return after the warning, or you'll attempt to print the table contents when you don't have a valid map!
Well, I'm unable to construct a lit test to exercise this warning. The warning occurs only if the function XCOFFObjectFile::getStringTableEntry(uint32_t Offset) returns an error. I don't think this should happen unless yaml2obj writes the wrong data for symbol name offset or the string table.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104613



More information about the llvm-commits mailing list