From patchwork Fri Jan 20 21:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 63527 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 9FBCF38983A2 for ; Fri, 20 Jan 2023 21:48:01 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by sourceware.org (Postfix) with ESMTPS id 8BD2F385AC39 for ; Fri, 20 Jan 2023 21:46:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BD2F385AC39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway5.mail.pro1.eigbox.com (Postfix) with ESMTP id 0A6CF1004A83C for ; Fri, 20 Jan 2023 21:46:38 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id IzDZpwSqsbwScIzDapCg23; Fri, 20 Jan 2023 21:46:38 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=X8KXlEfe c=1 sm=1 tr=0 ts=63cb0bbe a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=RvmDmJFTN0MA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=G8Rx7z2txpoW---cwZQA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=8MJjvwRCPFBoEII1ljXCXoS6UJHjjR8V858ds8LjfhA=; b=P3ufsmYSpGGOOIRzfxlOg9Y4Uk eDqKUM2Jij062nnAbAs4wJeb6jdLidL4Q9YIx8Uoo7BFu4+HLZNwB4vcfW4PwBrg6D4HHLuOOkmvZ pyD30OodXe1m7BrlpzFLDA71d; Received: from 97-122-76-186.hlrn.qwest.net ([97.122.76.186]:60138 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pIzDZ-001GGF-Nm; Fri, 20 Jan 2023 14:46:37 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 14/27] Convert set_block_compunit_symtab to method Date: Fri, 20 Jan 2023 14:46:05 -0700 Message-Id: <20230120214618.3236224-15-tom@tromey.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120214618.3236224-1-tom@tromey.com> References: <20230120214618.3236224-1-tom@tromey.com> MIME-Version: 1.0 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.76.186 X-Source-L: No X-Exim-ID: 1pIzDZ-001GGF-Nm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-76-186.hlrn.qwest.net (localhost.localdomain) [97.122.76.186]:60138 X-Source-Auth: tom+tromey.com X-Email-Count: 15 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, 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.29 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 Sender: "Gdb-patches" This converts set_block_compunit_symtab to be a method. This was mostly written by script. --- gdb/block.c | 8 ++++---- gdb/block.h | 7 ++++--- gdb/buildsym.c | 2 +- gdb/jit.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gdb/block.c b/gdb/block.c index c0d6ed7da97..3cd90dcb4ed 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -404,15 +404,15 @@ allocate_global_block (struct obstack *obstack) return &bl->block; } -/* Set the compunit of the global block. */ +/* See block.h. */ void -set_block_compunit_symtab (struct block *block, struct compunit_symtab *cu) +block::set_compunit_symtab (struct compunit_symtab *cu) { struct global_block *gb; - gdb_assert (block->superblock () == NULL); - gb = (struct global_block *) block; + gdb_assert (superblock () == NULL); + gb = (struct global_block *) this; gdb_assert (gb->compunit_symtab == NULL); gb->compunit_symtab = cu; } diff --git a/gdb/block.h b/gdb/block.h index 9ce8ef51945..ce8c9679a07 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -254,6 +254,10 @@ struct block const struct block *global_block () const; + /* Set the compunit of this block, which must be a global block. */ + + void set_compunit_symtab (struct compunit_symtab *); + /* Addresses in the executable code that are in this block. */ CORE_ADDR m_start; @@ -417,9 +421,6 @@ extern struct block *allocate_block (struct obstack *obstack); extern struct block *allocate_global_block (struct obstack *obstack); -extern void set_block_compunit_symtab (struct block *, - struct compunit_symtab *); - /* Return a property to evaluate the static link associated to BLOCK. In the context of nested functions (available in Pascal, Ada and GNU C, for diff --git a/gdb/buildsym.c b/gdb/buildsym.c index fd76e56599d..7a009c2f626 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -970,7 +970,7 @@ buildsym_compunit::end_compunit_symtab_with_blockvector { struct block *b = blockvector->global_block (); - set_block_compunit_symtab (b, cu); + b->set_compunit_symtab (cu); } cu->set_block_line_section (section); diff --git a/gdb/jit.c b/gdb/jit.c index 48bfef0a026..f584438c229 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -623,7 +623,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile) bv->set_block (i, new_block); if (i == GLOBAL_BLOCK) - set_block_compunit_symtab (new_block, cust); + new_block->set_compunit_symtab (cust); } /* Fill up the superblock fields for the real blocks, using the