[PATCH] D64290: [tools] [llvm-nm] Default to reading from stdin not a.out

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 03:58:30 PDT 2019


jhenderson added a comment.

Please update the llvm-nm documentation with this change.

> No tests tested if a.out was used as a default file so no need to change any other tests, they are all passing except the one that I added!

Have you tried testing this manually? I suspect things might go wrong...



================
Comment at: llvm/test/tools/llvm-nm/warn-invalid-stdin.test:6
+
+# CHECK: llvm-nm: warning: can't read from keyboard input.
+# CHECK-NEXT: OVERVIEW: llvm symbol table dumper
----------------
abrachet wrote:
> This isn't working right now. FileCheck says the output was actually "The file was not recognized as a valid object file". Does llvm-lit redirect something to stdin?
I haven't checked, but I'd expect it to redirect something like /dev/null to stdin by default, to avoid tests hanging if they are run incorrectly. I'm not sure you're going to be able to test this properly.


================
Comment at: llvm/tools/llvm-nm/llvm-nm.cpp:1755
 static void dumpSymbolNamesFromFile(std::string &Filename) {
+  if (sys::Process::StandardInIsUserInput()) {
+    WithColor::warning(outs(), ToolName) << "can't read from keyboard input.\n";
----------------
Shouldn't this be conditional on whether we are reading from stdin?


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

https://reviews.llvm.org/D64290





More information about the llvm-commits mailing list