diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2020-12-18 17:23:06 +0100 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2020-12-18 22:04:16 +0100 |
commit | 4aea001fd84a05f1e552c5dea1025e3f62dd2d7e (patch) | |
tree | 27ae942e59baf13662d1cf7217f511d407f297d3 /gdb/doc/python.texi | |
parent | b3f9469bfa42ef352e1d96f8733817242dd41a2e (diff) | |
download | gdb-4aea001fd84a05f1e552c5dea1025e3f62dd2d7e.zip gdb-4aea001fd84a05f1e552c5dea1025e3f62dd2d7e.tar.gz gdb-4aea001fd84a05f1e552c5dea1025e3f62dd2d7e.tar.bz2 |
Add address keyword to Value.format_string
This makes it possible to disable the address in the result string:
const char *str = "alpha";
(gdb) py print(gdb.parse_and_eval("str").format_string())
0x404000 "alpha"
(gdb) py print(gdb.parse_and_eval("str").format_string(address=False))
"alpha"
gdb/ChangeLog:
2020-12-18 Hannes Domani <ssbssa@yahoo.de>
* python/py-value.c (valpy_format_string): Implement address keyword.
gdb/doc/ChangeLog:
2020-12-18 Hannes Domani <ssbssa@yahoo.de>
* python.texi (Values From Inferior): Document the address keyword.
gdb/testsuite/ChangeLog:
2020-12-18 Hannes Domani <ssbssa@yahoo.de>
* gdb.python/py-format-string.exp: Add tests for address keyword.
Diffstat (limited to 'gdb/doc/python.texi')
-rw-r--r-- | gdb/doc/python.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index c107d45..ad7df2c 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -906,6 +906,11 @@ corresponding symbol name (if one exists), @code{False} if it shouldn't should be expanded, @code{False} if they shouldn't (see @code{set print union} in @ref{Print Settings}). +@item address +@code{True} if the string representation of a pointer should include the +address, @code{False} if it shouldn't (see @code{set print address} in +@ref{Print Settings}). + @item deref_refs @code{True} if C@t{++} references should be resolved to the value they refer to, @code{False} (the default) if they shouldn't. Note that, unlike |