diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 21:59:13 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 21:59:13 +0000 |
commit | 112ec17e1b536cf292e168696b3ebcd173e249f3 (patch) | |
tree | 691ae58e197679c8a7f7b3134414a00f67c2fdb6 /llvm/lib/DebugInfo | |
parent | 0be3ede9e1172fac7ff9fe5d7966d1bd30f14dba (diff) | |
download | bcm5719-llvm-112ec17e1b536cf292e168696b3ebcd173e249f3.tar.gz bcm5719-llvm-112ec17e1b536cf292e168696b3ebcd173e249f3.zip |
DWARF: Reset the state after parsing a line table prologue and remove an unnecessary lookup.
llvm-svn: 139859
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugAranges.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugLine.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index 4fc0b301bef..e1ac398b101 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -141,10 +141,8 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForOffset(uint32_t offset) { } DILineInfo DWARFContext::getLineInfoForAddress(uint64_t address) { - // First, get the index for the arange. - uint32_t arangeIndex = getDebugAranges()->findAddress(address); - // From there, get the offset of the compile unit. - uint32_t cuOffset = getDebugAranges()->offsetAtIndex(arangeIndex); + // First, get the offset of the compile unit. + uint32_t cuOffset = getDebugAranges()->findAddress(address); // Retrieve the compile unit. DWARFCompileUnit *cu = getCompileUnitForOffset(cuOffset); if (!cu) diff --git a/llvm/lib/DebugInfo/DWARFDebugAranges.cpp b/llvm/lib/DebugInfo/DWARFDebugAranges.cpp index 5053e19b71c..576d37d7813 100644 --- a/llvm/lib/DebugInfo/DWARFDebugAranges.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugAranges.cpp @@ -100,7 +100,7 @@ void DWARFDebugAranges::dump(raw_ostream &OS) const { const uint32_t num_ranges = getNumRanges(); for (uint32_t i = 0; i < num_ranges; ++i) { const Range &range = Aranges[i]; - OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)", range.Offset, + OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)\n", range.Offset, (uint64_t)range.LoPC, (uint64_t)range.HiPC()); } } diff --git a/llvm/lib/DebugInfo/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARFDebugLine.cpp index 94fff6533e4..d8200a0fd6b 100644 --- a/llvm/lib/DebugInfo/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugLine.cpp @@ -200,6 +200,8 @@ DWARFDebugLine::parseStatementTable(DataExtractor debug_line_data, const uint32_t end_offset = debug_line_offset + prologue->TotalLength + sizeof(prologue->TotalLength); + state.reset(); + while (*offset_ptr < end_offset) { uint8_t opcode = debug_line_data.getU8(offset_ptr); |