From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 4D79F3858D33 for ; Thu, 4 May 2023 14:53:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D79F3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puaKe-0007ga-Nb; Thu, 04 May 2023 10:53:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=j+N9gD8lciimCsusldND6hiR37MmPZeCn8avyjcmC1w=; b=nT5t+YPD9rBv mPwwUWfiYH9OEeRlJOJJNKqNLXwMSLAQTXhg7z6QCdxFMNK5/dml8/c5/V+/esou2naUdd2H+iiov B4x78kEHUxG6OZ01tSYrAD9exal2IZtUOlX7cAozUSQIZSokKZPjOCHsC/AlFgWCuhS0ERuF6dsGc d7V/3XscRIztNrnReQS1f+IVHyQsh4Twrcip+cQ2mG9+SOsY+yFUy7QGGWurNXYCKw0SmSDFe1shO 8FyT4ZI4QE5c3cg9tBWWz532cbF1M+kY8DkZcwVf7RnXDGd6LMWWDmwR3YMCHBMbuTaIi99muEe4q dijgjoj0a7uUxYrC7ToCvg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puaKb-0006Ve-Pn; Thu, 04 May 2023 10:53:20 -0400 Date: Thu, 04 May 2023 17:54:07 +0300 Message-Id: <834joskv00.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20230504-frameless-v1-10-4191201740b0@adacore.com> (message from Tom Tromey via Gdb-patches on Thu, 04 May 2023 08:21:31 -0600) Subject: Re: [PATCH 10/11] Add global_context parameter to gdb.parse_and_eval References: <20230504-frameless-v1-0-4191201740b0@adacore.com> <20230504-frameless-v1-10-4191201740b0@adacore.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,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 List-Id: > Date: Thu, 04 May 2023 08:21:31 -0600 > From: Tom Tromey via Gdb-patches > > This adds a 'global_context' parse_and_eval to gdb.parse_and_eval. > This lets users request a parse that is done at "global scope". > > I considered letting callers pass in a block instead, with None > meaning "global" -- but then there didn't seem to be a clean way to > express the default for this parameter. > --- > gdb/NEWS | 4 ++++ > gdb/doc/python.texi | 7 ++++++- > gdb/python/python.c | 28 ++++++++++++++++++++++------ > gdb/testsuite/gdb.python/py-value.c | 3 +++ > gdb/testsuite/gdb.python/py-value.exp | 5 +++++ > 5 files changed, 40 insertions(+), 7 deletions(-) Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index e3c095de09e..4bf5603b550 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -162,6 +162,10 @@ info main > (program-counter) values, and can be used as the frame-id when > calling gdb.PendingFrame.create_unwind_info. > > + ** gdb.parse_and_eval now has a new "global_context" parameter. > + This can be used to request that the parse only examine global > + symbols. > + This part is OK. > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -419,11 +419,16 @@ using the @code{gdb.Value} constructor. > @end defun > > @findex gdb.parse_and_eval > -@defun gdb.parse_and_eval (expression) > +@defun gdb.parse_and_eval (expression, @r{[}, global_context@r{]}) ^ That comma is redundant, right? Reviewed-By: Eli Zaretskii