[all-commits] [llvm/llvm-project] ee7eaf: [llvm-objdump] --source: drop the warning when the...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Fri Feb 19 22:10:25 PST 2021
Branch: refs/heads/release/12.x
Home: https://github.com/llvm/llvm-project
Commit: ee7eaf860cde24a91a5b17390b8ad5eddd05f7f9
https://github.com/llvm/llvm-project/commit/ee7eaf860cde24a91a5b17390b8ad5eddd05f7f9
Author: Fangrui Song <i at maskray.me>
Date: 2021-02-19 (Fri, 19 Feb 2021)
Changed paths:
M llvm/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
M llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
M llvm/tools/llvm-objdump/llvm-objdump.cpp
Log Message:
-----------
[llvm-objdump] --source: drop the warning when there is no debug info
Warnings have been added for three cases (PR41905): (1) missing debug info, (2)
the source file cannot be found, (3) the debug info points at a line beyond the
end of the file.
(1) is probably less useful. This was brought up once on
http://lists.llvm.org/pipermail/llvm-dev/2020-April/141264.html and two
internal users mentioned it to me that it was annoying. (I personally
find the warning confusing, too.)
Users specify --source to get additional information if sources happen to be
available. If sources are not available, it should be obvious as the output
will have no interleaved source lines. The warning can be especially annoying
when using llvm-objdump -S on a bunch of files.
This patch drops the warning when there is no debug info.
(If LLVMSymbolizer::symbolizeCode returns an `Error`, there will still be
an error. There is currently no test for an `Error` return value.
The only code path is probably a broken symbol table, but we probably already emit a warning
in that case)
`source-interleave-prefix.test` has an inappropriate "malformed" test - the test simply has no
.debug_* because new llc does not produce debug info when the filename is empty (invalid).
I have tried tampering the header of .debug_info/.debug_line but llvm-symbolizer does not warn.
This patch does not intend to add the missing test coverage.
Differential Revision: https://reviews.llvm.org/D88715
(cherry picked from commit eecbb1c77655d38c06e47cf32e2dcc72da45c517)
More information about the All-commits
mailing list