aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-05-11 14:57:49 -0600
committerTom Tromey <tromey@adacore.com>2020-05-11 14:57:49 -0600
commit5eb68a39a2c2908fc01f03e79daed72ba85dc14c (patch)
treecc5b9cd67270ab9bf1e49373fecd518ee2adbdd0 /gdb/ada-valprint.c
parente000211765b57e0a1835f2ecea250dd51878fa5f (diff)
downloadgdb-5eb68a39a2c2908fc01f03e79daed72ba85dc14c.zip
gdb-5eb68a39a2c2908fc01f03e79daed72ba85dc14c.tar.gz
gdb-5eb68a39a2c2908fc01f03e79daed72ba85dc14c.tar.bz2
Fix Ada value printing on PPC64
The val_print removal patches introduced an Ada regression on PPC64 (probably any big-endian system). The issue comes because value_field does not understand that Ada wrapper fields can be bitfields that wrap a non-scalar type. In this case the value is already left-justified, so the justification done there does the wrong thing. Perhaps it would be good, eventually, to change value_field to understand this case. In the meantime this implements an Ada-specific solution. gdb/ChangeLog 2020-05-11 Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_value_primitive_field): Now public. * ada-lang.h (ada_value_primitive_field): Declare. * ada-valprint.c (print_field_values): Use ada_value_primitive_field for wrapper fields.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 31f3a50..010446d 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -609,7 +609,8 @@ print_field_values (struct value *value, struct value *outer_value,
if (ada_is_wrapper_field (type, i))
{
- struct value *field_val = value_field (value, i);
+ struct value *field_val = ada_value_primitive_field (value, 0,
+ i, type);
comma_needed =
print_field_values (field_val, field_val,
stream, recurse, options,