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 4D901382CCBF for ; Tue, 7 Jun 2022 16:12:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D901382CCBF Received: from fencepost.gnu.org ([2001:470:142:3::e]:39802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyboT-0005Ts-S0; Tue, 07 Jun 2022 12:12:13 -0400 Received: from [87.69.77.57] (port=2841 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 1nyboR-0002Tg-Id; Tue, 07 Jun 2022 12:12:13 -0400 Date: Tue, 07 Jun 2022 19:12:03 +0300 Message-Id: <834k0w78rw.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20220607154226.3281521-2-tromey@adacore.com> (message from Tom Tromey via Gdb-patches on Tue, 7 Jun 2022 09:42:25 -0600) Subject: Re: [PATCH 1/2] Expose current 'print' settings to Python References: <20220607154226.3281521-1-tromey@adacore.com> <20220607154226.3281521-2-tromey@adacore.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 16:12:15 -0000 > Date: Tue, 7 Jun 2022 09:42:25 -0600 > From: Tom Tromey via Gdb-patches > Cc: Tom Tromey > > PR python/17291 asks for access to the current print options. While I > think this need is largely satisfied by the existence of > Value.format_string, it seemed to me that a bit more could be done. > > First, while Value.format_string uses the user's settings, it does not > react to temporary settings such as "print/x". This patch changes > this. > > Second, there is no good way to examine the current settings (in > particular the temporary ones in effect for just a single "print"). > This patch adds this as well. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17291 > --- > gdb/NEWS | 7 ++ > gdb/doc/python.texi | 18 ++++ > gdb/python/py-prettyprint.c | 98 ++++++++++++++++++- > gdb/python/py-value.c | 4 +- > gdb/python/py-varobj.c | 25 ++++- > gdb/python/python-internal.h | 13 ++- > gdb/python/python.c | 4 + > gdb/testsuite/gdb.python/py-format-string.exp | 34 +++++-- > gdb/testsuite/gdb.python/py-format-string.py | 4 + > gdb/varobj.c | 13 ++- > 10 files changed, 199 insertions(+), 21 deletions(-) OK for the documentation parts, thanks.