addr2line: swap if conditions for diff reduction in upcoming change
No functional change intended.
This commit is contained in:
parent
f9fe7b28bc
commit
65c207758a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367853
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user