Author: emaste
Date: Thu Nov 19 21:10:36 2020
New Revision: 367853
URL: https://svnweb.freebsd.org/changeset/base/367853

Log:
  addr2line: swap if conditions for diff reduction in upcoming change
  
  No functional change intended.

Modified:
  head/contrib/elftoolchain/addr2line/addr2line.c

Modified: head/contrib/elftoolchain/addr2line/addr2line.c
==============================================================================
--- head/contrib/elftoolchain/addr2line/addr2line.c     Thu Nov 19 19:25:47 
2020        (r367852)
+++ head/contrib/elftoolchain/addr2line/addr2line.c     Thu Nov 19 21:10:36 
2020        (r367853)
@@ -436,30 +436,7 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsi
        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)
@@ -488,6 +465,29 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsi
                        if (addr >= lopc && addr < hipc){
                                in_range = true;
                                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 {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to