From owner-svn-src-head@freebsd.org Thu Nov 19 21:10:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1487E474F9C; Thu, 19 Nov 2020 21:10:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CcXQP07R6z3Q7W; Thu, 19 Nov 2020 21:10:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB6C626D9; Thu, 19 Nov 2020 21:10:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AJLAaLE052504; Thu, 19 Nov 2020 21:10:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AJLAaa0052503; Thu, 19 Nov 2020 21:10:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011192110.0AJLAaa0052503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Nov 2020 21:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367853 - head/contrib/elftoolchain/addr2line X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/addr2line X-SVN-Commit-Revision: 367853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2020 21:10:37 -0000 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 {