From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2C3FEV7o82EjewAAWB0awg (envelope-from ) for ; Fri, 28 Jan 2022 07:58:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 467FC1F3B7; Fri, 28 Jan 2022 07:58:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 C133D1EE18 for ; Fri, 28 Jan 2022 07:58:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C83B3947C3D for ; Fri, 28 Jan 2022 12:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C83B3947C3D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643374685; bh=e26zn7YYUoA0NgqQ7qE4EGjod2lJ5OkCagb1Fh0WAfY=; 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=LRW86DfOrFs9DyEV/09EQjY3IEG20OJjXtQBXXsB7qJPmXSfdktKfEuRzMp9cD9bn OrzXVBIYsXCRzLbnSP+QWTkEtEGe93/Alc/0b5KowqmmV8iC/90BDz2O6D8wt29I6U WpEvxh2ZK6R9vIIbpDwLrNNw3BQcjtUbOjs/Y75k= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 7573C3947C1C for ; Fri, 28 Jan 2022 12:51:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7573C3947C1C X-ASG-Debug-ID: 1643374294-0c856e06ab271d90001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id VhWDaDuZpZMGj4wg (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Jan 2022 07:51:34 -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 1488B441D68; Fri, 28 Jan 2022 07:51:34 -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 30/33] gdb: remove SYMBOL_INLINED macro Date: Fri, 28 Jan 2022 07:45:28 -0500 X-ASG-Orig-Subj: [PATCH 30/33] gdb: remove SYMBOL_INLINED macro Message-Id: <20220128124531.2302941-31-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: 1643374294 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: 3402 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95629 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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 and a setter for whether a symbol is inlined. Remove the corresponding macro and adjust all callers. Change-Id: I934468da3b5a32dd6b161a6f252a6b1b94737279 --- gdb/block.c | 2 +- gdb/dwarf2/read.c | 2 +- gdb/linespec.c | 2 +- gdb/symtab.h | 15 ++++++++++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gdb/block.c b/gdb/block.c index f7532120286b..3d11ea607682 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -124,7 +124,7 @@ block_containing_function (const struct block *bl) int block_inlined_p (const struct block *bl) { - return BLOCK_FUNCTION (bl) != NULL && SYMBOL_INLINED (BLOCK_FUNCTION (bl)); + return BLOCK_FUNCTION (bl) != NULL && BLOCK_FUNCTION (bl)->is_inlined (); } /* A helper function that checks whether PC is in the blockvector BL. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 259401fbbb70..95d4d6fc5532 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -21794,7 +21794,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by finish_block. */ sym->set_aclass_index (LOC_BLOCK); - SYMBOL_INLINED (sym) = 1; + sym->set_is_inlined (1); list_to_add = cu->list_in_scope; break; case DW_TAG_template_value_param: diff --git a/gdb/linespec.c b/gdb/linespec.c index 7c904473657f..4a83b78d4fd6 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1200,7 +1200,7 @@ iterate_over_all_matching_symtabs { /* Restrict calls to CALLBACK to symbols representing inline symbols only. */ - if (SYMBOL_INLINED (bsym->symbol)) + if (bsym->symbol->is_inlined ()) return callback (bsym); return true; }); diff --git a/gdb/symtab.h b/gdb/symtab.h index f565f1258248..9b7d7e35c972 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1117,7 +1117,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack m_aclass_index (0), m_is_objfile_owned (1), m_is_argument (0), - is_inlined (0), + m_is_inlined (0), maybe_copied (0), subclass (SYMBOL_NONE), artificial (false) @@ -1188,6 +1188,16 @@ struct symbol : public general_symbol_info, public allocate_on_obstack m_is_argument = is_argument; } + bool is_inlined () const + { + return m_is_inlined; + } + + void set_is_inlined (bool is_inlined) + { + m_is_inlined = is_inlined; + } + /* Data type of value */ struct type *type = nullptr; @@ -1226,7 +1236,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack unsigned m_is_argument : 1; /* Whether this is an inlined function (class LOC_BLOCK only). */ - unsigned is_inlined : 1; + unsigned m_is_inlined : 1; /* For LOC_STATIC only, if this is set, then the symbol might be subject to copy relocation. In this case, a minimal symbol @@ -1290,7 +1300,6 @@ struct block_symbol /* Note: There is no accessor macro for symbol.owner because it is "private". */ -#define SYMBOL_INLINED(symbol) (symbol)->is_inlined #define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \ (((symbol)->subclass) == SYMBOL_TEMPLATE) #define SYMBOL_TYPE(symbol) (symbol)->type -- 2.34.1