]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Expose current 'print' settings to Python
authorTom Tromey <tromey@adacore.com>
Mon, 6 Jun 2022 15:54:45 +0000 (09:54 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 15 Jul 2022 15:25:33 +0000 (09:25 -0600)
commitc4a3dbaf1132105586586617a59d0e7566eefd41
tree60fdbcc109b1a55a76ce8070f6b4b7c81dc6c38f
parentaa63b0a77e193b5181390f19465f33c314d0490e
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
gdb/NEWS
gdb/doc/python.texi
gdb/python/py-prettyprint.c
gdb/python/py-value.c
gdb/python/py-varobj.c
gdb/python/python-internal.h
gdb/python/python.c
gdb/testsuite/gdb.python/py-format-string.exp
gdb/testsuite/gdb.python/py-format-string.py
gdb/varobj.c