From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iF33LaBBB2qxej0AWB0awg (envelope-from ) for ; Fri, 15 May 2026 11:54:08 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=EuTaSlNR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 83F611E093; Fri, 15 May 2026 11:54:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6027C1E093 for ; Fri, 15 May 2026 11:54:05 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 052B451A432B for ; Fri, 15 May 2026 15:54:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 052B451A432B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=EuTaSlNR Received: from mail-4318.protonmail.ch (mail-4318.protonmail.ch [185.70.43.18]) by sourceware.org (Postfix) with ESMTPS id 7B27540A2499 for ; Fri, 15 May 2026 15:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B27540A2499 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=vrany.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrany.io ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7B27540A2499 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=185.70.43.18 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778860376; cv=none; b=TN20xE83quFrn/87apKev+N4uBY3T+ZT2IWdCmIQl7rfBg6h5NNTfFDWsFLGTT+j2MG9B9DqxIPkoxWoLIM7GT68K4GqOeiPxYSIGYUIqE1kt6Y8NQACuHzVt2VQe1/Y5dKkmVO54xoGEQlDYmsiv7ok5b9uXe1Bd7CitCz7CZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778860376; c=relaxed/simple; bh=pqq0qeXsvWs7C/Cg1Cdz4hntn+6N+g4GhnhR5DvVHy0=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=Ws6LuLQkiie3VIDdATDKPS4VVIfBRIFVtw5EjwXIfnQQw6UM1O+PbOJhqURrXYfM1Ss7yF7F0rJVeYp/+M0PYaLcmL9w/eAnmeg7wNDHPXwWAaeKAd4qZZtOtDttQ6paxLZVA0zZksWeHPV7h0IGh89ZF9+UaMVGgoLSwPdV9hk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=EuTaSlNR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B27540A2499 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrany.io; s=protonmail3; t=1778860368; x=1779119568; bh=pqq0qeXsvWs7C/Cg1Cdz4hntn+6N+g4GhnhR5DvVHy0=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EuTaSlNRlH/kMxuPHejhhGOxyLElGy7+neQJJVigGSC0PfB8ud3hCbqWQK47SrGIv RbVhLna1M8VB08eFsneN9rVeCZwwiANwPCXx8m/8EHifPACQfIqziD39h8gUTrqlly UONkhc7pxGSvF8weyrV3/qSZEXvW0dzHvxgGWcBn4DOdidnKsV33bUjcaX1BYkQp48 9MIwyZWTWb0ET6ceinP22TDrxiwgfjUWwPpgHtrihNXCQdEQxE7L/76wjy1YQLko5l DmSSpALUoK95eNrvsAYNwYBRw4WoM/bVb8E66ajA0c7yCTymkgrg4pTv/E/2O6f8R3 orEfe3p0JlOcA== Date: Fri, 15 May 2026 15:52:43 +0000 To: Tom Tromey , gdb-patches@sourceware.org From: Jan Vrany Subject: Re: [PATCH] [doc] Update obsolete text about sub-blocks Message-ID: <4d9d1daf606458855523fba9ab23a863c736234b.camel@vrany.io> In-Reply-To: <20260514195907.1995821-1-tromey@adacore.com> References: <20260514195907.1995821-1-tromey@adacore.com> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: 5b114d5b34a65e346eeba98a30f61cd097269252 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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~public-inbox=simark.ca@sourceware.org On Thu, 2026-05-14 at 13:59 -0600, Tom Tromey wrote: > The manual claims that there is no way to iterate over the sub-blocks > of a gdb.Block, but this hasn't been true since commit 5166ed9c > ("gdb/python: add subblocks property to gdb.Block"). Ah, thanks! I missed that. >=20 > This patch removes the obsolete clause and rewords the paragraph. > --- > =C2=A0gdb/doc/python.texi | 7 +++---- > =C2=A01 file changed, 3 insertions(+), 4 deletions(-) >=20 > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi > index 6cafab78d58..663976f1877 100644 > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -6273,10 +6273,9 @@ The block nested just inside the global block is t= he @dfn{static > =C2=A0block}.=C2=A0 The static block typically holds file-scoped variable= s and > =C2=A0functions. >=20 > -@value{GDBN} provides a method to get a block's superblock, but there > -is currently no way to examine the sub-blocks of a block, or to > -iterate over all the blocks in a symbol table (@pxref{Symbol Tables In > -Python}). > +There is currently no way to iterate over all the blocks in a symbol > +table (@pxref{Symbol Tables In Python}), but once a block is found, > +its super- and sub-blocks can be iterated over. Reading this, I thought maybe we should drop the part talking about=C2= =A0 iterating all the blocks of a symtab altogether. When I read it, my first thought was: "This is not true, one can recursivel= y iterate over all sub-blocks starting with global block." But then I realize= d this is not true either - this iterates over all blocks in a compunit, not in a particular symtab.=20 Is it at all possible to get all blocks of given symtab (_not_ compunit)? I can imagine some complicated way of first finding the symtab for the bloc= k from the superblock chain and then iterating all blocks in a compunit, sele= cting only those that are sub-blocks of a block whose Block.function.symtab is th= e=20 particular symtab or something like that.=20 To sum it up, I find the part about iterating all blocks in a symtab a bit confusing. Thanks,=20 Jan >=20 > =C2=A0Here is a short example that should help explain blocks: >=20 >=20 > base-commit: 2ea3f3a7ac2dd6ccd42e96d496b56aa42e7cb993 > -- > 2.54.0