aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-11 08:38:31 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-11 08:38:31 +0000
commit668e167446b2777869f413841ec05aed59473d9f (patch)
treecbccde5d014f42cfa1f393b6134f6c268cf1c0fa /gdb/guile
parent65408fa680538f997cdd4b6fb9d74f043a060801 (diff)
downloadfsf-binutils-gdb-668e167446b2777869f413841ec05aed59473d9f.zip
fsf-binutils-gdb-668e167446b2777869f413841ec05aed59473d9f.tar.gz
fsf-binutils-gdb-668e167446b2777869f413841ec05aed59473d9f.tar.bz2
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.
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/guile-internal.h4
-rw-r--r--gdb/guile/scm-pretty-print.c9
2 files changed, 6 insertions, 7 deletions
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
index 5f819b8..3865f77 100644
--- a/gdb/guile/guile-internal.h
+++ b/gdb/guile/guile-internal.h
@@ -597,10 +597,10 @@ extern void gdbscm_preserve_values
extern enum ext_lang_rc gdbscm_apply_val_pretty_printer
(const struct extension_language_defn *,
- 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);
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index afdd0c7..5253def 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -957,10 +957,10 @@ ppscm_print_children (SCM printer, enum display_hint hint,
enum ext_lang_rc
gdbscm_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)
{
@@ -973,6 +973,7 @@ gdbscm_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)))
@@ -984,9 +985,7 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang,
cleanups = make_cleanup (null_cleanup, NULL);
/* 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);