From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uGveAifo82EjewAAWB0awg (envelope-from ) for ; Fri, 28 Jan 2022 07:57:11 -0500 Received: by simark.ca (Postfix, from userid 112) id 091231F3B7; Fri, 28 Jan 2022 07:57:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8DB981EE18 for ; Fri, 28 Jan 2022 07:57:10 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 327A1394742A for ; Fri, 28 Jan 2022 12:57:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 327A1394742A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643374630; bh=mydZX/CcYNakLLxn1NzNe3L8jxytLWlALzJHb4Rm/XA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RXs3NEhVm8uahsvt+x9FgmPTfpveiL4xpuP3qenBpCakNvqz3xqMGzwIQ9JkugyEI Ac6vhvyCUe7gnZM+7PrLav93b/RnzJU4xgirTvXB4r2WmWGRNSI29ljd2kxX0SeRUI fcib/vBPb5a7rntVY59VeG4jGAQMemFwSu9Bqj3Y= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id D66F7394742A for ; Fri, 28 Jan 2022 12:51:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D66F7394742A X-ASG-Debug-ID: 1643374293-0c856e06ad271b70001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id Dm12Hi1VQuhROnqV (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Jan 2022 07:51:33 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 93B08441D64; Fri, 28 Jan 2022 07:51:33 -0500 (EST) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 25/33] gdb: remove SYMBOL_IMPL macro, add method Date: Fri, 28 Jan 2022 07:45:23 -0500 X-ASG-Orig-Subj: [PATCH 25/33] gdb: remove SYMBOL_IMPL macro, add method Message-Id: <20220128124531.2302941-26-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220128124531.2302941-1-simon.marchi@polymtl.ca> References: <20220128124531.2302941-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1643374293 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2439 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95629 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" From: Simon Marchi Add a getter for a symbol's "impl". Remove the corresponding macro and adjust all callers. Change-Id: Ibe26ed442f0f99a0f5cddafca30bd96ec7fb9fa8 --- gdb/symtab.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gdb/symtab.h b/gdb/symtab.h index aa380aa7be2e..3a22d3e19eee 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1105,6 +1105,8 @@ enum symbol_subclass_kind SYMBOL_RUST_VTABLE }; +extern const struct symbol_impl *symbol_impls; + /* This structure is space critical. See space comments at the top. */ struct symbol : public general_symbol_info, public allocate_on_obstack @@ -1146,6 +1148,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack m_aclass_index = aclass_index; } + const symbol_impl &impl () const + { + return symbol_impls[this->aclass_index ()]; + } + /* Data type of value */ struct type *type = nullptr; @@ -1245,14 +1252,11 @@ struct block_symbol const struct block *block; }; -extern const struct symbol_impl *symbol_impls; - /* Note: There is no accessor macro for symbol.owner because it is "private". */ #define SYMBOL_DOMAIN(symbol) (symbol)->domain -#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index ()]) -#define SYMBOL_CLASS(symbol) (SYMBOL_IMPL (symbol).aclass) +#define SYMBOL_CLASS(symbol) ((symbol)->impl ().aclass) #define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned) #define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument #define SYMBOL_INLINED(symbol) (symbol)->is_inlined @@ -1260,9 +1264,9 @@ extern const struct symbol_impl *symbol_impls; (((symbol)->subclass) == SYMBOL_TEMPLATE) #define SYMBOL_TYPE(symbol) (symbol)->type #define SYMBOL_LINE(symbol) (symbol)->line -#define SYMBOL_COMPUTED_OPS(symbol) (SYMBOL_IMPL (symbol).ops_computed) -#define SYMBOL_BLOCK_OPS(symbol) (SYMBOL_IMPL (symbol).ops_block) -#define SYMBOL_REGISTER_OPS(symbol) (SYMBOL_IMPL (symbol).ops_register) +#define SYMBOL_COMPUTED_OPS(symbol) ((symbol)->impl ().ops_computed) +#define SYMBOL_BLOCK_OPS(symbol) ((symbol)->impl ().ops_block) +#define SYMBOL_REGISTER_OPS(symbol) ((symbol)->impl ().ops_register) #define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value extern int register_symbol_computed_impl (enum address_class, -- 2.34.1