Currently we report
${argv[0]}: error: ...GNU objdump does not print error:
${argv[0]}: ...error: is useful, but repeating argv[0] does not provide lots of value. So switch to:
error: ...
This is also consistent with llvm-objcopy and llvm-readobj.
Paths
| Differential D66414
[llvm-objdump] Delete argv[0] from error messages AbandonedPublic Authored by MaskRay on Aug 19 2019, 5:38 AM.
Details Summary Currently we report ${argv[0]}: error: ...GNU objdump does not print error: ${argv[0]}: ...error: is useful, but repeating argv[0] does not provide lots of value. So switch to: error: ... This is also consistent with llvm-objcopy and llvm-readobj.
Diff Detail
Event TimelineComment Actions I don't feel strongly about this, but it would be a departure from what GNU tools and clang and LLD, and even MSVC do, so we probably shouldn't do this. The exact behaviour appears to be somewhat inconsistent, but in most cases, GNU tools do: <argv[0]>: <error message> Clang and LLD do: <tool name>: error: <error message> I'd therefore suggest that perhaps the correct thing to do is change llvm-objcopy and llvm-readobj. I guess one advantage with the tool name being printed is that it gives a bit more context in a big long build log, if there are multiple problems, it's possible to tell which error/warning comes from which tool, especially as buffering and multi-threaded builds might result in the error message being rather far from related output. MSVC appears to do: <tool name> : <error/warning type> <error code> : <error message> Comment Actions
Created D66425 to prepend argv[0] for llvm-readobj/llvm-readelf. llvm-objcopy already includes argv[0] in its error messages. Comment Actions I feel a little more strongly that we need to have the toolname printed as part of the error message. This revision now requires changes to proceed.Aug 19 2019, 10:31 AM
Revision Contents
Diff 215864 tools/llvm-objdump/llvm-objdump.cpp
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||