From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway21.websitewelcome.com (gateway21.websitewelcome.com [192.185.46.113]) by sourceware.org (Postfix) with ESMTPS id 5E09A387703A for ; Sat, 28 Mar 2020 19:22:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E09A387703A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id E909E400C6E91 for ; Sat, 28 Mar 2020 14:22:10 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id IH22joCMG8vkBIH22jdfeZ; Sat, 28 Mar 2020 14:22:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lMdR9RBILEZd+V2fK5xzA4HQICr0BGM50DyruMNrneM=; b=TCpcs6a116BkYWXF2vMgV9jZSz 1zwetFAJdJ0jcmpLnxG44wc2RiKgfzJEQi/H01BH8VOTfUzjkGk0Mnv61IUlv4anvC3Xfak3gCSKq qEE2ptCTy9r9AmCQoWlzZWiQ5; Received: from 97-118-117-21.hlrn.qwest.net ([97.118.117.21]:55190 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jIH22-003oZR-NY; Sat, 28 Mar 2020 13:22:10 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 03/20] Avoid using DW_* macros in dwarf2/attribute.c Date: Sat, 28 Mar 2020 13:21:51 -0600 Message-Id: <20200328192208.11324-4-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200328192208.11324-1-tom@tromey.com> References: <20200328192208.11324-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.117.21 X-Source-L: No X-Exim-ID: 1jIH22-003oZR-NY X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-117-21.hlrn.qwest.net (bapiya.Home) [97.118.117.21]:55190 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-21.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2020 19:22:12 -0000 There's no need to use the DW_* accessor macros in dwarf2/attribute.c, and this is a necessary step toward our goal of removing them entirely. gdb/ChangeLog 2020-03-28 Tom Tromey * dwarf2/attribute.c (attribute::address): Don't use DW_UNSND or DW_ADDR. (attribute::string): Don't use DW_STRING. (attribute::get_ref_die_offset): Don't use DW_UNSND. (attribute::constant_value): Don't use DW_UNSND or DW_SND. --- gdb/ChangeLog | 8 ++++++++ gdb/dwarf2/attribute.c | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gdb/dwarf2/attribute.c b/gdb/dwarf2/attribute.c index 1bdd4cf7abb..634b7979143 100644 --- a/gdb/dwarf2/attribute.c +++ b/gdb/dwarf2/attribute.c @@ -51,10 +51,10 @@ attribute::address () const as well as update callers to pass in at least the CU's DWARF version. This is more overhead than what we're willing to expand for a pretty rare case. */ - addr = DW_UNSND (this); + addr = u.unsnd; } else - addr = DW_ADDR (this); + addr = u.addr; return addr; } @@ -73,7 +73,7 @@ attribute::string () const || form == DW_FORM_strx4 || form == DW_FORM_GNU_str_index || form == DW_FORM_GNU_strp_alt) - return DW_STRING (this); + return u.str; return nullptr; } @@ -146,7 +146,7 @@ sect_offset attribute::get_ref_die_offset () const { if (form_is_ref ()) - return (sect_offset) DW_UNSND (this); + return (sect_offset) u.unsnd; complaint (_("unsupported die ref attribute form: '%s'"), dwarf_form_name (form)); @@ -159,13 +159,13 @@ LONGEST attribute::constant_value (int default_value) const { if (form == DW_FORM_sdata || form == DW_FORM_implicit_const) - return DW_SND (this); + return u.snd; else if (form == DW_FORM_udata || form == DW_FORM_data1 || form == DW_FORM_data2 || form == DW_FORM_data4 || form == DW_FORM_data8) - return DW_UNSND (this); + return u.unsnd; else { /* For DW_FORM_data16 see attribute::form_is_constant. */ -- 2.17.2