From patchwork Sun Oct 29 23:23:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 78701 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 A1D453831E08 for ; Sun, 29 Oct 2023 23:23:47 +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 A0C1A38618EA for ; Sun, 29 Oct 2023 23:23:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0C1A38618EA 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 A0C1A38618EA 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=1698621791; cv=none; b=Zw+EJMlkzZwLL/4qg7m+3DS/YgzE5PLWUEGrcPghc8m0DTiViiYDdOxilGMKzfPKUI0oSWs6KKVSDhTYkZL+RABekUj/5WG/+ilmGFeM3+0mn0n3zhPQ4Vx8u1RiZbq9UmL5WqXQnq5eZCxs+46chNFXoldCThV+W+dFgeDANXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698621791; c=relaxed/simple; bh=+bRTXXpNvRoAJr+Z3BK3dy74QzN44PWxD+ylKPpUPxU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=hxkSdte97U1TqlVf48VWx6eD5X91iBUCzN3wqW9HhvbIBHeeD5Pw3NEvm2HzAAV/83fo1JZd9jkdCY6g/Q+6tKmfEcS5oGV1gnCXiMZc9DX69kLy3iHX5/MkJrcz7lU7NRU13q00TCGqrl6Yti0VEgmIA0rYTaFlykm1lGfeZ00= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id xCtAqtmVhL9AgxF7bqdPr2; Sun, 29 Oct 2023 23:23:07 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id xF7aqx1NzGYrgxF7bqfHYS; Sun, 29 Oct 2023 23:23:07 +0000 X-Authority-Analysis: v=2.4 cv=bYd47cDB c=1 sm=1 tr=0 ts=653ee95b 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=6rMzt0fA10ZSSo4t_W8A: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=DzJ/RQz2qdNwM/m37PfY1/QHOvcU8Y0Kbi0WGYkspBw=; b=XwIbaeKnRhPQUMkcBa8eL6L7u6 cYOiRsYCBXkIamPH+BuQdJyEeOwJSvLdsR0XMWdD23WWimr+kJOCSsVFGg7tHKIk33Y3XyN4vjkbh +cLrgNuDsPy33Z1Tryf7tVkHT; 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 1qxF7a-0042zY-22 for gdb-patches@sourceware.org; Sun, 29 Oct 2023 17:23:06 -0600 From: Tom Tromey Date: Sun, 29 Oct 2023 17:23:28 -0600 Subject: [PATCH 07/30] More use of block_symbol::address in tracepoint.c MIME-Version: 1.0 Message-Id: <20231029-split-objfile-2023-bound-sym-october-v1-7-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: 1qxF7a-0042zY-22 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: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLAZ2HVAKWxC40kBZ9DS3/xotiG/9T8o+rgrH9rLOCQGU+Ekvo3AtTu4CY0PCzm3p9p7Ohhnf+wLdXH2mGY8UO1EW+w95UA8uAZZsDD49qkUtoFU52J8 Mqf7fLTsk3Sq9uKHDUtheQSZV4Kt5qnG6qBQZiweAk63QFU5PNop3HRJm21kLM5G2NKGknwoFjNoE9ZzWXJdswmouTEZr0wkIds= 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 the remaining spots in tracepoint.c to use block_symbol::address. --- gdb/expop.h | 5 +++++ gdb/tracepoint.c | 12 +++++++----- gdb/tracepoint.h | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdb/expop.h b/gdb/expop.h index 25769d5b810..433c92c9a00 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -667,6 +667,11 @@ class var_value_operation return std::get<0> (m_storage).symbol; } + block_symbol get_block_symbol () const + { + return std::get<0> (m_storage); + } + protected: void do_generate_ax (struct expression *exp, diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 89611114c9b..6d017179283 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -905,7 +905,7 @@ collection_list::add_memrange (struct gdbarch *gdbarch, /* Add a symbol to a collection list. */ void -collection_list::collect_symbol (struct symbol *sym, +collection_list::collect_symbol (block_symbol bsym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, CORE_ADDR scope, @@ -916,6 +916,7 @@ collection_list::collect_symbol (struct symbol *sym, bfd_signed_vma offset; int treat_as_expr = 0; + symbol *sym = bsym.symbol; len = check_typedef (sym->type ())->length (); switch (sym->aclass ()) { @@ -928,7 +929,7 @@ collection_list::collect_symbol (struct symbol *sym, sym->print_name (), plongest (sym->value_longest ())); break; case LOC_STATIC: - offset = sym->value_address (); + offset = bsym.address (); if (info_verbose) { gdb_printf ("LOC_STATIC %s: collect %ld bytes at %s.\n", @@ -1049,7 +1050,8 @@ collection_list::add_local_symbols (struct gdbarch *gdbarch, CORE_ADDR pc, auto do_collect_symbol = [&] (const char *print_name, struct symbol *sym) { - collect_symbol (sym, gdbarch, frame_regno, + block_symbol bsym { sym, block }; + collect_symbol (bsym, gdbarch, frame_regno, frame_offset, pc, trace_string); count++; add_wholly_collected (print_name); @@ -1392,8 +1394,8 @@ encode_actions_1 (struct command_line *action, expr::var_value_operation *vvo = (gdb::checked_static_cast (exp->op.get ())); - struct symbol *sym = vvo->get_symbol (); - const char *name = sym->natural_name (); + block_symbol sym = vvo->get_block_symbol (); + const char *name = sym.symbol->natural_name (); collect->collect_symbol (sym, arch, diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h index b9ff31fa0f6..8c94f1d9fc2 100644 --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h @@ -270,7 +270,7 @@ class collection_list void add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, unsigned long len, CORE_ADDR scope); - void collect_symbol (struct symbol *sym, + void collect_symbol (block_symbol sym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, CORE_ADDR scope,