]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Accept unnamed array in gdb.ada/limited-length.exp
authorTom Tromey <tromey@adacore.com>
Tue, 2 Jul 2024 14:32:36 +0000 (08:32 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 2 Jul 2024 17:15:31 +0000 (11:15 -0600)
Some compiler changes I'm working on cause a regression in
gdb.ada/limited-length.exp -- with the changes, the array type is
nameless and so is not mentioned in the max-value-size error message.

Because the array type is nameless in the source code, this seems like
an improvement to me, and so this patch changes the test to accept
either form.

gdb/testsuite/gdb.ada/limited-length.exp

index 1350e7af20930b6d969763bef38ae312ca7b6def..d0e912b79cfc1687a7f78a8e99d2538befa8f8e6 100644 (file)
@@ -73,18 +73,15 @@ set elem_size [get_valueof "/d" "(Large_1d_Array(1)'Size + 7) / 8" "*unknown*"]
 gdb_test_no_output "set max-value-size [expr $elem_size * $elements]"
 
 with_test_prefix "with reduced max-value size" {
-    gdb_test "print Large_1d_Array" \
-       "value of type `.*' requires $decimal bytes,\
-        which is more than max-value-size"
-    gdb_test "output Large_1d_Array" \
-       "value of type `.*' requires $decimal bytes,\
-        which is more than max-value-size"
-    gdb_test "print Large_3d_Array" \
-       "value of type `.*' requires $decimal bytes,\
-        which is more than max-value-size"
-    gdb_test "output Large_3d_Array" \
-       "value of type `.*' requires $decimal bytes,\
-        which is more than max-value-size"
+    # GNAT historically named this type, but as the array type is
+    # nameless, this accepts both variants.
+    set response \
+       "value (of type `.*' )?requires $decimal bytes, which is more than max-value-size"
+
+    gdb_test "print Large_1d_Array" $response
+    gdb_test "output Large_1d_Array" $response
+    gdb_test "print Large_3d_Array" $response
+    gdb_test "output Large_3d_Array" $response
 }
 
 with_test_prefix "with reduced print -elements flag" {