From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id A335A3858D32 for ; Mon, 18 Sep 2023 00:00:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A335A3858D32 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 eig-obgw-5004a.ext.cloudfilter.net ([10.0.29.221]) by cmsmtp with ESMTP id hwP5qr5aBbK1Vi1gbqv89d; Mon, 18 Sep 2023 00:00:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id i1gaqfUeZ10Y1i1gbq8eE7; Mon, 18 Sep 2023 00:00:21 +0000 X-Authority-Analysis: v=2.4 cv=JeSvEGGV c=1 sm=1 tr=0 ts=65079315 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=zNV7Rl7Rt7sA:10 a=Qbun_eYptAEA:10 a=ARKKshjipw_GzzlQFxwA: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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=d9qeCCl3gzjGAvnNdkTIhB4kYMkcCZIoaUd7Hcwqy7A=; b=L9J16/31uMeXCnRT1ilZ6bYTo7 s3dndDNhX9hgjhcknd3bp4DXNJahUfIsZ2qhimlBcANRznsh5nwEXZ/QneWRdIoZ9c4m485x3MF7k SwXJ473W9ney4fhCVS5ZoHL2E; Received: from 71-211-130-31.hlrn.qwest.net ([71.211.130.31]:59816 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qi1ga-001q7W-1M; Sun, 17 Sep 2023 18:00:20 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] More type safety for symbol_search Date: Sun, 17 Sep 2023 18:00:13 -0600 Message-ID: <20230918000013.1821776-1-tom@tromey.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: 71.211.130.31 X-Source-L: No X-Exim-ID: 1qi1ga-001q7W-1M X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-130-31.hlrn.qwest.net (localhost.localdomain) [71.211.130.31]:59816 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGPUUiPkXgErbsetl5s9IzW+42jWtZLjofHP95KXMBXb55HKlZSoYz/PwrOnSY9ehswknB+MqXu/TNLTth+lDdGbtX0tJt+8fsgMAezb0kdIV8gxb7u1 SKPS0lKuvY9I8I4Y4AFL9jzFPYjJiWs8cQUMEg6jJEM6SOhFl8qQimUnTWRR6k4Ok6G/jlbEpZp0AbN4z8DhoY1bhM7P9rALzWg= X-Spam-Status: No, score=-3025.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,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 List-Id: This patch changes class symbol_search to store a block_enum rather than an int. Regression tested on x86-64 Fedora 38. --- gdb/symtab.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/symtab.h b/gdb/symtab.h index 8f587807ff9..365743384e1 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2479,7 +2479,7 @@ extern symbol *find_function_alias_target (bound_minimal_symbol msymbol); the following structs is returned. */ struct symbol_search { - symbol_search (int block_, struct symbol *symbol_) + symbol_search (block_enum block_, struct symbol *symbol_) : block (block_), symbol (symbol_) { @@ -2487,7 +2487,7 @@ struct symbol_search msymbol.objfile = nullptr; } - symbol_search (int block_, struct minimal_symbol *minsym, + symbol_search (block_enum block_, struct minimal_symbol *minsym, struct objfile *objfile) : block (block_), symbol (nullptr) @@ -2506,9 +2506,9 @@ struct symbol_search return compare_search_syms (*this, other) == 0; } - /* The block in which the match was found. Could be, for example, - STATIC_BLOCK or GLOBAL_BLOCK. */ - int block; + /* The block in which the match was found. Either STATIC_BLOCK or + GLOBAL_BLOCK. */ + block_enum block; /* Information describing what was found. -- 2.41.0