From patchwork Thu Jan 18 20:32:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 84394 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 D4BE3385840A for ; Thu, 18 Jan 2024 20:39:44 +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 89F733858412 for ; Thu, 18 Jan 2024 20:38:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89F733858412 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 89F733858412 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=1705610293; cv=none; b=DYChojQt0nZ2nb5DFC/hMVogUdCOibMBseDez+kE14rDZBfuyciltVs/tJD0m6dYNpQP/zQ+hxUCG0E+aG+N5XP6yLsjZIvGyNRjq6SuKdG0cS6eNlSlp18nOmfjapjdVajCkYzZh3tYilAItrgAdgb1Q9SMESPA5STPDuKFjpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705610293; c=relaxed/simple; bh=ld4/bGCG3GvzfuEuzGnJkSqHTjWJF8Af0jYYReJQHpo=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=IyDzh3GmI36g9Dh2ObYbXHomXhJqShIyqJWbDRAQ/LY7fydZ2CskkRHirCvdo1xekzSRKePaPe+QeTG98IoVm7AxiLVWzraz3DotO937CdlQX40hU/NcMKRSlM9zGrzlKwYReyRBw9cpK9TT94w7NdOKBN/hJMrF0q2SCtnrdHI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTPS id QQ7vrLFqoMVQiQZ9NrEfdW; Thu, 18 Jan 2024 20:38:09 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QZ9Mr3eMjbhW6QZ9MrsaRO; Thu, 18 Jan 2024 20:38:09 +0000 X-Authority-Analysis: v=2.4 cv=aLPjFJxm c=1 sm=1 tr=0 ts=65a98c31 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=mDV3o1hIAAAA:8 a=7s7ocBhQw26AErY8W1oA:9 a=QEXdDO2ut3YA:10 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=rZErj0sQ4ueRyfbqxoR6mTVM0CdJx25QTSwG97kSMQo=; b=uY5FjyZA9rfvLV6KUgxHVclho/ bbMLorGReLIRKaM1CYS/3iBRWZXs7rwORkRrOpTzSuIQ5rONzQe3bAyfPQRmZ3ydgT8uDsp/bD5tu HlgdsLL36E4tBn/oJDi+6vPKl; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:50746 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 1rQZ3f-002DCj-0a; Thu, 18 Jan 2024 13:32:15 -0700 From: Tom Tromey Date: Thu, 18 Jan 2024 13:32:28 -0700 Subject: [PATCH v2 30/30] Document new Python and Guile constants MIME-Version: 1.0 Message-Id: <20240118-submit-domain-hacks-2-v2-30-aecab29fa104@tromey.com> References: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@tromey.com> In-Reply-To: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@tromey.com> To: gdb-patches@sourceware.org Cc: Eli Zaretskii 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.68.157 X-Source-L: No X-Exim-ID: 1rQZ3f-002DCj-0a X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:50746 X-Source-Auth: tom+tromey.com X-Email-Count: 37 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfL8euQzDkS07pCktwo6zLIDOBLqj8EpbjRrKOk5JoRo4/yf4cXEHEpfJjtQf9ZoyPVkziO/sSDqSykOl7OZxrA2N3h4djlE8fDtVf9RcZINptw1ZGmjf 6RZsouq4txrUoN7Y3bcS6mMWzsmbYlcA49rQ+bRujXjGNWi0hGiLpmCLH7JMCStwl5bKsf+y+LS6Wos8az6/tGLJ4ULY5DXyLy8= X-Spam-Status: No, score=-3022.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_STOCKGEN, 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 documents the new Python and Guile constants introduced earlier in this series. Reviewed-By: Eli Zaretskii --- gdb/NEWS | 12 ++++++++++++ gdb/doc/guile.texi | 13 +++++++++++++ gdb/doc/python.texi | 30 +++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index bab300e36b8..2638b3e0d9c 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -108,6 +108,11 @@ show remote thread-options-packet object, these will be stored in the object's new InferiorThread.__dict__ attribute. + ** New constants gdb.SYMBOL_TYPE_DOMAIN, gdb.SYMBOL_FUNCTION_DOMAIN, + and gdb.SEARCH_*_DOMAIN corresponding to all the existing symbol + domains. Symbol lookup can now search in multiple domains at + once, and can also narrowly search for just a type or function. + * Debugger Adapter Protocol changes ** GDB now emits the "process" event. @@ -121,6 +126,13 @@ show remote thread-options-packet ** The "set debug dap-log-file" command is now documented. This command was available in GDB 14 but not documented. +* Guile API + + ** New constants SYMBOL_TYPE_DOMAIN, SYMBOL_FUNCTION_DOMAIN, and + SEARCH_*_DOMAIN corresponding to all the existing symbol domains. + Symbol lookup can now search in multiple domains at once, and can + also narrowly search for just a type or function. + * New remote packets New stop reason: clone diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi index 271b672fdc6..483a96fb592 100644 --- a/gdb/doc/guile.texi +++ b/gdb/doc/guile.texi @@ -2802,6 +2802,14 @@ in the symbol information or in @value{GDBN}'s handling of symbols. This domain contains variables, function names, typedef names and enum type values. +@item SYMBOL_FUNCTION_DOMAIN +This domain contains functions. + +@item SYMBOL_TYPE_DOMAIN +This domain contains types. In a C-like language, types using a tag +will not appear here; in other languages, all types are in this +domain. + @item SYMBOL_STRUCT_DOMAIN This domain holds struct, union and enum type names. @@ -2822,6 +2830,11 @@ This domain contains all types. The available address class categories in @code{} are represented as constants in the @code{gdb} module: +When searching for a symbol, the desired domain constant can be passed +verbatim to the lookup function. For more complex searches, there is +a corresponding set of constants using a @samp{SEARCH_} prefix. These +may be or'd together to form a search constant. + @vtable @code @item SYMBOL_LOC_UNDEF If this is returned by address class, it indicates an error either in diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 71431878dd3..906775c5711 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -6214,12 +6214,22 @@ in the symbol information or in @value{GDBN}'s handling of symbols. @vindex SYMBOL_VAR_DOMAIN @item gdb.SYMBOL_VAR_DOMAIN -This domain contains variables, function names, typedef names and enum -type values. +This domain contains variables. + +@vindex SYMBOL_FUNCTION_DOMAIN +@item gdb.SYMBOL_FUNCTION_DOMAIN +This domain contains functions. + +@vindex SYMBOL_TYPE_DOMAIN +@item gdb.SYMBOL_TYPE_DOMAIN +This domain contains types. In a C-like language, types using a tag +will not appear here; in other languages, all types are in this +domain. @vindex SYMBOL_STRUCT_DOMAIN @item gdb.SYMBOL_STRUCT_DOMAIN -This domain holds struct, union and enum type names. +This domain holds struct, union and enum tag names. This domain is +only used for C-like languages. @vindex SYMBOL_LABEL_DOMAIN @item gdb.SYMBOL_LABEL_DOMAIN @@ -6234,6 +6244,20 @@ This domain contains names of Fortran module types. This domain contains names of Fortran common blocks. @end vtable +When searching for a symbol, the desired domain constant can be passed +verbatim to the lookup function. For example: +@smallexample +symbol = gdb.lookup_symbol ("name", domain=gdb.SYMBOL_VAR_DOMAIN) +@end smallexample + +For more complex searches, there is a corresponding set of constants +using a @samp{SEARCH_} prefix. These may be or'd together to form a +search constant, e.g.: +@smallexample +symbol = gdb.lookup_symbol ("name", + domain=gdb.SEARCH_VAR_DOMAIN | gdb.SEARCH_TYPE_DOMAIN) +@end smallexample + The available address class categories in @code{gdb.Symbol} are represented as constants in the @code{gdb} module: