From patchwork Sun Oct 29 23:23:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 78711 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 098383865C36 for ; Sun, 29 Oct 2023 23:24:42 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 58BDB3861923 for ; Sun, 29 Oct 2023 23:23:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58BDB3861923 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58BDB3861923 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698621793; cv=none; b=o5xU7xyFnkPTN5N1MAQ6urV6QmidU1Yd5jgXqGF0Dy/i7vYeQ9c+ounXYSht/VIgt3GXtOHXVseWowtg4KfWtgT7zYHmLaqqn+rhFlo1D984ThErLznFNFhKJV6P/AmtcqEXQGain6DJRyWKwNFRIobUNoMqT7WcDOVIk8K8W4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698621793; c=relaxed/simple; bh=8U/naP98WbLG+gKeUyFr7Y6rOxCTafkM+wsQnUSGYFQ=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=VGQ8RF2V0cQDBODL8TxI0++/vFc2JUNOGJHQcHo/R1xaGhFDkZtvq5d2F95ywWA3fxx1oSfQFDxj+4FfTC0EroIANo3DFZEzE6BFR6Y2ghVSTN+t1uKwFpy6zls8ZZL6k3d1BBGteJqrsWDrtE2mDiLE1yVK3ukY6CFHipN53mk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5004a.ext.cloudfilter.net ([10.0.29.221]) by cmsmtp with ESMTPS id wrLfqrGGIL9AgxF7cqdPr9; Sun, 29 Oct 2023 23:23:08 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id xF7bqRNZOnippxF7bqkS7N; Sun, 29 Oct 2023 23:23:08 +0000 X-Authority-Analysis: v=2.4 cv=VpAwvs6n c=1 sm=1 tr=0 ts=653ee95c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=IlYUbf1OrnInEeu20AAA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=eXHAtvAvEI/NUiiwWCYTEatZn14AO2iv48ZF4L1miVo=; b=cMF0RQG5gH8BPU9SlJeh469GiL JcquET8oYYs4b+SqVdzd8+64jRsNFmhrRlN/hP2XqkklNKbTvKXnmu7VTULicsiKzaxiprKtbINLm 9UYKFUiCQvjixmZ6h0t5E55d0; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:56344 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1qxF7b-0042zY-0s for gdb-patches@sourceware.org; Sun, 29 Oct 2023 17:23:07 -0600 From: Tom Tromey Date: Sun, 29 Oct 2023 17:23:31 -0600 Subject: [PATCH 10/30] Use block_symbol::address in ada-lang.c MIME-Version: 1.0 Message-Id: <20231029-split-objfile-2023-bound-sym-october-v1-10-612531df2734@tromey.com> References: <20231029-split-objfile-2023-bound-sym-october-v1-0-612531df2734@tromey.com> In-Reply-To: <20231029-split-objfile-2023-bound-sym-october-v1-0-612531df2734@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 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.122.77.73 X-Source-L: No X-Exim-ID: 1qxF7b-0042zY-0s X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net ([192.168.0.21]) [97.122.77.73]:56344 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMQuEsrXbYuVNrDw46J8/oqlCCr6DYQ0QghrZr/OUkCACDbYwv4e9U0mTSB90KRgfAbT5wOMJqQN2hC7PxfO4PS0q4O08RaF957/MGj0PbXyeD0ZrY9J Z/InAlkr7x8/E1sNgfdP74188ZnQCHjtxy2a1R7Y9chfaUayxIs08jL7qRHExTYaxfbR7PMslRQL40c6cdh4ZeRxC7GxW8klaAE= X-Spam-Status: No, score=-3024.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This changes ada-lang.c to use block_symbol::address. --- gdb/ada-lang.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3391aaeccb3..aeb21e0c15c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -160,8 +160,6 @@ static struct value *value_subscript_packed (struct value *, int, static struct value *coerce_unspec_val_to_type (struct value *, struct type *); -static int lesseq_defined_than (struct symbol *, struct symbol *); - static int equiv_types (struct type *, struct type *); static int is_name_suffix (const char *); @@ -4814,12 +4812,15 @@ equiv_types (struct type *type0, struct type *type1) return 0; } -/* True iff SYM0 represents the same entity as SYM1, or one that is - no more defined than that of SYM1. */ +/* True iff BSYM0 represents the same entity as BSYM1, or one that is + no more defined than that of BSYM1. */ static int -lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) +lesseq_defined_than (block_symbol bsym0, block_symbol bsym1) { + symbol *sym0 = bsym0.symbol; + symbol *sym1 = bsym1.symbol; + if (sym0 == sym1) return 1; if (sym0->domain () != sym1->domain () @@ -4853,7 +4854,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) const char *name0 = sym0->linkage_name (); const char *name1 = sym1->linkage_name (); return (strcmp (name0, name1) == 0 - && sym0->value_address () == sym1->value_address ()); + && bsym0.address () == bsym1.address ()); } default: @@ -4869,6 +4870,8 @@ add_defn_to_vec (std::vector &result, struct symbol *sym, const struct block *block) { + block_symbol info { sym, block }; + /* Do not try to complete stub types, as the debugger is probably already scanning all symbols matching a certain name at the time when this function is called. Trying to replace the stub @@ -4880,19 +4883,15 @@ add_defn_to_vec (std::vector &result, for (int i = result.size () - 1; i >= 0; i -= 1) { - if (lesseq_defined_than (sym, result[i].symbol)) + if (lesseq_defined_than (info, result[i])) return; - else if (lesseq_defined_than (result[i].symbol, sym)) + else if (lesseq_defined_than (result[i], info)) { - result[i].symbol = sym; - result[i].block = block; + result[i] = info; return; } } - struct block_symbol info; - info.symbol = sym; - info.block = block; result.push_back (info); } @@ -12999,8 +12998,10 @@ ada_add_exceptions_from_frame (compiled_regex *preg, default: if (ada_is_exception_sym (sym)) { + block_symbol bsym { sym, block }; + struct ada_exc_info info = {sym->print_name (), - sym->value_address ()}; + bsym.address ()}; exceptions->push_back (info); } @@ -13075,8 +13076,10 @@ ada_add_global_exceptions (compiled_regex *preg, if (ada_is_non_standard_exception_sym (sym) && name_matches_regex (sym->natural_name (), preg)) { + block_symbol bsym { sym, b }; + struct ada_exc_info info - = {sym->print_name (), sym->value_address ()}; + = {sym->print_name (), bsym.address ()}; exceptions->push_back (info); }