diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-31 07:52:09 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-13 15:21:06 -0700 |
commit | d0c9791728caa0d3b3270a997c7fd97919976c97 (patch) | |
tree | 1753b7232efa89e05696d4289d60ad019fc161e4 /gdb/ada-valprint.c | |
parent | 7cf57bc5be656c62cc6b80280a9eddad2b8ded3f (diff) | |
download | gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.zip gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.tar.gz gdb-d0c9791728caa0d3b3270a997c7fd97919976c97.tar.bz2 |
Turn value_type into method
This changes value_type to be a method of value. Much of this patch
was written by script.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r-- | gdb/ada-valprint.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 10d3b0a..1f22ab6 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -196,12 +196,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, (i * bitsize) / HOST_CHAR_BIT, (i * bitsize) % HOST_CHAR_BIT, bitsize, elttype); - if (check_typedef (value_type (v0))->length () - != check_typedef (value_type (v1))->length ()) + if (check_typedef (v0->type ())->length () + != check_typedef (v1->type ())->length ()) break; if (!value_contents_eq (v0, value_embedded_offset (v0), v1, value_embedded_offset (v1), - check_typedef (value_type (v0))->length ())) + check_typedef (v0->type ())->length ())) break; } @@ -552,7 +552,7 @@ print_variant_part (struct value *value, int field_num, int comma_needed, const struct language_defn *language) { - struct type *type = value_type (value); + struct type *type = value->type (); struct type *var_type = type->field (field_num).type (); int which = ada_which_variant_applies (var_type, outer_value); @@ -588,7 +588,7 @@ print_field_values (struct value *value, struct value *outer_value, { int i, len; - struct type *type = value_type (value); + struct type *type = value->type (); len = type->num_fields (); for (i = 0; i < len; i += 1) @@ -732,8 +732,8 @@ ada_value_print_ptr (struct value *val, const struct value_print_options *options) { if (!options->format - && value_type (val)->target_type ()->code () == TYPE_CODE_INT - && value_type (val)->target_type ()->length () == 0) + && val->type ()->target_type ()->code () == TYPE_CODE_INT + && val->type ()->target_type ()->length () == 0) { gdb_puts ("null", stream); return; @@ -741,7 +741,7 @@ ada_value_print_ptr (struct value *val, common_val_print (val, stream, recurse, options, language_def (language_c)); - struct type *type = ada_check_typedef (value_type (val)); + struct type *type = ada_check_typedef (val->type ()); if (ada_is_tag_type (type)) { gdb::unique_xmalloc_ptr<char> name = ada_tag_name (val); @@ -758,7 +758,7 @@ static void ada_value_print_num (struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) { - struct type *type = ada_check_typedef (value_type (val)); + struct type *type = ada_check_typedef (val->type ()); const gdb_byte *valaddr = value_contents_for_printing (val).data (); if (type->code () == TYPE_CODE_RANGE @@ -838,7 +838,7 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse, return; } - struct type *type = ada_check_typedef (value_type (value)); + struct type *type = ada_check_typedef (value->type ()); const gdb_byte *valaddr = value_contents_for_printing (value).data (); int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr; @@ -875,7 +875,7 @@ ada_val_print_struct_union (struct value *value, int recurse, const struct value_print_options *options) { - if (ada_is_bogus_array_descriptor (value_type (value))) + if (ada_is_bogus_array_descriptor (value->type ())) { gdb_printf (stream, "(...?)"); return; @@ -901,7 +901,7 @@ static void ada_value_print_array (struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) { - struct type *type = ada_check_typedef (value_type (val)); + struct type *type = ada_check_typedef (val->type ()); /* For an array of characters, print with string syntax. */ if (ada_is_string_type (type) @@ -961,7 +961,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, deref_val = coerce_ref_if_computed (original_value); if (deref_val) { - if (ada_is_tagged_type (value_type (deref_val), 1)) + if (ada_is_tagged_type (deref_val->type (), 1)) deref_val = ada_tag_value_at_base_address (deref_val); common_val_print (deref_val, stream, recurse + 1, options, @@ -979,7 +979,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, deref_val = ada_value_ind (value_from_pointer (lookup_pointer_type (elttype), deref_val_int)); - if (ada_is_tagged_type (value_type (deref_val), 1)) + if (ada_is_tagged_type (deref_val->type (), 1)) deref_val = ada_tag_value_at_base_address (deref_val); if (value_lazy (deref_val)) @@ -997,7 +997,7 @@ void ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) { - struct type *type = ada_check_typedef (value_type (val)); + struct type *type = ada_check_typedef (val->type ()); if (ada_is_array_descriptor_type (type) || (ada_is_constrained_packed_array_type (type) @@ -1018,7 +1018,7 @@ ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse, else val = ada_to_fixed_value (val); - type = value_type (val); + type = val->type (); struct type *saved_type = type; const gdb_byte *valaddr = value_contents_for_printing (val).data (); @@ -1088,7 +1088,7 @@ ada_value_print (struct value *val0, struct ui_file *stream, const struct value_print_options *options) { struct value *val = ada_to_fixed_value (val0); - struct type *type = ada_check_typedef (value_type (val)); + struct type *type = ada_check_typedef (val->type ()); struct value_print_options opts; /* If it is a pointer, indicate what it points to; but not for |