[PATCH] D88715: [llvm-objdump] --source: drop the warning when there is no debug info
Jordan Rupprecht via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 10:15:26 PDT 2020
rupprecht added inline comments.
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1018
+ } else {
+ // TODO Untested.
+ reportWarning("failed to parse debug information for " + ObjectFilename +
----------------
It would be good to figure out a test case for this
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1019-1021
+ reportWarning("failed to parse debug information for " + ObjectFilename +
+ ": " + toString(ExpectedLineInfo.takeError()),
+ ObjectFilename);
----------------
`ObjectFilename` is in the warning twice now. It can be omitted from the error message string; passing it as the second arg should make it print something like: `warn: ObjectFilename: failed to parse debug information`
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1024-1030
- if (!WarnedNoDebugInfo) {
- std::string Warning =
- "failed to parse debug information for " + ObjectFilename.str();
- if (!ErrorMessage.empty())
- Warning += ": " + ErrorMessage;
- reportWarning(Warning, ObjectFilename);
- WarnedNoDebugInfo = true;
----------------
Dropping the `WarnedNoDebugInfo` bool means this will generate an arbitrary amount of warnings instead of just 1. I'm not sure if this is a good thing or not; on one hand, it'd be nice to know all the issues instead of tackling them one by one; on the other hand, it's not really objdump's job to report all the invalid bits of debug info; we should have a different tool for that (I'd rather run `llvm-dwarfdump --verify`)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88715/new/
https://reviews.llvm.org/D88715
More information about the llvm-commits
mailing list