summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ada
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-11-04 09:17:58 -0700
committerTom Tromey <tromey@adacore.com>2020-11-04 09:17:58 -0700
commit9c91c7259122af572d50e5422c982201e4003d04 (patch)
tree06a00b97ea01afc3834d21bf6f14c5d94557dea7 /gdb/testsuite/gdb.ada
parent8d9fd3a107c4ae251a4cbcfc995115334e0cf84e (diff)
downloadbinutils-gdb-9c91c7259122af572d50e5422c982201e4003d04.tar.gz
Handle __XVL fields in Ada type printing
Sometimes the Ada compiler will emit an "__XVL" name for a field. The Ada compiler describes: -- Second, the variable-length fields themselves are represented by -- replacing the type by a special access type. The designated type of -- this access type is the original variable-length type, and the fact -- that this field has been transformed in this way is signalled by -- encoding the field name as: -- field___XVL Currently gdb describes such fields as having "access" type, but this is inaccurate. This patch changes gdb to avoid printing "access" in this case. gdb/ChangeLog 2020-11-04 Tom Tromey <tromey@adacore.com> * ada-typeprint.c (ada_print_type): Handle __XVL fields. gdb/testsuite/ChangeLog 2020-11-04 Tom Tromey <tromey@adacore.com> * gdb.ada/funcall_ref.exp: Update. * gdb.ada/var_rec_arr.exp: Update.
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r--gdb/testsuite/gdb.ada/funcall_ref.exp2
-rw-r--r--gdb/testsuite/gdb.ada/var_rec_arr.exp22
2 files changed, 6 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp
index 1768c1d480a..d3c6e54c8e0 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 c2ad97b31e2..da906dc5d8c 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"]
}