diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/ada-typeprint.c | 6 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/funcall_ref.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/var_rec_arr.exp | 22 |
5 files changed, 20 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 478da82..c03eacc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2020-11-04 Tom Tromey <tromey@adacore.com> + * ada-typeprint.c (ada_print_type): Handle __XVL fields. + +2020-11-04 Tom Tromey <tromey@adacore.com> + * ada-typeprint.c (ada_print_type): Handle __T types. 2020-11-04 Tom Tromey <tromey@adacore.com> diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 0892c7c..5388247 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -1006,7 +1006,11 @@ ada_print_type (struct type *type0, const char *varstring, break; case TYPE_CODE_PTR: case TYPE_CODE_TYPEDEF: - fprintf_filtered (stream, "access "); + /* An __XVL field is not truly a pointer, so don't print + "access" in this case. */ + if (type->code () != TYPE_CODE_PTR + || strstr (varstring, "___XVL") == nullptr) + fprintf_filtered (stream, "access "); ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); break; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6927735..06ca3e7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-11-04 Tom Tromey <tromey@adacore.com> + * gdb.ada/funcall_ref.exp: Update. + * gdb.ada/var_rec_arr.exp: Update. + +2020-11-04 Tom Tromey <tromey@adacore.com> + * gdb.ada/rec_ptype.exp: New file. * gdb.ada/rec_ptype/main.adb: New file. * gdb.ada/rec_ptype/p.ads: New file. diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp index 1768c1d..d3c6e54 100644 --- a/gdb/testsuite/gdb.ada/funcall_ref.exp +++ b/gdb/testsuite/gdb.ada/funcall_ref.exp @@ -41,7 +41,7 @@ foreach_with_prefix scenario {all minimal} { # references). set pass_re [multi_line "type = <ref> record" \ " n: natural;" \ - " s: access array \\(1 \\.\\. n\\) of character;" \ + " s: array \\(1 \\.\\. n\\) of character;" \ "end record"] # With DWARF we get debuginfo that could in theory show "1..n" for # the range: diff --git a/gdb/testsuite/gdb.ada/var_rec_arr.exp b/gdb/testsuite/gdb.ada/var_rec_arr.exp index c2ad97b..da906dc 100644 --- a/gdb/testsuite/gdb.ada/var_rec_arr.exp +++ b/gdb/testsuite/gdb.ada/var_rec_arr.exp @@ -58,21 +58,9 @@ foreach_with_prefix scenario {all minimal} { gdb_test "print a2(3)" \ " = \\(i => 0, s => \"\"\\)" - # Note that the "access" is only printed when the gnat encodings - # are used. This is due to how the encodings work -- the type - # doesn't actually have the "access", and so here the DWARF - # encoding is more correct. - if {$scenario == "all"} { - set ex [multi_line "type = record" \ - " i: pck\\.small_type;" \ - " s: access array \\((<>|1 \\.\\. i)\\) of character;" \ - "end record"] - } else { - set ex [multi_line "type = record" \ - " i: pck\\.small_type;" \ - " s: array \\((<>|1 \\.\\. i)\\) of character;" \ - "end record"] - } - - gdb_test "ptype a1(1)" $ex + gdb_test "ptype a1(1)" \ + [multi_line "type = record" \ + " i: pck\\.small_type;" \ + " s: array \\((<>|1 \\.\\. i)\\) of character;" \ + "end record"] } |