Remove parameter valaddr from la_val_print

Nowadays, we pass both val and return value of
value_contents_for_printing (val) to la_val_print.  The latter is
unnecessary.  This patch removes the second parameter of la_val_print,
and get valaddr in each language's implementation by calling
value_contents_for_printing.  Since value_contents_for_printing calls
value_fetch_lazy, I also make VAL non-const.

Note that
 - I don't clean up the valaddr usages in each language's routines,
 - I don't remove valaddr from apply_ext_lang_val_pretty_printer, and
   extension language ops apply_val_pretty_printer.

They can be done in followup patches.

gdb:

2016-11-08  Yao Qi  <yao.qi@linaro.org>

	* ada-lang.h (ada_val_print): Remove second parameter.  Remove
	const from "struct value *".
	* ada-valprint.c (print_field_values): Remove const from
	"struct value *".
	(val_print_packed_array_elements): Likewise.
	(print_variant_part): Likewise.
	(ada_val_print_string): Likewise.
	(ada_val_print_gnat_array): Likewise.
	(ada_val_print_ptr): Likewise.
	(ada_val_print_num): Likewise.
	(ada_val_print_enum): Likewise.
	(ada_val_print_flt): Likewise.
	(ada_val_print_union): Likewise.
	(ada_val_print_struct_union): Likewise.
	(ada_val_print_ref): Likewise.
	(ada_val_print_1): Remove second parameter.  Remove const from
	"struct value *".
	(ada_val_print): Likewise.
	* c-lang.h (c_val_print): Likewise.
	* c-valprint.c (c_val_print_array): Remove const from
	"struct value *".
	(c_val_print_ptr): Likewise.
	(c_val_print_struct): Likewise.
	(c_val_print_union): Likewise.
	(c_val_print_int): Likewise.
	(c_val_print_memberptr): Likewise.
	(c_val_print): Remove second parameter.  Remove const from
	"struct value *".  All callers updated.
	* cp-valprint.c (cp_print_value): Remove const from
	"struct value *".
	(cp_print_value_fields): Likewise.
	(c_val_print_value): Likewise.
	* d-lang.h (d_val_print): Remove second parameter.  Remove const
	from "struct value *".
	* d-valprint.c (dynamic_array_type): Likewise.
	(d_val_print): Likewise.
	* f-lang.h (f_val_print): Likewise.
	* f-valprint.c (f_val_print): Likewise.
	* go-lang.h (go_val_print): Likewise.
	* go-valprint.c (print_go_string): Likewise.
	(go_val_print): Likewise.
	* language.c (unk_lang_val_print): Likewise.
	* language.h (struct language_defn) <la_val_print>: Likewise.
	Update comments.
	(LA_VAL_PRINT): Remove.
	* m2-lang.h (m2_val_print): Remove const from
	"struct value *".
	* m2-valprint.c (m2_print_array_contents): Likewise.
	(m2_val_print): Likewise.
	* p-lang.h (pascal_val_print): Remove second parameter.  Remove
	const from "struct value *".
	(pascal_object_print_value_fields): Likewise.
	* p-valprint.c (pascal_val_print): Likewise.
	(pascal_object_print_value_fields): Likewise.
	(pascal_object_print_value): Likewise.
	* rust-lang.c (rust_get_disr_info): Likewise.
	(val_print_struct): Likewise.
	(rust_val_print): Likewise.
	* valprint.c (generic_val_print_array): Likewise.
	(generic_val_print_ptr): Likewise.
	(generic_val_print_memberptr): Likewise.
	(generic_val_print_ref): Likewise.
	(generic_val_print_enum): Likewise.
	(generic_val_print_flags): Likewise.
	(generic_val_print_func): Likewise.
	(generic_val_print_bool): Likewise.
	(generic_val_print_int): Likewise.
	(generic_val_print_char): Likewise.
	(generic_val_print_float): Likewise.
	(generic_val_print_decfloat): Likewise.
	(generic_val_print_complex): Likewise.
	(generic_val_print): Likewise.
	(val_print): Likewise.
	(common_val_print): Likewise.
	(val_print_type_code_flags): Likewise.
	(val_print_scalar_formatted): Likewise.
	(val_print_array_elements): Likewise.
	* valprint.h (val_print_array_elements): Update declaration.
	(val_print_scalar_formatted): Likewise.
	(generic_val_print): Likewise.
	* value.h (val_print): Likewise.
This commit is contained in:
Yao Qi 2016-11-08 16:02:42 +00:00
parent cc977dc7d5
commit e8b24d9ff5
28 changed files with 334 additions and 235 deletions

View file

@ -1,3 +1,87 @@
2016-11-08 Yao Qi <yao.qi@linaro.org>
* ada-lang.h (ada_val_print): Remove second parameter. Remove
const from "struct value *".
* ada-valprint.c (print_field_values): Remove const from
"struct value *".
(val_print_packed_array_elements): Likewise.
(print_variant_part): Likewise.
(ada_val_print_string): Likewise.
(ada_val_print_gnat_array): Likewise.
(ada_val_print_ptr): Likewise.
(ada_val_print_num): Likewise.
(ada_val_print_enum): Likewise.
(ada_val_print_flt): Likewise.
(ada_val_print_union): Likewise.
(ada_val_print_struct_union): Likewise.
(ada_val_print_ref): Likewise.
(ada_val_print_1): Remove second parameter. Remove const from
"struct value *".
(ada_val_print): Likewise.
* c-lang.h (c_val_print): Likewise.
* c-valprint.c (c_val_print_array): Remove const from
"struct value *".
(c_val_print_ptr): Likewise.
(c_val_print_struct): Likewise.
(c_val_print_union): Likewise.
(c_val_print_int): Likewise.
(c_val_print_memberptr): Likewise.
(c_val_print): Remove second parameter. Remove const from
"struct value *". All callers updated.
* cp-valprint.c (cp_print_value): Remove const from
"struct value *".
(cp_print_value_fields): Likewise.
(c_val_print_value): Likewise.
* d-lang.h (d_val_print): Remove second parameter. Remove const
from "struct value *".
* d-valprint.c (dynamic_array_type): Likewise.
(d_val_print): Likewise.
* f-lang.h (f_val_print): Likewise.
* f-valprint.c (f_val_print): Likewise.
* go-lang.h (go_val_print): Likewise.
* go-valprint.c (print_go_string): Likewise.
(go_val_print): Likewise.
* language.c (unk_lang_val_print): Likewise.
* language.h (struct language_defn) <la_val_print>: Likewise.
Update comments.
(LA_VAL_PRINT): Remove.
* m2-lang.h (m2_val_print): Remove const from
"struct value *".
* m2-valprint.c (m2_print_array_contents): Likewise.
(m2_val_print): Likewise.
* p-lang.h (pascal_val_print): Remove second parameter. Remove
const from "struct value *".
(pascal_object_print_value_fields): Likewise.
* p-valprint.c (pascal_val_print): Likewise.
(pascal_object_print_value_fields): Likewise.
(pascal_object_print_value): Likewise.
* rust-lang.c (rust_get_disr_info): Likewise.
(val_print_struct): Likewise.
(rust_val_print): Likewise.
* valprint.c (generic_val_print_array): Likewise.
(generic_val_print_ptr): Likewise.
(generic_val_print_memberptr): Likewise.
(generic_val_print_ref): Likewise.
(generic_val_print_enum): Likewise.
(generic_val_print_flags): Likewise.
(generic_val_print_func): Likewise.
(generic_val_print_bool): Likewise.
(generic_val_print_int): Likewise.
(generic_val_print_char): Likewise.
(generic_val_print_float): Likewise.
(generic_val_print_decfloat): Likewise.
(generic_val_print_complex): Likewise.
(generic_val_print): Likewise.
(val_print): Likewise.
(common_val_print): Likewise.
(val_print_type_code_flags): Likewise.
(val_print_scalar_formatted): Likewise.
(val_print_array_elements): Likewise.
* valprint.h (val_print_array_elements): Update declaration.
(val_print_scalar_formatted): Likewise.
(generic_val_print): Likewise.
* value.h (val_print): Likewise.
2016-11-08 Yao Qi <yao.qi@linaro.org> 2016-11-08 Yao Qi <yao.qi@linaro.org>
* mt-tdep.c (mt_registers_info): Call * mt-tdep.c (mt_registers_info): Call

View file

@ -168,9 +168,9 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream); struct ui_file *stream);
extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, extern void ada_val_print (struct type *, int, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *); const struct value_print_options *);
extern void ada_value_print (struct value *, struct ui_file *, extern void ada_value_print (struct value *, struct ui_file *,

View file

@ -35,7 +35,7 @@
static int print_field_values (struct type *, const gdb_byte *, static int print_field_values (struct type *, const gdb_byte *,
int, int,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
int, struct type *, int, int, struct type *, int,
const struct language_defn *); const struct language_defn *);
@ -122,7 +122,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
int offset, int offset,
int bitoffset, struct ui_file *stream, int bitoffset, struct ui_file *stream,
int recurse, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
unsigned int i; unsigned int i;
@ -196,7 +196,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (elttype, value_contents_for_printing (v0), val_print (elttype,
value_embedded_offset (v0), 0, stream, value_embedded_offset (v0), 0, stream,
recurse + 1, v0, &opts, current_language); recurse + 1, v0, &opts, current_language);
annotate_elt_rep (i - i0); annotate_elt_rep (i - i0);
@ -227,7 +227,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
maybe_print_array_index (index_type, j + low, maybe_print_array_index (index_type, j + low,
stream, options); stream, options);
} }
val_print (elttype, value_contents_for_printing (v0), val_print (elttype,
value_embedded_offset (v0), 0, stream, value_embedded_offset (v0), 0, stream,
recurse + 1, v0, &opts, current_language); recurse + 1, v0, &opts, current_language);
annotate_elt (); annotate_elt ();
@ -534,7 +534,7 @@ static int
print_variant_part (struct type *type, int field_num, print_variant_part (struct type *type, int field_num,
const gdb_byte *valaddr, int offset, const gdb_byte *valaddr, int offset,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
int comma_needed, int comma_needed,
struct type *outer_type, int outer_offset, struct type *outer_type, int outer_offset,
@ -574,7 +574,7 @@ print_variant_part (struct type *type, int field_num,
static int static int
print_field_values (struct type *type, const gdb_byte *valaddr, print_field_values (struct type *type, const gdb_byte *valaddr,
int offset, struct ui_file *stream, int recurse, int offset, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
int comma_needed, int comma_needed,
struct type *outer_type, int outer_offset, struct type *outer_type, int outer_offset,
@ -634,8 +634,6 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
if (TYPE_FIELD_PACKED (type, i)) if (TYPE_FIELD_PACKED (type, i))
{ {
struct value *v;
/* Bitfields require special handling, especially due to byte /* Bitfields require special handling, especially due to byte
order problems. */ order problems. */
if (HAVE_CPLUS_STRUCT (type) && TYPE_FIELD_IGNORE (type, i)) if (HAVE_CPLUS_STRUCT (type) && TYPE_FIELD_IGNORE (type, i))
@ -644,6 +642,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
} }
else else
{ {
struct value *v;
int bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_pos = TYPE_FIELD_BITPOS (type, i);
int bit_size = TYPE_FIELD_BITSIZE (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i);
struct value_print_options opts; struct value_print_options opts;
@ -657,7 +656,6 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
opts = *options; opts = *options;
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i), val_print (TYPE_FIELD_TYPE (type, i),
value_contents_for_printing (v),
value_embedded_offset (v), 0, value_embedded_offset (v), 0,
stream, recurse + 1, v, stream, recurse + 1, v,
&opts, language); &opts, language);
@ -668,7 +666,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i), valaddr, val_print (TYPE_FIELD_TYPE (type, i),
(offset + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT), (offset + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
0, stream, recurse + 1, val, &opts, language); 0, stream, recurse + 1, val, &opts, language);
} }
@ -685,7 +683,7 @@ static void
ada_val_print_string (struct type *type, const gdb_byte *valaddr, ada_val_print_string (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
@ -733,7 +731,7 @@ static void
ada_val_print_gnat_array (struct type *type, const gdb_byte *valaddr, ada_val_print_gnat_array (struct type *type, const gdb_byte *valaddr,
int offset, CORE_ADDR address, int offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -755,7 +753,7 @@ ada_val_print_gnat_array (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, "0x0"); fprintf_filtered (stream, "0x0");
} }
else else
val_print (value_type (val), value_contents_for_printing (val), val_print (value_type (val),
value_embedded_offset (val), value_address (val), value_embedded_offset (val), value_address (val),
stream, recurse, val, options, language); stream, recurse, val, options, language);
value_free_to_mark (mark); value_free_to_mark (mark);
@ -768,11 +766,11 @@ static void
ada_val_print_ptr (struct type *type, const gdb_byte *valaddr, ada_val_print_ptr (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
val_print (type, valaddr, offset, address, stream, recurse, val_print (type, offset, address, stream, recurse,
original_value, options, language_def (language_c)); original_value, options, language_def (language_c));
if (ada_is_tag_type (type)) if (ada_is_tag_type (type))
@ -795,7 +793,7 @@ static void
ada_val_print_num (struct type *type, const gdb_byte *valaddr, ada_val_print_num (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -821,12 +819,12 @@ ada_val_print_num (struct type *type, const gdb_byte *valaddr,
= value_from_contents_and_address (type, valaddr + offset, 0); = value_from_contents_and_address (type, valaddr + offset, 0);
struct value *v = value_cast (target_type, v1); struct value *v = value_cast (target_type, v1);
val_print (target_type, value_contents_for_printing (v), val_print (target_type,
value_embedded_offset (v), 0, stream, value_embedded_offset (v), 0, stream,
recurse + 1, v, options, language); recurse + 1, v, options, language);
} }
else else
val_print (TYPE_TARGET_TYPE (type), valaddr, offset, val_print (TYPE_TARGET_TYPE (type), offset,
address, stream, recurse, original_value, address, stream, recurse, original_value,
options, language); options, language);
return; return;
@ -841,7 +839,7 @@ ada_val_print_num (struct type *type, const gdb_byte *valaddr,
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = format; opts.format = format;
val_print_scalar_formatted (type, valaddr, offset_aligned, val_print_scalar_formatted (type, offset_aligned,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else if (ada_is_system_address_type (type)) else if (ada_is_system_address_type (type))
@ -885,7 +883,7 @@ static void
ada_val_print_enum (struct type *type, const gdb_byte *valaddr, ada_val_print_enum (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -895,7 +893,7 @@ ada_val_print_enum (struct type *type, const gdb_byte *valaddr,
if (options->format) if (options->format)
{ {
val_print_scalar_formatted (type, valaddr, offset_aligned, val_print_scalar_formatted (type, offset_aligned,
original_value, options, 0, stream); original_value, options, 0, stream);
return; return;
} }
@ -929,13 +927,13 @@ static void
ada_val_print_flt (struct type *type, const gdb_byte *valaddr, ada_val_print_flt (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
if (options->format) if (options->format)
{ {
val_print (type, valaddr, offset, address, stream, recurse, val_print (type, offset, address, stream, recurse,
original_value, options, language_def (language_c)); original_value, options, language_def (language_c));
return; return;
} }
@ -950,7 +948,7 @@ static void
ada_val_print_struct_union ada_val_print_struct_union
(struct type *type, const gdb_byte *valaddr, int offset, (struct type *type, const gdb_byte *valaddr, int offset,
int offset_aligned, CORE_ADDR address, struct ui_file *stream, int offset_aligned, CORE_ADDR address, struct ui_file *stream,
int recurse, const struct value *original_value, int recurse, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -981,7 +979,7 @@ static void
ada_val_print_array (struct type *type, const gdb_byte *valaddr, ada_val_print_array (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
/* For an array of characters, print with string syntax. */ /* For an array of characters, print with string syntax. */
@ -1001,7 +999,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr,
0, stream, recurse, 0, stream, recurse,
original_value, options); original_value, options);
else else
val_print_array_elements (type, valaddr, offset_aligned, address, val_print_array_elements (type, offset_aligned, address,
stream, recurse, original_value, stream, recurse, original_value,
options, 0); options, 0);
fprintf_filtered (stream, ")"); fprintf_filtered (stream, ")");
@ -1014,7 +1012,7 @@ static void
ada_val_print_ref (struct type *type, const gdb_byte *valaddr, ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
int offset, int offset_aligned, CORE_ADDR address, int offset, int offset_aligned, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -1064,7 +1062,6 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
ada_ensure_varsize_limit (value_type (deref_val)); ada_ensure_varsize_limit (value_type (deref_val));
val_print (value_type (deref_val), val_print (value_type (deref_val),
value_contents_for_printing (deref_val),
value_embedded_offset (deref_val), value_embedded_offset (deref_val),
value_address (deref_val), stream, recurse + 1, value_address (deref_val), stream, recurse + 1,
deref_val, options, language); deref_val, options, language);
@ -1074,14 +1071,15 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
does not catch evaluation errors (leaving that to ada_val_print). */ does not catch evaluation errors (leaving that to ada_val_print). */
static void static void
ada_val_print_1 (struct type *type, const gdb_byte *valaddr, ada_val_print_1 (struct type *type,
int offset, CORE_ADDR address, int offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
int offset_aligned; int offset_aligned;
const gdb_byte *valaddr = value_contents_for_printing (original_value);
type = ada_check_typedef (type); type = ada_check_typedef (type);
@ -1103,7 +1101,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
{ {
default: default:
val_print (type, valaddr, offset, address, stream, recurse, val_print (type, offset, address, stream, recurse,
original_value, options, language_def (language_c)); original_value, options, language_def (language_c));
break; break;
@ -1157,17 +1155,17 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
function; they are identical. */ function; they are identical. */
void void
ada_val_print (struct type *type, const gdb_byte *valaddr, ada_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
/* XXX: this catches QUIT/ctrl-c as well. Isn't that busted? */ /* XXX: this catches QUIT/ctrl-c as well. Isn't that busted? */
TRY TRY
{ {
ada_val_print_1 (type, valaddr, embedded_offset, address, ada_val_print_1 (type, embedded_offset, address,
stream, recurse, val, options, stream, recurse, val, options,
current_language); current_language);
} }
@ -1222,7 +1220,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
opts = *options; opts = *options;
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (type, value_contents_for_printing (val), val_print (type,
value_embedded_offset (val), address, value_embedded_offset (val), address,
stream, 0, val, &opts, current_language); stream, 0, val, &opts, current_language);
} }

View file

@ -76,10 +76,10 @@ extern void c_print_typedef (struct type *,
struct symbol *, struct symbol *,
struct ui_file *); struct ui_file *);
extern void c_val_print (struct type *, const gdb_byte *, extern void c_val_print (struct type *,
int, CORE_ADDR, int, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *); const struct value_print_options *);
extern void c_value_print (struct value *, struct ui_file *, extern void c_value_print (struct value *, struct ui_file *,
@ -125,14 +125,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *,
extern void cp_print_value_fields (struct type *, struct type *, extern void cp_print_value_fields (struct type *, struct type *,
const gdb_byte *, LONGEST, CORE_ADDR, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
struct type **, int); struct type **, int);
extern void cp_print_value_fields_rtti (struct type *, extern void cp_print_value_fields_rtti (struct type *,
const gdb_byte *, LONGEST, CORE_ADDR, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
struct type **, int); struct type **, int);

View file

@ -233,7 +233,7 @@ static void
c_val_print_array (struct type *type, const gdb_byte *valaddr, c_val_print_array (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct type *unresolved_elttype = TYPE_TARGET_TYPE (type); struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
@ -325,7 +325,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
{ {
i = 0; i = 0;
} }
val_print_array_elements (type, valaddr, embedded_offset, val_print_array_elements (type, embedded_offset,
address, stream, address, stream,
recurse, original_value, options, i); recurse, original_value, options, i);
fprintf_filtered (stream, "}"); fprintf_filtered (stream, "}");
@ -345,7 +345,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
static void static void
c_val_print_ptr (struct type *type, const gdb_byte *valaddr, c_val_print_ptr (struct type *type, const gdb_byte *valaddr,
int embedded_offset, struct ui_file *stream, int recurse, int embedded_offset, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *arch = get_type_arch (type); struct gdbarch *arch = get_type_arch (type);
@ -353,7 +353,7 @@ c_val_print_ptr (struct type *type, const gdb_byte *valaddr,
if (options->format && options->format != 's') if (options->format && options->format != 's')
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
} }
else if (options->vtblprint && cp_is_vtbl_ptr_type (type)) else if (options->vtblprint && cp_is_vtbl_ptr_type (type))
@ -386,7 +386,7 @@ static void
c_val_print_struct (struct type *type, const gdb_byte *valaddr, c_val_print_struct (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
if (options->vtblprint && cp_is_vtbl_ptr_type (type)) if (options->vtblprint && cp_is_vtbl_ptr_type (type))
@ -418,7 +418,7 @@ static void
c_val_print_union (struct type *type, const gdb_byte *valaddr, c_val_print_union (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
if (recurse && !options->unionprint) if (recurse && !options->unionprint)
@ -437,7 +437,7 @@ c_val_print_union (struct type *type, const gdb_byte *valaddr,
static void static void
c_val_print_int (struct type *type, struct type *unresolved_type, c_val_print_int (struct type *type, struct type *unresolved_type,
const gdb_byte *valaddr, int embedded_offset, const gdb_byte *valaddr, int embedded_offset,
struct ui_file *stream, const struct value *original_value, struct ui_file *stream, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *arch = get_type_arch (type); struct gdbarch *arch = get_type_arch (type);
@ -449,7 +449,7 @@ c_val_print_int (struct type *type, struct type *unresolved_type,
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else else
@ -476,7 +476,7 @@ static void
c_val_print_memberptr (struct type *type, const gdb_byte *valaddr, c_val_print_memberptr (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
if (!options->format) if (!options->format)
@ -485,7 +485,7 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr,
} }
else else
{ {
generic_val_print (type, valaddr, embedded_offset, address, stream, generic_val_print (type, embedded_offset, address, stream,
recurse, original_value, options, &c_decorations); recurse, original_value, options, &c_decorations);
} }
} }
@ -494,13 +494,14 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr,
function; they are identical. */ function; they are identical. */
void void
c_val_print (struct type *type, const gdb_byte *valaddr, c_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct type *unresolved_type = type; struct type *unresolved_type = type;
const gdb_byte *valaddr = value_contents_for_printing (original_value);
type = check_typedef (type); type = check_typedef (type);
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
@ -554,7 +555,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
default: default:
generic_val_print (type, valaddr, embedded_offset, address, generic_val_print (type, embedded_offset, address,
stream, recurse, original_value, options, stream, recurse, original_value, options,
&c_decorations); &c_decorations);
break; break;
@ -669,7 +670,7 @@ c_value_print (struct value *val, struct ui_file *stream,
/* Print out object: enclosing type is same as real_type if /* Print out object: enclosing type is same as real_type if
full. */ full. */
val_print (value_enclosing_type (val), val_print (value_enclosing_type (val),
value_contents_for_printing (val), 0, 0,
value_address (val), stream, 0, value_address (val), stream, 0,
val, &opts, current_language); val, &opts, current_language);
return; return;
@ -682,7 +683,7 @@ c_value_print (struct value *val, struct ui_file *stream,
fprintf_filtered (stream, "(%s ?) ", fprintf_filtered (stream, "(%s ?) ",
TYPE_NAME (value_enclosing_type (val))); TYPE_NAME (value_enclosing_type (val)));
val_print (value_enclosing_type (val), val_print (value_enclosing_type (val),
value_contents_for_printing (val), 0, 0,
value_address (val), stream, 0, value_address (val), stream, 0,
val, &opts, current_language); val, &opts, current_language);
return; return;
@ -690,7 +691,7 @@ c_value_print (struct value *val, struct ui_file *stream,
/* Otherwise, we end up at the return outside this "if". */ /* Otherwise, we end up at the return outside this "if". */
} }
val_print (val_type, value_contents_for_printing (val), val_print (val_type,
value_embedded_offset (val), value_embedded_offset (val),
value_address (val), value_address (val),
stream, 0, stream, 0,

View file

@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *,
static void cp_print_value (struct type *, struct type *, static void cp_print_value (struct type *, struct type *,
const gdb_byte *, LONGEST, const gdb_byte *, LONGEST,
CORE_ADDR, struct ui_file *, CORE_ADDR, struct ui_file *,
int, const struct value *, int, struct value *,
const struct value_print_options *, const struct value_print_options *,
struct type **); struct type **);
@ -156,7 +156,7 @@ void
cp_print_value_fields (struct type *type, struct type *real_type, cp_print_value_fields (struct type *type, struct type *real_type,
const gdb_byte *valaddr, LONGEST offset, const gdb_byte *valaddr, LONGEST offset,
CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, const struct value *val, int recurse, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
struct type **dont_print_vb, struct type **dont_print_vb,
int dont_print_statmem) int dont_print_statmem)
@ -353,7 +353,6 @@ cp_print_value_fields (struct type *type, struct type *real_type,
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i), val_print (TYPE_FIELD_TYPE (type, i),
valaddr,
offset + TYPE_FIELD_BITPOS (type, i) / 8, offset + TYPE_FIELD_BITPOS (type, i) / 8,
address, address,
stream, recurse + 1, val, &opts, stream, recurse + 1, val, &opts,
@ -420,7 +419,7 @@ cp_print_value_fields_rtti (struct type *type,
const gdb_byte *valaddr, LONGEST offset, const gdb_byte *valaddr, LONGEST offset,
CORE_ADDR address, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
struct type **dont_print_vb, struct type **dont_print_vb,
int dont_print_statmem) int dont_print_statmem)
@ -462,7 +461,7 @@ static void
cp_print_value (struct type *type, struct type *real_type, cp_print_value (struct type *type, struct type *real_type,
const gdb_byte *valaddr, LONGEST offset, const gdb_byte *valaddr, LONGEST offset,
CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, const struct value *val, int recurse, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
struct type **dont_print_vb) struct type **dont_print_vb)
{ {
@ -489,7 +488,7 @@ cp_print_value (struct type *type, struct type *real_type,
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
const char *basename = TYPE_NAME (baseclass); const char *basename = TYPE_NAME (baseclass);
const gdb_byte *base_valaddr = NULL; const gdb_byte *base_valaddr = NULL;
const struct value *base_val = NULL; struct value *base_val = NULL;
if (BASETYPE_VIA_VIRTUAL (type, i)) if (BASETYPE_VIA_VIRTUAL (type, i))
{ {
@ -708,7 +707,7 @@ cp_print_static_field (struct type *type,
opts = *options; opts = *options;
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (type, value_contents_for_printing (val), val_print (type,
value_embedded_offset (val), value_embedded_offset (val),
value_address (val), value_address (val),
stream, recurse, val, stream, recurse, val,

View file

@ -80,10 +80,10 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *,
/* Defined in d-valprint.c */ /* Defined in d-valprint.c */
extern void d_val_print (struct type *type, const gdb_byte *valaddr, extern void d_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options); const struct value_print_options *options);
#endif /* !defined (D_LANG_H) */ #endif /* !defined (D_LANG_H) */

View file

@ -28,10 +28,10 @@
TYPE is a dynamic array, non-zero otherwise. */ TYPE is a dynamic array, non-zero otherwise. */
static int static int
dynamic_array_type (struct type *type, const gdb_byte *valaddr, dynamic_array_type (struct type *type,
LONGEST embedded_offset, CORE_ADDR address, LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
if (TYPE_NFIELDS (type) == 2 if (TYPE_NFIELDS (type) == 2
@ -48,6 +48,7 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr,
struct type *ptr_type; struct type *ptr_type;
struct value *ival; struct value *ival;
int length; int length;
const gdb_byte *valaddr = value_contents_for_printing (val);
length = unpack_field_as_long (type, valaddr + embedded_offset, 0); length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
@ -63,7 +64,6 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr,
true_type = value_type (ival); true_type = value_type (ival);
d_val_print (true_type, d_val_print (true_type,
value_contents_for_printing (ival),
value_embedded_offset (ival), addr, value_embedded_offset (ival), addr,
stream, recurse + 1, ival, options); stream, recurse + 1, ival, options);
return 0; return 0;
@ -73,9 +73,9 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr,
/* Implements the la_val_print routine for language D. */ /* Implements the la_val_print routine for language D. */
void void
d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, d_val_print (struct type *type, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
int ret; int ret;
@ -84,12 +84,12 @@ d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
{ {
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
ret = dynamic_array_type (type, valaddr, embedded_offset, address, ret = dynamic_array_type (type, embedded_offset, address,
stream, recurse, val, options); stream, recurse, val, options);
if (ret == 0) if (ret == 0)
break; break;
default: default:
c_val_print (type, valaddr, embedded_offset, address, stream, c_val_print (type, embedded_offset, address, stream,
recurse, val, options); recurse, val, options);
} }
} }

View file

@ -30,9 +30,9 @@ extern void f_yyerror (char *); /* Defined in f-exp.y */
extern void f_print_type (struct type *, const char *, struct ui_file *, int, extern void f_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *); int, const struct type_print_options *);
extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, extern void f_val_print (struct type *, int, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *); const struct value_print_options *);
/* Language-specific data structures */ /* Language-specific data structures */

View file

@ -152,7 +152,6 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
struct value *elt = value_subscript ((struct value *)val, i); struct value *elt = value_subscript ((struct value *)val, i);
val_print (value_type (elt), val_print (value_type (elt),
value_contents_for_printing (elt),
value_embedded_offset (elt), value_embedded_offset (elt),
value_address (elt), stream, recurse, value_address (elt), stream, recurse,
elt, options, current_language); elt, options, current_language);
@ -211,9 +210,9 @@ static const struct generic_val_print_decorations f_decorations =
function; they are identical. */ function; they are identical. */
void void
f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, f_val_print (struct type *type, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -222,6 +221,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
struct type *elttype; struct type *elttype;
CORE_ADDR addr; CORE_ADDR addr;
int index; int index;
const gdb_byte *valaddr =value_contents_for_printing (original_value);
type = check_typedef (type); type = check_typedef (type);
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
@ -256,7 +256,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
if (options->format && options->format != 's') if (options->format && options->format != 's')
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
break; break;
} }
@ -306,7 +306,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else else
@ -355,7 +355,6 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
} }
val_print (value_type (field), val_print (value_type (field),
value_contents_for_printing (field),
value_embedded_offset (field), value_embedded_offset (field),
value_address (field), stream, recurse + 1, value_address (field), stream, recurse + 1,
field, options, current_language); field, options, current_language);
@ -378,7 +377,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
default: default:
generic_val_print (type, valaddr, embedded_offset, address, generic_val_print (type, embedded_offset, address,
stream, recurse, original_value, options, stream, recurse, original_value, options,
&f_decorations); &f_decorations);
break; break;

View file

@ -84,10 +84,10 @@ extern void go_print_type (struct type *type, const char *varstring,
/* Defined in go-valprint.c. */ /* Defined in go-valprint.c. */
extern void go_val_print (struct type *type, const gdb_byte *valaddr, extern void go_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options); const struct value_print_options *options);
#endif /* !defined (GO_LANG_H) */ #endif /* !defined (GO_LANG_H) */

View file

@ -36,10 +36,10 @@
gdb_assert (go_classify_struct_type (type) == GO_TYPE_STRING). */ gdb_assert (go_classify_struct_type (type) == GO_TYPE_STRING). */
static void static void
print_go_string (struct type *type, const gdb_byte *valaddr, print_go_string (struct type *type,
LONGEST embedded_offset, CORE_ADDR address, LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -51,8 +51,8 @@ print_go_string (struct type *type, const gdb_byte *valaddr,
unpack_value_field_as_pointer. Do this until we can get unpack_value_field_as_pointer. Do this until we can get
unpack_value_field_as_pointer. */ unpack_value_field_as_pointer. */
LONGEST addr; LONGEST addr;
const gdb_byte *valaddr = value_contents_for_printing (val);
gdb_assert (valaddr == value_contents_for_printing_const (val));
if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0, if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0,
val, &addr)) val, &addr))
@ -86,9 +86,9 @@ print_go_string (struct type *type, const gdb_byte *valaddr,
/* Implements the la_val_print routine for language Go. */ /* Implements the la_val_print routine for language Go. */
void void
go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, go_val_print (struct type *type, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
type = check_typedef (type); type = check_typedef (type);
@ -104,7 +104,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case GO_TYPE_STRING: case GO_TYPE_STRING:
if (! options->raw) if (! options->raw)
{ {
print_go_string (type, valaddr, embedded_offset, address, print_go_string (type, embedded_offset, address,
stream, recurse, val, options); stream, recurse, val, options);
return; return;
} }
@ -116,7 +116,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
/* Fall through. */ /* Fall through. */
default: default:
c_val_print (type, valaddr, embedded_offset, address, stream, c_val_print (type, embedded_offset, address, stream,
recurse, val, options); recurse, val, options);
break; break;
} }

View file

@ -2315,7 +2315,6 @@ default_print_one_register_info (struct ui_file *file,
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (regtype, val_print (regtype,
value_contents_for_printing (val),
value_embedded_offset (val), 0, value_embedded_offset (val), 0,
file, 0, val, &opts, current_language); file, 0, val, &opts, current_language);
@ -2334,7 +2333,6 @@ default_print_one_register_info (struct ui_file *file,
get_formatted_print_options (&opts, 'x'); get_formatted_print_options (&opts, 'x');
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (regtype, val_print (regtype,
value_contents_for_printing (val),
value_embedded_offset (val), 0, value_embedded_offset (val), 0,
file, 0, val, &opts, current_language); file, 0, val, &opts, current_language);
/* If not a vector register, print it also according to its /* If not a vector register, print it also according to its
@ -2345,7 +2343,6 @@ default_print_one_register_info (struct ui_file *file,
opts.deref_ref = 1; opts.deref_ref = 1;
fprintf_filtered (file, "\t"); fprintf_filtered (file, "\t");
val_print (regtype, val_print (regtype,
value_contents_for_printing (val),
value_embedded_offset (val), 0, value_embedded_offset (val), 0,
file, 0, val, &opts, current_language); file, 0, val, &opts, current_language);
} }

View file

@ -780,10 +780,10 @@ unk_lang_print_type (struct type *type, const char *varstring,
} }
static void static void
unk_lang_val_print (struct type *type, const gdb_byte *valaddr, unk_lang_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
error (_("internal error - unimplemented " error (_("internal error - unimplemented "

View file

@ -219,9 +219,6 @@ struct language_defn
TYPE is the type of the sub-object to be printed. TYPE is the type of the sub-object to be printed.
CONTENTS holds the bits of the value. This holds the entire
enclosing object.
EMBEDDED_OFFSET is the offset into the outermost object of the EMBEDDED_OFFSET is the offset into the outermost object of the
sub-object represented by TYPE. This is the object which this sub-object represented by TYPE. This is the object which this
call should print. Note that the enclosing type is not call should print. Note that the enclosing type is not
@ -237,10 +234,9 @@ struct language_defn
printing. */ printing. */
void (*la_val_print) (struct type *type, void (*la_val_print) (struct type *type,
const gdb_byte *contents,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options); const struct value_print_options *options);
/* Print a top-level value using syntax appropriate for this language. */ /* Print a top-level value using syntax appropriate for this language. */
@ -515,9 +511,6 @@ extern enum language set_language (enum language);
#define LA_PRINT_TYPEDEF(type,new_symbol,stream) \ #define LA_PRINT_TYPEDEF(type,new_symbol,stream) \
(current_language->la_print_typedef(type,new_symbol,stream)) (current_language->la_print_typedef(type,new_symbol,stream))
#define LA_VAL_PRINT(type,valaddr,offset,addr,stream,val,recurse,options) \
(current_language->la_val_print(type,valaddr,offset,addr,stream, \
val,recurse,options))
#define LA_VALUE_PRINT(val,stream,options) \ #define LA_VALUE_PRINT(val,stream,options) \
(current_language->la_value_print(val,stream,options)) (current_language->la_value_print(val,stream,options))

View file

@ -34,9 +34,9 @@ extern void m2_print_typedef (struct type *, struct symbol *,
extern int m2_is_long_set (struct type *type); extern int m2_is_long_set (struct type *type);
extern int m2_is_unbounded_array (struct type *type); extern int m2_is_unbounded_array (struct type *type);
extern void m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, extern void m2_val_print (struct type *, int, CORE_ADDR,
struct ui_file *, int, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *); const struct value_print_options *);
extern int get_long_set_bounds (struct type *type, LONGEST *low, extern int get_long_set_bounds (struct type *type, LONGEST *low,

View file

@ -37,7 +37,7 @@ static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr, m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
int len); int len);
@ -262,7 +262,7 @@ static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr, m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
int len) int len)
{ {
@ -282,7 +282,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
else else
{ {
fprintf_filtered (stream, "{"); fprintf_filtered (stream, "{");
val_print_array_elements (type, valaddr, embedded_offset, val_print_array_elements (type, embedded_offset,
address, stream, recurse, val, address, stream, recurse, val,
options, 0); options, 0);
fprintf_filtered (stream, "}"); fprintf_filtered (stream, "}");
@ -308,15 +308,16 @@ static const struct generic_val_print_decorations m2_decorations =
function; they are identical. */ function; they are identical. */
void void
m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, m2_val_print (struct type *type, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
unsigned len; unsigned len;
struct type *elttype; struct type *elttype;
CORE_ADDR addr; CORE_ADDR addr;
const gdb_byte *valaddr = value_contents_for_printing (original_value);
type = check_typedef (type); type = check_typedef (type);
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
@ -356,7 +357,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
else else
{ {
fprintf_filtered (stream, "{"); fprintf_filtered (stream, "{");
val_print_array_elements (type, valaddr, embedded_offset, val_print_array_elements (type, embedded_offset,
address, stream, address, stream,
recurse, original_value, recurse, original_value,
options, 0); options, 0);
@ -373,7 +374,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
print_variable_at_address (type, valaddr + embedded_offset, print_variable_at_address (type, valaddr + embedded_offset,
stream, recurse, options); stream, recurse, options);
else if (options->format && options->format != 's') else if (options->format && options->format != 's')
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
else else
{ {
@ -469,7 +470,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_RANGE: case TYPE_CODE_RANGE:
if (TYPE_LENGTH (type) == TYPE_LENGTH (TYPE_TARGET_TYPE (type))) if (TYPE_LENGTH (type) == TYPE_LENGTH (TYPE_TARGET_TYPE (type)))
{ {
m2_val_print (TYPE_TARGET_TYPE (type), valaddr, embedded_offset, m2_val_print (TYPE_TARGET_TYPE (type), embedded_offset,
address, stream, recurse, original_value, options); address, stream, recurse, original_value, options);
break; break;
} }
@ -494,7 +495,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
default: default:
generic_val_print (type, valaddr, embedded_offset, address, generic_val_print (type, embedded_offset, address,
stream, recurse, original_value, options, stream, recurse, original_value, options,
&m2_decorations); &m2_decorations);
break; break;

View file

@ -1290,7 +1290,6 @@ output_register (struct frame_info *frame, int regnum, int format,
get_formatted_print_options (&opts, format); get_formatted_print_options (&opts, format);
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (value_type (val), val_print (value_type (val),
value_contents_for_printing (val),
value_embedded_offset (val), 0, value_embedded_offset (val), 0,
stb, 0, val, &opts, current_language); stb, 0, val, &opts, current_language);
ui_out_field_stream (uiout, "value", stb); ui_out_field_stream (uiout, "value", stb);

View file

@ -6356,7 +6356,6 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
get_formatted_print_options (&opts, 'x'); get_formatted_print_options (&opts, 'x');
val_print_scalar_formatted (value_type (val), val_print_scalar_formatted (value_type (val),
value_contents_for_printing (val),
value_embedded_offset (val), value_embedded_offset (val),
val, val,
&opts, 0, file); &opts, 0, file);

View file

@ -726,7 +726,6 @@ mt_registers_info (struct gdbarch *gdbarch,
get_no_prettyformat_print_options (&opts); get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), val_print (register_type (gdbarch, regnum),
value_contents_for_printing (val),
0, 0, file, 0, val, 0, 0, file, 0, val,
&opts, current_language); &opts, current_language);
fputs_filtered ("\n", file); fputs_filtered ("\n", file);

View file

@ -36,9 +36,9 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *,
extern void pascal_print_typedef (struct type *, struct symbol *, extern void pascal_print_typedef (struct type *, struct symbol *,
struct ui_file *); struct ui_file *);
extern void pascal_val_print (struct type *, const gdb_byte *, int, extern void pascal_val_print (struct type *, int,
CORE_ADDR, struct ui_file *, int, CORE_ADDR, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *); const struct value_print_options *);
extern void pascal_value_print (struct value *, struct ui_file *, extern void pascal_value_print (struct value *, struct ui_file *,
@ -75,7 +75,7 @@ extern void pascal_object_print_value_fields (struct type *, const gdb_byte *,
LONGEST, LONGEST,
CORE_ADDR, struct ui_file *, CORE_ADDR, struct ui_file *,
int, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
struct type **, int); struct type **, int);

View file

@ -58,10 +58,10 @@ static const struct generic_val_print_decorations p_decorations =
function; they are identical. */ function; they are identical. */
void void
pascal_val_print (struct type *type, const gdb_byte *valaddr, pascal_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -75,6 +75,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
struct type *char_type; struct type *char_type;
CORE_ADDR addr; CORE_ADDR addr;
int want_space = 0; int want_space = 0;
const gdb_byte *valaddr = value_contents_for_printing (original_value);
type = check_typedef (type); type = check_typedef (type);
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
@ -132,7 +133,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
{ {
i = 0; i = 0;
} }
val_print_array_elements (type, valaddr, embedded_offset, val_print_array_elements (type, embedded_offset,
address, stream, recurse, address, stream, recurse,
original_value, options, i); original_value, options, i);
fprintf_filtered (stream, "}"); fprintf_filtered (stream, "}");
@ -146,7 +147,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
if (options->format && options->format != 's') if (options->format && options->format != 's')
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
break; break;
} }
@ -287,7 +288,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_UNDEF: case TYPE_CODE_UNDEF:
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
generic_val_print (type, valaddr, embedded_offset, address, generic_val_print (type, embedded_offset, address,
stream, recurse, original_value, options, stream, recurse, original_value, options,
&p_decorations); &p_decorations);
break; break;
@ -471,7 +472,7 @@ static void pascal_object_print_static_field (struct value *,
static void pascal_object_print_value (struct type *, const gdb_byte *, static void pascal_object_print_value (struct type *, const gdb_byte *,
LONGEST, LONGEST,
CORE_ADDR, struct ui_file *, int, CORE_ADDR, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
struct type **); struct type **);
@ -531,7 +532,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
LONGEST offset, LONGEST offset,
CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
struct type **dont_print_vb, struct type **dont_print_vb,
int dont_print_statmem) int dont_print_statmem)
@ -670,7 +671,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
address + TYPE_FIELD_BITPOS (type, i) / 8, 0, address + TYPE_FIELD_BITPOS (type, i) / 8, 0,
stream, format, 0, recurse + 1, pretty); */ stream, format, 0, recurse + 1, pretty); */
val_print (TYPE_FIELD_TYPE (type, i), val_print (TYPE_FIELD_TYPE (type, i),
valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8, offset + TYPE_FIELD_BITPOS (type, i) / 8,
address, stream, recurse + 1, val, &opts, address, stream, recurse + 1, val, &opts,
current_language); current_language);
} }
@ -703,7 +704,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
LONGEST offset, LONGEST offset,
CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
struct type **dont_print_vb) struct type **dont_print_vb)
{ {

View file

@ -322,7 +322,6 @@ print_formatted (struct value *val, int size,
/* User specified format, so don't look to the type to tell us /* User specified format, so don't look to the type to tell us
what to do. */ what to do. */
val_print_scalar_formatted (type, val_print_scalar_formatted (type,
value_contents_for_printing (val),
value_embedded_offset (val), value_embedded_offset (val),
val, val,
options, size, stream); options, size, stream);

View file

@ -120,7 +120,7 @@ rust_union_is_untagged (struct type *type)
static struct disr_info static struct disr_info
rust_get_disr_info (struct type *type, const gdb_byte *valaddr, rust_get_disr_info (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
const struct value *val) struct value *val)
{ {
int i; int i;
struct disr_info ret; struct disr_info ret;
@ -235,7 +235,7 @@ rust_get_disr_info (struct type *type, const gdb_byte *valaddr,
cleanup = make_cleanup_ui_file_delete (temp_file); cleanup = make_cleanup_ui_file_delete (temp_file);
/* The first value of the first field (or any field) /* The first value of the first field (or any field)
is the discriminant value. */ is the discriminant value. */
c_val_print (TYPE_FIELD_TYPE (disr_type, 0), valaddr, c_val_print (TYPE_FIELD_TYPE (disr_type, 0),
(embedded_offset + TYPE_FIELD_BITPOS (type, 0) / 8 (embedded_offset + TYPE_FIELD_BITPOS (type, 0) / 8
+ TYPE_FIELD_BITPOS (disr_type, 0) / 8), + TYPE_FIELD_BITPOS (disr_type, 0) / 8),
address, temp_file, address, temp_file,
@ -479,9 +479,9 @@ rust_printstr (struct ui_file *stream, struct type *type,
/* rust_print_type branch for structs and untagged unions. */ /* rust_print_type branch for structs and untagged unions. */
static void static void
val_print_struct (struct type *type, const gdb_byte *valaddr, val_print_struct (struct type *type, int embedded_offset,
int embedded_offset, CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, const struct value *val, int recurse, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
int i; int i;
@ -536,7 +536,6 @@ val_print_struct (struct type *type, const gdb_byte *valaddr,
} }
val_print (TYPE_FIELD_TYPE (type, i), val_print (TYPE_FIELD_TYPE (type, i),
valaddr,
embedded_offset + TYPE_FIELD_BITPOS (type, i) / 8, embedded_offset + TYPE_FIELD_BITPOS (type, i) / 8,
address, address,
stream, recurse + 1, val, &opts, stream, recurse + 1, val, &opts,
@ -572,11 +571,13 @@ static const struct generic_val_print_decorations rust_decorations =
/* la_val_print implementation for Rust. */ /* la_val_print implementation for Rust. */
static void static void
rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, rust_val_print (struct type *type, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options) const struct value_print_options *options)
{ {
const gdb_byte *valaddr = value_contents_for_printing (val);
type = check_typedef (type); type = check_typedef (type);
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
{ {
@ -613,7 +614,7 @@ rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_METHODPTR: case TYPE_CODE_METHODPTR:
case TYPE_CODE_MEMBERPTR: case TYPE_CODE_MEMBERPTR:
c_val_print (type, valaddr, embedded_offset, address, stream, c_val_print (type, embedded_offset, address, stream,
recurse, val, options); recurse, val, options);
break; break;
@ -672,7 +673,7 @@ rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
fields. */ fields. */
if (rust_union_is_untagged (type)) if (rust_union_is_untagged (type))
{ {
val_print_struct (type, valaddr, embedded_offset, address, stream, val_print_struct (type, embedded_offset, address, stream,
recurse, val, options); recurse, val, options);
break; break;
} }
@ -728,7 +729,6 @@ rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
TYPE_FIELD_NAME (variant_type, j)); TYPE_FIELD_NAME (variant_type, j));
val_print (TYPE_FIELD_TYPE (variant_type, j), val_print (TYPE_FIELD_TYPE (variant_type, j),
valaddr,
(embedded_offset (embedded_offset
+ TYPE_FIELD_BITPOS (type, disr.field_no) / 8 + TYPE_FIELD_BITPOS (type, disr.field_no) / 8
+ TYPE_FIELD_BITPOS (variant_type, j) / 8), + TYPE_FIELD_BITPOS (variant_type, j) / 8),
@ -745,14 +745,14 @@ rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break; break;
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
val_print_struct (type, valaddr, embedded_offset, address, stream, val_print_struct (type, embedded_offset, address, stream,
recurse, val, options); recurse, val, options);
break; break;
default: default:
generic_print: generic_print:
/* Nothing special yet. */ /* Nothing special yet. */
generic_val_print (type, valaddr, embedded_offset, address, stream, generic_val_print (type, embedded_offset, address, stream,
recurse, val, options, &rust_decorations); recurse, val, options, &rust_decorations);
} }
} }

View file

@ -2048,13 +2048,13 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
get_formatted_print_options (&opts, 'x'); get_formatted_print_options (&opts, 'x');
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), val_print (register_type (gdbarch, regnum),
value_contents_for_printing (val), 0, 0, 0, 0,
file, 0, val, &opts, current_language); file, 0, val, &opts, current_language);
fprintf_filtered (file, "\t"); fprintf_filtered (file, "\t");
get_formatted_print_options (&opts, 0); get_formatted_print_options (&opts, 0);
opts.deref_ref = 1; opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), val_print (register_type (gdbarch, regnum),
value_contents_for_printing (val), 0, 0, 0, 0,
file, 0, val, &opts, current_language); file, 0, val, &opts, current_language);
fprintf_filtered (file, "\n"); fprintf_filtered (file, "\n");
} }

View file

@ -421,10 +421,10 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
/* generic_val_print helper for TYPE_CODE_ARRAY. */ /* generic_val_print helper for TYPE_CODE_ARRAY. */
static void static void
generic_val_print_array (struct type *type, const gdb_byte *valaddr, generic_val_print_array (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct const struct
generic_val_print_decorations *decorations) generic_val_print_decorations *decorations)
@ -445,7 +445,7 @@ generic_val_print_array (struct type *type, const gdb_byte *valaddr,
} }
fputs_filtered (decorations->array_start, stream); fputs_filtered (decorations->array_start, stream);
val_print_array_elements (type, valaddr, embedded_offset, val_print_array_elements (type, embedded_offset,
address, stream, address, stream,
recurse, original_value, options, 0); recurse, original_value, options, 0);
fputs_filtered (decorations->array_end, stream); fputs_filtered (decorations->array_end, stream);
@ -462,9 +462,9 @@ generic_val_print_array (struct type *type, const gdb_byte *valaddr,
/* generic_val_print helper for TYPE_CODE_PTR. */ /* generic_val_print helper for TYPE_CODE_PTR. */
static void static void
generic_val_print_ptr (struct type *type, const gdb_byte *valaddr, generic_val_print_ptr (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -472,13 +472,14 @@ generic_val_print_ptr (struct type *type, const gdb_byte *valaddr,
if (options->format && options->format != 's') if (options->format && options->format != 's')
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
} }
else else
{ {
struct type *unresolved_elttype = TYPE_TARGET_TYPE(type); struct type *unresolved_elttype = TYPE_TARGET_TYPE(type);
struct type *elttype = check_typedef (unresolved_elttype); struct type *elttype = check_typedef (unresolved_elttype);
const gdb_byte *valaddr = value_contents_for_printing (original_value);
CORE_ADDR addr = unpack_pointer (type, CORE_ADDR addr = unpack_pointer (type,
valaddr + embedded_offset * unit_size); valaddr + embedded_offset * unit_size);
@ -490,12 +491,12 @@ generic_val_print_ptr (struct type *type, const gdb_byte *valaddr,
/* generic_val_print helper for TYPE_CODE_MEMBERPTR. */ /* generic_val_print helper for TYPE_CODE_MEMBERPTR. */
static void static void
generic_val_print_memberptr (struct type *type, const gdb_byte *valaddr, generic_val_print_memberptr (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
} }
@ -538,9 +539,9 @@ get_value_addr_contents (struct value *deref_val)
/* generic_val_print helper for TYPE_CODE_REF. */ /* generic_val_print helper for TYPE_CODE_REF. */
static void static void
generic_val_print_ref (struct type *type, const gdb_byte *valaddr, generic_val_print_ref (struct type *type,
int embedded_offset, struct ui_file *stream, int recurse, int embedded_offset, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type)); struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
@ -552,6 +553,7 @@ generic_val_print_ref (struct type *type, const gdb_byte *valaddr,
const int must_coerce_ref = ((options->addressprint && value_is_synthetic) const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|| options->deref_ref); || options->deref_ref);
const int type_is_defined = TYPE_CODE (elttype) != TYPE_CODE_UNDEF; const int type_is_defined = TYPE_CODE (elttype) != TYPE_CODE_UNDEF;
const gdb_byte *valaddr = value_contents_for_printing (original_value);
if (must_coerce_ref && type_is_defined) if (must_coerce_ref && type_is_defined)
{ {
@ -663,9 +665,9 @@ generic_val_print_enum_1 (struct type *type, LONGEST val,
/* generic_val_print helper for TYPE_CODE_ENUM. */ /* generic_val_print helper for TYPE_CODE_ENUM. */
static void static void
generic_val_print_enum (struct type *type, const gdb_byte *valaddr, generic_val_print_enum (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
LONGEST val; LONGEST val;
@ -674,45 +676,53 @@ generic_val_print_enum (struct type *type, const gdb_byte *valaddr,
if (options->format) if (options->format)
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
return;
} }
else
{
const gdb_byte *valaddr = value_contents_for_printing (original_value);
val = unpack_long (type, valaddr + embedded_offset * unit_size); val = unpack_long (type, valaddr + embedded_offset * unit_size);
generic_val_print_enum_1 (type, val, stream); generic_val_print_enum_1 (type, val, stream);
} }
}
/* generic_val_print helper for TYPE_CODE_FLAGS. */ /* generic_val_print helper for TYPE_CODE_FLAGS. */
static void static void
generic_val_print_flags (struct type *type, const gdb_byte *valaddr, generic_val_print_flags (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
if (options->format) if (options->format)
val_print_scalar_formatted (type, valaddr, embedded_offset, original_value, val_print_scalar_formatted (type, embedded_offset, original_value,
options, 0, stream); options, 0, stream);
else else
{
const gdb_byte *valaddr = value_contents_for_printing (original_value);
val_print_type_code_flags (type, valaddr + embedded_offset, stream); val_print_type_code_flags (type, valaddr + embedded_offset, stream);
} }
}
/* generic_val_print helper for TYPE_CODE_FUNC and TYPE_CODE_METHOD. */ /* generic_val_print helper for TYPE_CODE_FUNC and TYPE_CODE_METHOD. */
static void static void
generic_val_print_func (struct type *type, const gdb_byte *valaddr, generic_val_print_func (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
if (options->format) if (options->format)
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
} }
else else
@ -731,9 +741,9 @@ generic_val_print_func (struct type *type, const gdb_byte *valaddr,
/* generic_val_print helper for TYPE_CODE_BOOL. */ /* generic_val_print helper for TYPE_CODE_BOOL. */
static void static void
generic_val_print_bool (struct type *type, const gdb_byte *valaddr, generic_val_print_bool (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct generic_val_print_decorations *decorations) const struct generic_val_print_decorations *decorations)
{ {
@ -746,11 +756,13 @@ generic_val_print_bool (struct type *type, const gdb_byte *valaddr,
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else else
{ {
const gdb_byte *valaddr = value_contents_for_printing (original_value);
val = unpack_long (type, valaddr + embedded_offset * unit_size); val = unpack_long (type, valaddr + embedded_offset * unit_size);
if (val == 0) if (val == 0)
fputs_filtered (decorations->false_name, stream); fputs_filtered (decorations->false_name, stream);
@ -764,9 +776,9 @@ generic_val_print_bool (struct type *type, const gdb_byte *valaddr,
/* generic_val_print helper for TYPE_CODE_INT. */ /* generic_val_print helper for TYPE_CODE_INT. */
static void static void
generic_val_print_int (struct type *type, const gdb_byte *valaddr, generic_val_print_int (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -778,21 +790,25 @@ generic_val_print_int (struct type *type, const gdb_byte *valaddr,
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else else
{
const gdb_byte *valaddr = value_contents_for_printing (original_value);
val_print_type_code_int (type, valaddr + embedded_offset * unit_size, val_print_type_code_int (type, valaddr + embedded_offset * unit_size,
stream); stream);
} }
}
/* generic_val_print helper for TYPE_CODE_CHAR. */ /* generic_val_print helper for TYPE_CODE_CHAR. */
static void static void
generic_val_print_char (struct type *type, struct type *unresolved_type, generic_val_print_char (struct type *type, struct type *unresolved_type,
const gdb_byte *valaddr, int embedded_offset, int embedded_offset,
struct ui_file *stream, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
LONGEST val; LONGEST val;
@ -805,11 +821,13 @@ generic_val_print_char (struct type *type, struct type *unresolved_type,
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream); original_value, &opts, 0, stream);
} }
else else
{ {
const gdb_byte *valaddr = value_contents_for_printing (original_value);
val = unpack_long (type, valaddr + embedded_offset * unit_size); val = unpack_long (type, valaddr + embedded_offset * unit_size);
if (TYPE_UNSIGNED (type)) if (TYPE_UNSIGNED (type))
fprintf_filtered (stream, "%u", (unsigned int) val); fprintf_filtered (stream, "%u", (unsigned int) val);
@ -823,9 +841,9 @@ generic_val_print_char (struct type *type, struct type *unresolved_type,
/* generic_val_print helper for TYPE_CODE_FLT. */ /* generic_val_print helper for TYPE_CODE_FLT. */
static void static void
generic_val_print_float (struct type *type, const gdb_byte *valaddr, generic_val_print_float (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
@ -833,11 +851,13 @@ generic_val_print_float (struct type *type, const gdb_byte *valaddr,
if (options->format) if (options->format)
{ {
val_print_scalar_formatted (type, valaddr, embedded_offset, val_print_scalar_formatted (type, embedded_offset,
original_value, options, 0, stream); original_value, options, 0, stream);
} }
else else
{ {
const gdb_byte *valaddr = value_contents_for_printing (original_value);
print_floating (valaddr + embedded_offset * unit_size, type, stream); print_floating (valaddr + embedded_offset * unit_size, type, stream);
} }
} }
@ -845,38 +865,43 @@ generic_val_print_float (struct type *type, const gdb_byte *valaddr,
/* generic_val_print helper for TYPE_CODE_DECFLOAT. */ /* generic_val_print helper for TYPE_CODE_DECFLOAT. */
static void static void
generic_val_print_decfloat (struct type *type, const gdb_byte *valaddr, generic_val_print_decfloat (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
int unit_size = gdbarch_addressable_memory_unit_size (gdbarch); int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
if (options->format) if (options->format)
val_print_scalar_formatted (type, valaddr, embedded_offset, original_value, val_print_scalar_formatted (type, embedded_offset, original_value,
options, 0, stream); options, 0, stream);
else else
{
const gdb_byte *valaddr = value_contents_for_printing (original_value);
print_decimal_floating (valaddr + embedded_offset * unit_size, type, print_decimal_floating (valaddr + embedded_offset * unit_size, type,
stream); stream);
} }
}
/* generic_val_print helper for TYPE_CODE_COMPLEX. */ /* generic_val_print helper for TYPE_CODE_COMPLEX. */
static void static void
generic_val_print_complex (struct type *type, const gdb_byte *valaddr, generic_val_print_complex (struct type *type,
int embedded_offset, struct ui_file *stream, int embedded_offset, struct ui_file *stream,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct generic_val_print_decorations const struct generic_val_print_decorations
*decorations) *decorations)
{ {
struct gdbarch *gdbarch = get_type_arch (type); struct gdbarch *gdbarch = get_type_arch (type);
int unit_size = gdbarch_addressable_memory_unit_size (gdbarch); int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
const gdb_byte *valaddr = value_contents_for_printing (original_value);
fprintf_filtered (stream, "%s", decorations->complex_prefix); fprintf_filtered (stream, "%s", decorations->complex_prefix);
if (options->format) if (options->format)
val_print_scalar_formatted (TYPE_TARGET_TYPE (type), valaddr, val_print_scalar_formatted (TYPE_TARGET_TYPE (type),
embedded_offset, original_value, options, 0, embedded_offset, original_value, options, 0,
stream); stream);
else else
@ -884,7 +909,7 @@ generic_val_print_complex (struct type *type, const gdb_byte *valaddr,
TYPE_TARGET_TYPE (type), stream); TYPE_TARGET_TYPE (type), stream);
fprintf_filtered (stream, "%s", decorations->complex_infix); fprintf_filtered (stream, "%s", decorations->complex_infix);
if (options->format) if (options->format)
val_print_scalar_formatted (TYPE_TARGET_TYPE (type), valaddr, val_print_scalar_formatted (TYPE_TARGET_TYPE (type),
embedded_offset embedded_offset
+ type_length_units (TYPE_TARGET_TYPE (type)), + type_length_units (TYPE_TARGET_TYPE (type)),
original_value, options, 0, stream); original_value, options, 0, stream);
@ -907,10 +932,10 @@ generic_val_print_complex (struct type *type, const gdb_byte *valaddr,
output in some small, language-specific ways. */ output in some small, language-specific ways. */
void void
generic_val_print (struct type *type, const gdb_byte *valaddr, generic_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct generic_val_print_decorations *decorations) const struct generic_val_print_decorations *decorations)
{ {
@ -920,43 +945,43 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
{ {
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
generic_val_print_array (type, valaddr, embedded_offset, address, stream, generic_val_print_array (type, embedded_offset, address, stream,
recurse, original_value, options, decorations); recurse, original_value, options, decorations);
break; break;
case TYPE_CODE_MEMBERPTR: case TYPE_CODE_MEMBERPTR:
generic_val_print_memberptr (type, valaddr, embedded_offset, stream, generic_val_print_memberptr (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
generic_val_print_ptr (type, valaddr, embedded_offset, stream, generic_val_print_ptr (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_REF: case TYPE_CODE_REF:
generic_val_print_ref (type, valaddr, embedded_offset, stream, recurse, generic_val_print_ref (type, embedded_offset, stream, recurse,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
generic_val_print_enum (type, valaddr, embedded_offset, stream, generic_val_print_enum (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_FLAGS: case TYPE_CODE_FLAGS:
generic_val_print_flags (type, valaddr, embedded_offset, stream, generic_val_print_flags (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD: case TYPE_CODE_METHOD:
generic_val_print_func (type, valaddr, embedded_offset, address, stream, generic_val_print_func (type, embedded_offset, address, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
generic_val_print_bool (type, valaddr, embedded_offset, stream, generic_val_print_bool (type, embedded_offset, stream,
original_value, options, decorations); original_value, options, decorations);
break; break;
@ -972,22 +997,22 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
/* FALLTHROUGH */ /* FALLTHROUGH */
case TYPE_CODE_INT: case TYPE_CODE_INT:
generic_val_print_int (type, valaddr, embedded_offset, stream, generic_val_print_int (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
generic_val_print_char (type, unresolved_type, valaddr, embedded_offset, generic_val_print_char (type, unresolved_type, embedded_offset,
stream, original_value, options); stream, original_value, options);
break; break;
case TYPE_CODE_FLT: case TYPE_CODE_FLT:
generic_val_print_float (type, valaddr, embedded_offset, stream, generic_val_print_float (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
case TYPE_CODE_DECFLOAT: case TYPE_CODE_DECFLOAT:
generic_val_print_decfloat (type, valaddr, embedded_offset, stream, generic_val_print_decfloat (type, embedded_offset, stream,
original_value, options); original_value, options);
break; break;
@ -1007,7 +1032,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
break; break;
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
generic_val_print_complex (type, valaddr, embedded_offset, stream, generic_val_print_complex (type, embedded_offset, stream,
original_value, options, decorations); original_value, options, decorations);
break; break;
@ -1022,15 +1047,14 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
} }
/* Print using the given LANGUAGE the data of type TYPE located at /* Print using the given LANGUAGE the data of type TYPE located at
VALADDR + EMBEDDED_OFFSET (within GDB), which came from the VAL's contents buffer + EMBEDDED_OFFSET (within GDB), which came
inferior at address ADDRESS + EMBEDDED_OFFSET, onto stdio stream from the inferior at address ADDRESS + EMBEDDED_OFFSET, onto
STREAM according to OPTIONS. VAL is the whole object that came stdio stream STREAM according to OPTIONS. VAL is the whole object
from ADDRESS. VALADDR must point to the head of VAL's contents that came from ADDRESS.
buffer.
The language printers will pass down an adjusted EMBEDDED_OFFSET to The language printers will pass down an adjusted EMBEDDED_OFFSET to
further helper subroutines as subfields of TYPE are printed. In further helper subroutines as subfields of TYPE are printed. In
such cases, VALADDR is passed down unadjusted, as well as VAL, so such cases, VAL is passed down unadjusted, so
that VAL can be queried for metadata about the contents data being that VAL can be queried for metadata about the contents data being
printed, using EMBEDDED_OFFSET as an offset into VAL's contents printed, using EMBEDDED_OFFSET as an offset into VAL's contents
buffer. For example: "has this field been optimized out", or "I'm buffer. For example: "has this field been optimized out", or "I'm
@ -1042,9 +1066,9 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
RECURSE. */ RECURSE. */
void void
val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, val_print (struct type *type, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse, CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language) const struct language_defn *language)
{ {
@ -1074,6 +1098,8 @@ val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
if (!options->raw) if (!options->raw)
{ {
const gdb_byte *valaddr = value_contents_for_printing (val);
ret = apply_ext_lang_val_pretty_printer (type, valaddr, embedded_offset, ret = apply_ext_lang_val_pretty_printer (type, valaddr, embedded_offset,
address, stream, recurse, address, stream, recurse,
val, options, language); val, options, language);
@ -1091,7 +1117,7 @@ val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
TRY TRY
{ {
language->la_val_print (type, valaddr, embedded_offset, address, language->la_val_print (type, embedded_offset, address,
stream, recurse, val, stream, recurse, val,
&local_opts); &local_opts);
} }
@ -1177,7 +1203,7 @@ common_val_print (struct value *val, struct ui_file *stream, int recurse,
get a fixed representation of our value. */ get a fixed representation of our value. */
val = ada_to_fixed_value (val); val = ada_to_fixed_value (val);
val_print (value_type (val), value_contents_for_printing (val), val_print (value_type (val),
value_embedded_offset (val), value_address (val), value_embedded_offset (val), value_address (val),
stream, recurse, stream, recurse,
val, options, language); val, options, language);
@ -1303,8 +1329,8 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr,
void void
val_print_scalar_formatted (struct type *type, val_print_scalar_formatted (struct type *type,
const gdb_byte *valaddr, LONGEST embedded_offset, LONGEST embedded_offset,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
int size, int size,
struct ui_file *stream) struct ui_file *stream)
@ -1313,7 +1339,6 @@ val_print_scalar_formatted (struct type *type,
int unit_size = gdbarch_addressable_memory_unit_size (arch); int unit_size = gdbarch_addressable_memory_unit_size (arch);
gdb_assert (val != NULL); gdb_assert (val != NULL);
gdb_assert (valaddr == value_contents_for_printing_const (val));
/* If we get here with a string format, try again without it. Go /* If we get here with a string format, try again without it. Go
all the way back to the language printers, which may call us all the way back to the language printers, which may call us
@ -1323,11 +1348,16 @@ val_print_scalar_formatted (struct type *type,
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = 0; opts.format = 0;
opts.deref_ref = 0; opts.deref_ref = 0;
val_print (type, valaddr, embedded_offset, 0, stream, 0, val, &opts, val_print (type, embedded_offset, 0, stream, 0, val, &opts,
current_language); current_language);
return; return;
} }
/* value_contents_for_printing fetches all VAL's contents. They are
needed to check whether VAL is optimized-out or unavailable
below. */
const gdb_byte *valaddr = value_contents_for_printing (val);
/* A scalar object that does not have all bits available can't be /* A scalar object that does not have all bits available can't be
printed, because all bits contribute to its representation. */ printed, because all bits contribute to its representation. */
if (value_bits_any_optimized_out (val, if (value_bits_any_optimized_out (val,
@ -1965,10 +1995,10 @@ maybe_print_array_index (struct type *index_type, LONGEST index,
void void
val_print_array_elements (struct type *type, val_print_array_elements (struct type *type,
const gdb_byte *valaddr, LONGEST embedded_offset, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, CORE_ADDR address, struct ui_file *stream,
int recurse, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
unsigned int i) unsigned int i)
{ {
@ -2066,7 +2096,7 @@ val_print_array_elements (struct type *type,
if (reps > options->repeat_count_threshold) if (reps > options->repeat_count_threshold)
{ {
val_print (elttype, valaddr, embedded_offset + i * eltlen, val_print (elttype, embedded_offset + i * eltlen,
address, stream, recurse + 1, val, options, address, stream, recurse + 1, val, options,
current_language); current_language);
annotate_elt_rep (reps); annotate_elt_rep (reps);
@ -2078,7 +2108,7 @@ val_print_array_elements (struct type *type,
} }
else else
{ {
val_print (elttype, valaddr, embedded_offset + i * eltlen, val_print (elttype, embedded_offset + i * eltlen,
address, address,
stream, recurse + 1, val, options, current_language); stream, recurse + 1, val, options, current_language);
annotate_elt (); annotate_elt ();

View file

@ -115,9 +115,9 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index,
struct ui_file *stream, struct ui_file *stream,
const struct value_print_options *); const struct value_print_options *);
extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, extern void val_print_array_elements (struct type *, LONGEST,
CORE_ADDR, struct ui_file *, int, CORE_ADDR, struct ui_file *, int,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
unsigned int); unsigned int);
@ -125,8 +125,8 @@ extern void val_print_type_code_int (struct type *, const gdb_byte *,
struct ui_file *); struct ui_file *);
extern void val_print_scalar_formatted (struct type *, extern void val_print_scalar_formatted (struct type *,
const gdb_byte *, LONGEST, LONGEST,
const struct value *, struct value *,
const struct value_print_options *, const struct value_print_options *,
int, int,
struct ui_file *); struct ui_file *);
@ -193,10 +193,10 @@ struct generic_val_print_decorations
}; };
extern void generic_val_print (struct type *type, const gdb_byte *valaddr, extern void generic_val_print (struct type *type,
int embedded_offset, CORE_ADDR address, int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *original_value, struct value *original_value,
const struct value_print_options *options, const struct value_print_options *options,
const struct generic_val_print_decorations *); const struct generic_val_print_decorations *);

View file

@ -1016,10 +1016,10 @@ extern void value_print_array_elements (struct value *val,
extern struct value *value_release_to_mark (const struct value *mark); extern struct value *value_release_to_mark (const struct value *mark);
extern void val_print (struct type *type, const gdb_byte *valaddr, extern void val_print (struct type *type,
LONGEST embedded_offset, CORE_ADDR address, LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse, struct ui_file *stream, int recurse,
const struct value *val, struct value *val,
const struct value_print_options *options, const struct value_print_options *options,
const struct language_defn *language); const struct language_defn *language);