diff options
author | Tom Tromey <tom@tromey.com> | 2018-07-08 12:17:36 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-22 13:20:04 -0600 |
commit | c51f6a54c28aaf2039f95553ff897338475fe8bf (patch) | |
tree | 9cb4912c262bed98a5ff4927bc4f50db93715f9a /gdb/python | |
parent | 374fd1fd7b9bbefc15c003f14f4229ccbfc1bfc8 (diff) | |
download | gdb-c51f6a54c28aaf2039f95553ff897338475fe8bf.zip gdb-c51f6a54c28aaf2039f95553ff897338475fe8bf.tar.gz gdb-c51f6a54c28aaf2039f95553ff897338475fe8bf.tar.bz2 |
Call value_fetch_lazy when needed in pretty-printers
This removes some unused variables, and replaces the calls to
value_contents_for_printing with a call to value_fetch_lazy, when
needed.
gdb/ChangeLog
2018-07-22 Tom Tromey <tom@tromey.com>
* python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Remove
unused variable. Call value_fetch_lazy when needed.
* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer):
Remove unused variable. Call value_fetch_lazy when needed.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-prettyprint.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 21b1ce9..a8a8489 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -662,7 +662,9 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, struct gdbarch *gdbarch = get_type_arch (type); struct value *value; enum string_repr_result print_result; - const gdb_byte *valaddr = value_contents_for_printing (val); + + if (value_lazy (val)) + value_fetch_lazy (val); /* No pretty-printer support for unavailable values. */ if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type))) |