IWBN if pretty-printers had access to the print options (struct value_print_options).
*** Bug 29186 has been marked as a duplicate of this bug. ***
I have a patch.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c4a3dbaf1132105586586617a59d0e7566eefd41 commit c4a3dbaf1132105586586617a59d0e7566eefd41 Author: Tom Tromey <tromey@adacore.com> Date: Mon Jun 6 09:54:45 2022 -0600 Expose current 'print' settings to Python 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
Fixed.
Will this have documentation or sample code? Thanks.
(In reply to Tom Tromey from comment #4) > Fixed. Hi Tom, Is it available now in 13.2? Is there any documentation about how to use it? Thank you very much.
(In reply to YEN-TE SHIH from comment #6) > Is it available now in 13.2? Is there any documentation about how to use it? Yes, this was in the 13.1 release. The new facility is documented in the manual. Here's a link to just the manual part of the patch: https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=gdb/doc/python.texi;h=4573ba677341dee63e94462a5897c2d65b07bd31;hp=19ae33012c30cb5784549668a4754636da26b3be;hb=c4a3dbaf1132105586586617a59d0e7566eefd41;hpb=aa63b0a77e193b5181390f19465f33c314d0490e
Created attachment 14994 [details] attachment-1929023-0.html Thank you! ________________________________ From: tromey at sourceware dot org <sourceware-bugzilla@sourceware.org> Sent: Friday, July 21, 2023 20:22 To: shihyente@hotmail.com <shihyente@hotmail.com> Subject: [Bug python/17291] IWBN if the print format was available to pretty-printers. https://sourceware.org/bugzilla/show_bug.cgi?id=17291 --- Comment #7 from Tom Tromey <tromey at sourceware dot org> --- (In reply to YEN-TE SHIH from comment #6) > Is it available now in 13.2? Is there any documentation about how to use it? Yes, this was in the 13.1 release. The new facility is documented in the manual. Here's a link to just the manual part of the patch: https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=gdb/doc/python.texi;h=4573ba677341dee63e94462a5897c2d65b07bd31;hp=19ae33012c30cb5784549668a4754636da26b3be;hb=c4a3dbaf1132105586586617a59d0e7566eefd41;hpb=aa63b0a77e193b5181390f19465f33c314d0490e -- You are receiving this mail because: You are on the CC list for the bug.