[PATCH] D100583: [llvm-objdump] Add an llvm-otool tool

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 06:41:19 PDT 2021


jhenderson added a comment.

In D100583#2695541 <https://reviews.llvm.org/D100583#2695541>, @thakis wrote:

> 1. llvm-objdump is "philosophically" LLVM's user-facing tool, while readobj is more internal tool for use by tests. otool is user-facing.

FWIW, I don't think this difference is a true difference anymore, at least for the ELF aspects (I can't say one way or the other for other formats) - llvm-readelf is now used in production systems outside of LLVM, and should be a drop-in replacement for GNU readelf, so I think it is just as user-facing as llvm-objdump these days. In fact, when someone asks which tool to use, I usually point them at llvm-readelf over llvm-objdump for various reasons. That being said, I think your other points are perfectly valid.



================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:2999-3003
+    // We need to recognize the following filenames:
+    //
+    // llvm-objdump -> objdump
+    // llvm-otool-10.exe -> otool
+    // powerpc64-unknown-freebsd13-objdump -> objdump
----------------
This needs testing. It's been a thing we've broken on more than one occasion in llvm-objcopy too.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:104
+    // TODO Replace this with OptTable API once it adds extrahelp support.
+    outs() << "\nPass @FILE as argument to read options from FILE.\n";
+  }
----------------
thakis wrote:
> MaskRay wrote:
> > I know the messages are not super consistent in the tool, but https://llvm.org/docs/CodingStandards.html#error-and-warning-messages Usually we don't have a period and don't capitalize.
> We're somewhat consistent about this particular string: `% grep -Ri 'Pass @FILE as argument to read options from FILE' llvm/tools` :)
> 
> (Also, it's just moving around in this change.)
FWIW, I don't think the error/warning message styling applies here, as this is in the help text.


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

https://reviews.llvm.org/D100583



More information about the llvm-commits mailing list