From patchwork Sun Oct 29 23:23:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 78700 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 F0C7C3876894 for ; Sun, 29 Oct 2023 23:23:45 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 7FEA538618DE for ; Sun, 29 Oct 2023 23:23:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FEA538618DE 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 7FEA538618DE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698621791; cv=none; b=scssUyCY8CLhC9tSpxtRJZN4MPTiyEovvRm/gRr4Z5Zq5XCyPj1xrwJQ95A3zL1mtbKuHa62zNaS36bn3nz+C6YOkmnxHh+n2SpB/XmqCooxrj7Pc2JA7sDmZjb1Y821LhH4h6xWGoelz0+J++glEE4AElod7IU+sXUYWNXnQTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698621791; c=relaxed/simple; bh=qJe0ipy9gWDitjjBADu7a+2K+/Z3BAAfToNb99Vr8tY=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=qdAT5h6aeH0yDOzT+rEMy37lGDcfO+hMvSY+tvaKbuWNjqVQFCnofCdK1x6XKwjU7mT1oe3ehtlYxrZbalwuedkldP4aH8wHfzcIJLyugtzrjzscpZGq5dCLolEB2R2coC8pRYkjQfz8RGIyU/44Jf+eXdqyV8FsgA22IwMRAdg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5009a.ext.cloudfilter.net ([10.0.29.176]) by cmsmtp with ESMTPS id x3NDq5t50WcCIxF7cqWTgF; Sun, 29 Oct 2023 23:23:08 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id xF7bqHYFWI9guxF7cqvxRD; Sun, 29 Oct 2023 23:23:08 +0000 X-Authority-Analysis: v=2.4 cv=Ds1FRUz+ 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=INqLYPXPp5oCZDKoHgwA: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=5AKr0bSIaT/Ha+aTED3LLEplqGwlqB+5YbJdZpuAllM=; b=yFl2OjsN96SvKaa9bYojF8T3l9 zXIRA2fyE7oRMUysDbj+3EOk/CFjos5x4Nl52Ve7RrLJGdNycGZwOpI5nrIO3203+kL3lhHIUyGo9 qshxofYQuRmBY8TwnU73i+J44; 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-1S for gdb-patches@sourceware.org; Sun, 29 Oct 2023 17:23:07 -0600 From: Tom Tromey Date: Sun, 29 Oct 2023 17:23:32 -0600 Subject: [PATCH 11/30] Use block_symbol::address in symmisc.c MIME-Version: 1.0 Message-Id: <20231029-split-objfile-2023-bound-sym-october-v1-11-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-1S 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: 12 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMdj3KamJVT1y70iAVUw4/D4zgCIgLZeMMOonC/RUxbYTGixcDXRGkguO1ZY2vrSP4eExh+bZRX1ogezdLPem1+HIfr1mFe/1akCqi+G4q93fTk3pAFe e7kzFXKlhArvGiFGD0HE7NkKhIDGaKMT6h0tJpMfDf1kDSdZHNCuh1f+jqqlGVjZioYxOd0ipm5idHG/qesO7us0bzS2JkDJHU0= 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_DNSWL_NONE, 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 symmisc.c to use block_symbol::address. --- gdb/symmisc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gdb/symmisc.c b/gdb/symmisc.c index c1a6ab5cd7d..50b761a3b42 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -44,7 +44,7 @@ static int block_depth (const struct block *); -static void print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, +static void print_symbol (struct gdbarch *gdbarch, block_symbol symbol, int depth, ui_file *outfile); @@ -309,7 +309,8 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) { try { - print_symbol (gdbarch, sym, depth + 1, outfile); + block_symbol bsym { sym, b }; + print_symbol (gdbarch, bsym, depth + 1, outfile); } catch (const gdb_exception_error &ex) { @@ -489,11 +490,13 @@ maintenance_print_symbols (const char *args, int from_tty) /* Print symbol SYMBOL on OUTFILE. DEPTH says how far to indent. */ static void -print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, +print_symbol (struct gdbarch *gdbarch, block_symbol bsymbol, int depth, ui_file *outfile) { struct obj_section *section; + symbol *symbol = bsymbol.symbol; + if (symbol->is_objfile_owned ()) section = symbol->obj_section (symbol->objfile ()); else @@ -503,7 +506,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, if (symbol->domain () == LABEL_DOMAIN) { gdb_printf (outfile, "label %s at ", symbol->print_name ()); - gdb_puts (paddress (gdbarch, symbol->value_address ()), + gdb_puts (paddress (gdbarch, bsymbol.address ()), outfile); if (section) gdb_printf (outfile, " section %s\n", @@ -573,7 +576,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, case LOC_STATIC: gdb_printf (outfile, "static at "); - gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile); + gdb_puts (paddress (gdbarch, bsymbol.address ()), outfile); if (section) gdb_printf (outfile, " section %s", bfd_section_name (section->the_bfd_section)); @@ -613,7 +616,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, case LOC_LABEL: gdb_printf (outfile, "label at "); - gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile); + gdb_puts (paddress (gdbarch, bsymbol.address ()), outfile); if (section) gdb_printf (outfile, " section %s", bfd_section_name (section->the_bfd_section));