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  <yao.qi@linaro.org>

	* cp-valprint.c (cp_print_value): Remove local base_valaddr.
	* extension-priv.h (struct extension_language_ops)
	<apply_val_pretty_printer>: 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.
This commit is contained in:
Yao Qi
2016-11-11 08:38:31 +00:00
parent 65408fa680
commit 668e167446
10 changed files with 51 additions and 40 deletions

View File

@ -478,11 +478,11 @@ free_ext_lang_type_printers (struct ext_lang_type_printers *printers)
xfree (printers);
}
/* Try to pretty-print a value of type TYPE located at VALADDR
+ EMBEDDED_OFFSET, which came from the inferior at address ADDRESS
+ EMBEDDED_OFFSET, onto stdio stream STREAM according to OPTIONS.
VAL is the whole object that came from ADDRESS. VALADDR must point to
the head of VAL's contents buffer.
/* Try to pretty-print a value of type TYPE located at VAL's contents
buffer + EMBEDDED_OFFSET, which came from the inferior at address
ADDRESS + EMBEDDED_OFFSET, onto stdio stream STREAM according to
OPTIONS.
VAL is the whole object that came from ADDRESS.
Returns non-zero if the value was successfully pretty-printed.
Extension languages are tried in the order specified by
@ -496,10 +496,10 @@ free_ext_lang_type_printers (struct ext_lang_type_printers *printers)
errors that trigger an exception in the extension language. */
int
apply_ext_lang_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
apply_ext_lang_val_pretty_printer (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)
{
@ -512,7 +512,7 @@ apply_ext_lang_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
if (extlang->ops->apply_val_pretty_printer == NULL)
continue;
rc = extlang->ops->apply_val_pretty_printer (extlang, type, valaddr,
rc = extlang->ops->apply_val_pretty_printer (extlang, type,
embedded_offset, address,
stream, recurse, val,
options, language);