diff options
| author | Alexey Lapshin <a.v.lapshin@mail.ru> | 2019-02-27 13:17:36 +0000 |
|---|---|---|
| committer | Alexey Lapshin <a.v.lapshin@mail.ru> | 2019-02-27 13:17:36 +0000 |
| commit | 77fc1f6049a7414ec193c9ff8226eeb5662a5878 (patch) | |
| tree | b2bffed96e676b25942dbe39194e0f08a153f638 /llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp | |
| parent | ef920358277603c69f4f548d2e5c40842972dd71 (diff) | |
| download | bcm5719-llvm-77fc1f6049a7414ec193c9ff8226eeb5662a5878.tar.gz bcm5719-llvm-77fc1f6049a7414ec193c9ff8226eeb5662a5878.zip | |
[DebugInfo] add SectionedAddress to DebugInfo interfaces.
That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703
"wrong line number info for obj file compiled with -ffunction-sections"
bug. The problem happened with only .o files. If object file contains
several .text sections then line number information showed incorrectly.
The reason for this is that DwarfLineTable could not detect section which
corresponds to specified address(because address is the local to the
section). And as the result it could not select proper sequence in the
line table. The fix is to pass SectionIndex with the address. So that it
would be possible to differentiate addresses from various sections. With
this fix llvm-objdump shows correct line numbers for disassembled code.
Differential review: https://reviews.llvm.org/D58194
llvm-svn: 354972
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp')
| -rw-r--r-- | llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp b/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp index 9fff1a5ec38..c54e5383248 100644 --- a/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp +++ b/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp @@ -130,8 +130,8 @@ void printIndirectCFInstructions(FileAnalysis &Analysis, std::map<unsigned, uint64_t> BlameCounter; - for (uint64_t Address : Analysis.getIndirectInstructions()) { - const auto &InstrMeta = Analysis.getInstructionOrDie(Address); + for (object::SectionedAddress Address : Analysis.getIndirectInstructions()) { + const auto &InstrMeta = Analysis.getInstructionOrDie(Address.Address); GraphResult Graph = GraphBuilder::buildFlowGraph(Analysis, Address); CFIProtectionStatus ProtectionStatus = @@ -153,7 +153,7 @@ void printIndirectCFInstructions(FileAnalysis &Analysis, auto InliningInfo = Analysis.symbolizeInlinedCode(Address); if (!InliningInfo || InliningInfo->getNumberOfFrames() == 0) { - errs() << "Failed to symbolise " << format_hex(Address, 2) + errs() << "Failed to symbolise " << format_hex(Address.Address, 2) << " with line tables from " << InputFilename << "\n"; exit(EXIT_FAILURE); } @@ -164,9 +164,9 @@ void printIndirectCFInstructions(FileAnalysis &Analysis, if (!Summarize) { for (uint32_t i = 0; i < InliningInfo->getNumberOfFrames(); ++i) { const auto &Line = InliningInfo->getFrame(i); - outs() << " " << format_hex(Address, 2) << " = " << Line.FileName - << ":" << Line.Line << ":" << Line.Column << " (" - << Line.FunctionName << ")\n"; + outs() << " " << format_hex(Address.Address, 2) << " = " + << Line.FileName << ":" << Line.Line << ":" << Line.Column + << " (" << Line.FunctionName << ")\n"; } } |

