diff options
author | Wolfgang Pieb <Wolfgang.Pieb@sony.com> | 2018-05-10 20:02:34 +0000 |
---|---|---|
committer | Wolfgang Pieb <Wolfgang.Pieb@sony.com> | 2018-05-10 20:02:34 +0000 |
commit | f2b6915ed46ebfc28f450b0fa0027b6666ebcb11 (patch) | |
tree | 15487910ebf87f90c4735bd81506c8d3f1aca116 /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | |
parent | f489e2bfef7fca1959ad7e5cb223edc13cc1bc18 (diff) | |
download | bcm5719-llvm-f2b6915ed46ebfc28f450b0fa0027b6666ebcb11.tar.gz bcm5719-llvm-f2b6915ed46ebfc28f450b0fa0027b6666ebcb11.zip |
[DWARF] Fixing a bug in DWARF v5 string offsets tables where the length encoded the contribution
length excluding the table header. Instead it must encode the contribution length minus the length
field itself.
Reviewer: JDevliegehere
Differential Revision: https://reviews.llvm.org/D45922
llvm-svn: 332030
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 6fbe55bbdc7..8488fe8ced7 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -172,7 +172,11 @@ static void dumpDWARFv5StringOffsetsSection( OS << (ContributionHeader - Offset) << "\n"; } OS << format("0x%8.8x: ", (uint32_t)ContributionHeader); - OS << "Contribution size = " << Contribution->Size + // In DWARF v5 the contribution size in the descriptor does not equal + // the originally encoded length (it does not contain the length of the + // version field and the padding, a total of 4 bytes). Add them back in + // for reporting. + OS << "Contribution size = " << (Contribution->Size + (Version < 5 ? 0 : 4)) << ", Format = " << (Format == DWARF32 ? "DWARF32" : "DWARF64") << ", Version = " << Version << "\n"; |