From patchwork Tue Nov 21 03:53:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 80399 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 589FB38582A7 for ; Tue, 21 Nov 2023 03:54:33 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id A4A403858C56 for ; Tue, 21 Nov 2023 03:53:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4A403858C56 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 A4A403858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700538805; cv=none; b=qOoxZKfZ4fKn6bVcrsoxVGt6OsrOVu4B/4FMtCvzCH48OSBpC66WjoQ6HkMwGDl2l61/KZD/i0o/vuLXZGLz2nbDsot7VavUgsMQo5bChpduM0NgSvbJCu3ZMedV3kTZL2M8jJJKAZjciZiQlqcxCqXvDNSlRsq+xlNEFzuXQLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700538805; c=relaxed/simple; bh=8b22/y1oumfkyc76b8HO4g2wU7AH96HYJGpXiprg1VA=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=t9iMCxPTg/4dKnHYa4amBbzSx7DAP+FV3NjZJE365xsiRBcjM2a53wTG0UqRL+T94Rk235+oLuUweAYZ6mNoB64Nc9eKS0Cu+K2VbmhpU0Q+gb/qkUaO5V/EjWZ+DMPeMVHv2FSMZwW29cCpJRw+pX92S8u6QoHWnh7/R7lBmL0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id 5924rRhju8Hte5HpArHZWR; Tue, 21 Nov 2023 03:53:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 5Hp9rp9u6RQmi5HpArrjbV; Tue, 21 Nov 2023 03:53:20 +0000 X-Authority-Analysis: v=2.4 cv=CdcbWZnl c=1 sm=1 tr=0 ts=655c29b0 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=r7Wzu623eIwutHv_wZcA: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=luMcHIa1gHzOLtnVEq2q2Xtg5HUpUz9XXT7yZMWFwLE=; b=iwtb26MiPfZhf1MR7WsqPIzObQ keWCkDD9f/CjHwcXZkpB872Rq29QqpiZUH24Q3kR3KePJJI416bxtEKBYHIClqC2oIpVuqhIoYWxw /+BmlU5LRz28G/zWTznyySN7P; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:47856 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 1r5Hp9-0040be-2K for gdb-patches@sourceware.org; Mon, 20 Nov 2023 20:53:19 -0700 From: Tom Tromey Date: Mon, 20 Nov 2023 20:53:41 -0700 Subject: [PATCH 10/29] Add two new symbol domains MIME-Version: 1.0 Message-Id: <20231120-submit-domain-hacks-2-v1-10-29650d01b198@tromey.com> References: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@tromey.com> In-Reply-To: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@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: 1r5Hp9-0040be-2K 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]:47856 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: MS4xfK6B6X6NTa560+gJ3Au31XPGIEFnBxxi3SyZce/7G4AjB+IiT+f5ADhY8qAEAjXoc2nuKDFNAEmPMSUMAgjapblF5eGaXpakPOq+IO54FQ2yGFIG0/uB ZHwSAh4Huf7KU2h7foXvV5CpzVcnmxNzd7AKEhO4a5maZvw6dnl3pyt3QWN1XGM7ItnR2UAondMTrquY3ChdkPDBK/jH7/qCaKw= X-Spam-Status: No, score=-3024.1 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, T_SCC_BODY_TEXT_LINE 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 adds two new symbol domain constants, TYPE_DOMAIN and FUNCTION_DOMAIN. Historically, gdb was a C debugger, and the symbol tables continue to reflect this. In particular, symbol domains match the C language, with VAR_DOMAIN including variables, functions, and types. However, other languages have other approaches to namespacing. And, in any case, it is often useful for other parts of gdb to be able to distinguish between some domains at lookup time, without resorting to examining a symbol's location -- in some situations, this sort of filtering happens too late. Nothing uses these new domains yet, but the idea behind the patch is to separate symbols into more domains and then let the language-specific parts of gdb implement their semantics in terms of these categories. --- gdb/sym-domains.def | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/sym-domains.def b/gdb/sym-domains.def index 251c66fa04b..cea25a5f5b3 100644 --- a/gdb/sym-domains.def +++ b/gdb/sym-domains.def @@ -45,3 +45,12 @@ DOMAIN (LABEL) /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. They also always use LOC_COMMON_BLOCK. */ DOMAIN (COMMON_BLOCK) + +/* TYPE_DOMAIN is for types and typedefs. Note that tags are not + found here, see STRUCT_DOMAIN above. */ + +DOMAIN (TYPE) + +/* FUNCTION_DOMAIN is for functions and methods. */ + +DOMAIN (FUNCTION)