From 668e167446b2777869f413841ec05aed59473d9f Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Fri, 11 Nov 2016 08:38:31 +0000 Subject: Remove apply_val_pretty_printer parameter valaddr This patch removes the parameter valaddr of extension_language_ops::apply_val_pretty_printer and remove const from "struct value *val". valaddr can be got in each extension language's implementation of apply_val_pretty_printer. gdb: 2016-11-11 Yao Qi * cp-valprint.c (cp_print_value): Remove local base_valaddr. * extension-priv.h (struct extension_language_ops) : Remove the second parameter. Remove const from "struct value *". Callers updated. * extension.c (apply_ext_lang_val_pretty_printer): Update comments. Remove parameter valaddr. Remove const from "struct value *". * extension.h (apply_ext_lang_val_pretty_printer): Update declaration. * guile/guile-internal.h (gdbscm_apply_val_pretty_printer): Update declaration. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Remove parameter valaddr. Remove const from "struct value *". * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Likewise. * python/python-internal.h (gdbpy_apply_val_pretty_printer): Update declaration. --- gdb/python/py-prettyprint.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/python/py-prettyprint.c') diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 3c6a5af..cbc168d 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -699,10 +699,10 @@ print_children (PyObject *printer, const char *hint, enum ext_lang_rc gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, - struct type *type, const gdb_byte *valaddr, + struct type *type, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, + struct value *val, const struct value_print_options *options, const struct language_defn *language) { @@ -714,6 +714,7 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, struct cleanup *cleanups; enum ext_lang_rc result = EXT_LANG_RC_NOP; enum string_repr_result print_result; + const gdb_byte *valaddr = value_contents_for_printing (val); /* No pretty-printer support for unavailable values. */ if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type))) @@ -725,9 +726,7 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, cleanups = ensure_python_env (gdbarch, language); /* Instantiate the printer. */ - if (valaddr) - valaddr += embedded_offset; - value = value_from_contents_and_address (type, valaddr, + value = value_from_contents_and_address (type, valaddr + embedded_offset, address + embedded_offset); set_value_component_location (value, val); -- cgit v1.1