Change print_field_values to use value-based API
authorTom Tromey <tom@tromey.com>
Fri, 13 Mar 2020 23:39:52 +0000 (17:39 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 14 Mar 2020 00:03:42 +0000 (18:03 -0600)
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.

gdb/ChangeLog
gdb/ada-valprint.c

index 3f8d8b1ef9b13d230168426ceca14592ef59d63e..767f3b73e992ce559c3fabc9ff9e003f80e595a0 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-13  Tom Tromey  <tom@tromey.com>
+
+       * ada-valprint.c (print_field_values): Call common_val_print.
+
 2020-03-13  Tom Tromey  <tom@tromey.com>
 
        * ada-valprint.c (val_print_packed_array_elements): Remove
index fc34ca5e6e2259065ef06d335c6d9d4c59b2aadb..8631f7ab228304f933f73bdec8f4bd8d6abe1648 100644 (file)
@@ -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 ();
     }
This page took 0.028575 seconds and 4 git commands to generate.