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/cp-valprint.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gdb/cp-valprint.c') diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 57d5d02..9432c83 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -490,7 +490,6 @@ cp_print_value (struct type *type, struct type *real_type, int skip = 0; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); - const gdb_byte *base_valaddr = NULL; struct value *base_val = NULL; if (BASETYPE_VIA_VIRTUAL (type, i)) @@ -551,18 +550,15 @@ cp_print_value (struct type *type, struct type *real_type, thisoffset = 0; boffset = 0; thistype = baseclass; - base_valaddr = value_contents_for_printing_const (base_val); do_cleanups (back_to); } else { - base_valaddr = valaddr; base_val = val; } } else { - base_valaddr = valaddr; base_val = val; } } @@ -591,7 +587,7 @@ cp_print_value (struct type *type, struct type *real_type, baseclass if possible. */ if (!options->raw) result - = apply_ext_lang_val_pretty_printer (baseclass, base_valaddr, + = apply_ext_lang_val_pretty_printer (baseclass, thisoffset + boffset, value_address (base_val), stream, recurse, -- cgit v1.1