diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp index 90c4d01188..8493317b4f 100644 --- a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp +++ b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp @@ -351,10 +351,8 @@ DwarfImageDebugInfo::GetFunctions(const BObjectList& symbols, if (rangeList == NULL) { target_addr_t lowPC = subprogramEntry->LowPC(); target_addr_t highPC = subprogramEntry->HighPC(); - if (lowPC == highPC) + if (highPC <= lowPC) continue; - else if (highPC < lowPC) - highPC += lowPC; rangeList = new(std::nothrow) TargetAddressRangeList( TargetAddressRange(lowPC, highPC - lowPC)); diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index 17154bb9b0..34ac9d47cf 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -115,6 +115,9 @@ DIECompileUnitBase::AddAttribute_high_pc(uint16 attributeName, const AttributeValue& value) { fHighPC = value.address; + if (fLowPC != 0 && fHighPC < fLowPC) + fHighPC += fLowPC; + return B_OK; } @@ -999,6 +1002,9 @@ DIELexicalBlock::AddAttribute_high_pc(uint16 attributeName, const AttributeValue& value) { fHighPC = value.address; + if (fLowPC != 0 && fHighPC < fLowPC) + fHighPC += fLowPC; + return B_OK; } @@ -1948,6 +1954,9 @@ DIESubprogram::AddAttribute_high_pc(uint16 attributeName, const AttributeValue& value) { fHighPC = value.address; + if (fLowPC != 0 && fHighPC < fLowPC) + fHighPC += fLowPC; + return B_OK; }