mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
DWARF: Reset the state after parsing a line table prologue and remove an unnecessary lookup.
llvm-svn: 139859
This commit is contained in:
parent
b9ba7e59b7
commit
e98b6ec93c
@ -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)
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user