aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-03-13 17:39:52 -0600
committerTom Tromey <tom@tromey.com>2020-03-13 18:03:42 -0600
commit3a916a975745f386cabbaba64531ed9b5f8be509 (patch)
treef9be92b71452388e2c60b3caca47aae8a75625d6 /gdb/ada-valprint.c
parentb59eac373217394503946dc360692d81809e08af (diff)
downloadgdb-3a916a975745f386cabbaba64531ed9b5f8be509.zip
gdb-3a916a975745f386cabbaba64531ed9b5f8be509.tar.gz
gdb-3a916a975745f386cabbaba64531ed9b5f8be509.tar.bz2
Change print_field_values to use value-based API
This converts print_field_values to use the value-based API, by having it call common_val_print rather than val_print. gdb/ChangeLog 2020-03-13 Tom Tromey <tom@tromey.com> * ada-valprint.c (print_field_values): Call common_val_print.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index fc34ca5..8631f7a 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -684,10 +684,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
bit_size, TYPE_FIELD_TYPE (type, i));
opts = *options;
opts.deref_ref = 0;
- val_print (TYPE_FIELD_TYPE (type, i),
- value_embedded_offset (v), 0,
- stream, recurse + 1, v,
- &opts, language);
+ common_val_print (v, stream, recurse + 1, &opts, language);
}
}
else
@@ -695,9 +692,12 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
struct value_print_options opts = *options;
opts.deref_ref = 0;
- val_print (TYPE_FIELD_TYPE (type, i),
- (offset + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
- 0, stream, recurse + 1, val, &opts, language);
+
+ LONGEST local_off = (offset + TYPE_FIELD_BITPOS (type, i)
+ / HOST_CHAR_BIT);
+ struct value *v = value_from_contents (TYPE_FIELD_TYPE (type, i),
+ valaddr + local_off);
+ common_val_print (v, stream, recurse + 1, &opts, language);
}
annotate_field_end ();
}