aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-11-19 21:10:36 +0000
committerEd Maste <emaste@FreeBSD.org>2020-11-19 21:10:36 +0000
commit65c207758a9586116a023dea8eb3d173e85cb0a9 (patch)
tree9f45614a5be3271113821871104e820d09c1f826 /contrib
parentf9fe7b28bc236c18794de577620348ccd3b0fdaa (diff)
Notes
Diffstat (limited to 'contrib')
-rw-r--r--contrib/elftoolchain/addr2line/addr2line.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/elftoolchain/addr2line/addr2line.c b/contrib/elftoolchain/addr2line/addr2line.c
index 7cd3cfb674fd..1a2d26051ff0 100644
--- a/contrib/elftoolchain/addr2line/addr2line.c
+++ b/contrib/elftoolchain/addr2line/addr2line.c
@@ -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);
}