addr2line: swap if conditions for diff reduction in upcoming change

No functional change intended.
This commit is contained in:
Ed Maste 2020-11-19 21:10:36 +00:00
parent f9fe7b28bc
commit 65c207758a

View File

@ -436,30 +436,7 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsigned addr,
in_range = false;
ret = dwarf_attrval_unsigned(die, DW_AT_ranges, &ranges_off, &de);
if (ret == DW_DLV_NO_ENTRY) {
if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) ==
DW_DLV_OK) {
if (lopc == curlopc)
return (DW_DLV_ERROR);
if (dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc,
&de) == DW_DLV_OK) {
/*
* Check if the address falls into the PC
* range of this CU.
*/
if (handle_high_pc(die, lopc, &hipc) !=
DW_DLV_OK)
return (DW_DLV_ERROR);
} else {
/* Assume ~0ULL if DW_AT_high_pc not present */
hipc = ~0ULL;
}
if (addr >= lopc && addr < hipc) {
in_range = true;
}
}
} else if (ret == DW_DLV_OK) {
if (ret == DW_DLV_OK) {
ret = dwarf_get_ranges(dbg, ranges_off, &ranges,
&ranges_cnt, NULL, &de);
if (ret != DW_DLV_OK)
@ -490,6 +467,29 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsigned addr,
break;
}
}
} else if (ret == DW_DLV_NO_ENTRY) {
if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) ==
DW_DLV_OK) {
if (lopc == curlopc)
return (DW_DLV_ERROR);
if (dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc,
&de) == DW_DLV_OK) {
/*
* Check if the address falls into the PC
* range of this CU.
*/
if (handle_high_pc(die, lopc, &hipc) !=
DW_DLV_OK)
return (DW_DLV_ERROR);
} else {
/* Assume ~0ULL if DW_AT_high_pc not present */
hipc = ~0ULL;
}
if (addr >= lopc && addr < hipc) {
in_range = true;
}
}
} else {
return (DW_DLV_ERROR);
}