[PATCH] Update gdb.dwarf2/data-loc.exp

Tom Tromey tromey@adacore.com
Wed Nov 11 19:06:35 GMT 2020


Tom de Vries pointed out that the series to handle
-fgnat-encodings=minimal regressed data-loc.exp:

https://sourceware.org/pipermail/gdb-patches/2020-November/173035.html

This was my oversight.  Looking at the test, it mimics what GNAT
emits.  The patch series in question changed the approach that gdb
takes to such arrays -- now they are transformed back into "old" style
structures.  (This is perhaps a step backward in a semantics sense,
but on the other hand it more accurately reflects the underlying
reality, and lets gdb continue to create objects of this type.)

This patch updates the test case, by adjusting the expected output.
It also removes the tests done in the C language, because they are now
incorrect, and because (IMO) they don't add much value.

gdb/testsuite/ChangeLog
2020-11-11  Tom Tromey  <tromey@adacore.com>

	* gdb.dwarf2/data-loc.exp: Update expected output.  Remove C
	tests.
---
 gdb/testsuite/ChangeLog               |  5 +++
 gdb/testsuite/gdb.dwarf2/data-loc.exp | 49 ++++-----------------------
 2 files changed, 11 insertions(+), 43 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/data-loc.exp b/gdb/testsuite/gdb.dwarf2/data-loc.exp
index ce4062eba3c..832814def4a 100644
--- a/gdb/testsuite/gdb.dwarf2/data-loc.exp
+++ b/gdb/testsuite/gdb.dwarf2/data-loc.exp
@@ -138,7 +138,7 @@ gdb_test "print foo.three" \
          " = \\(1, 2, 3\\)"
 
 gdb_test "ptype foo.three" \
-         "type = array \\(1 .. 3\\) of integer"
+         "type = array \\(<>\\) of integer"
 
 gdb_test "print foo.three(1)" \
          " = 1"
@@ -160,11 +160,11 @@ gdb_test "print foo.three'length" \
 
 # foo.three_tdef
 
-gdb_test "print foo.three_tdef" \
+gdb_test "print foo.three_tdef.all" \
          " = \\(1, 2, 3\\)"
 
 gdb_test "ptype foo.three_tdef" \
-         "type = array \\(1 .. 3\\) of integer"
+         "type = access array \\(<>\\) of integer"
 
 gdb_test "print foo.three_tdef(1)" \
          " = 1"
@@ -188,7 +188,7 @@ gdb_test "print foo.five" \
          " = \\(2 => 5, 8, 13, 21, 34\\)"
 
 gdb_test "ptype foo.five" \
-         "type = array \\(2 .. 6\\) of integer"
+         "type = array \\(<>\\) of integer"
 
 gdb_test "ptype foo.array_type" \
          "type = array \\(<>\\) of integer"
@@ -221,11 +221,11 @@ gdb_test "print foo.five'length" \
 
 # foo.five_tdef
 
-gdb_test "print foo.five_tdef" \
+gdb_test "print foo.five_tdef.all" \
          " = \\(2 => 5, 8, 13, 21, 34\\)"
 
 gdb_test "ptype foo.five_tdef" \
-         "type = array \\(2 .. 6\\) of integer"
+         "type = access array \\(<>\\) of integer"
 
 gdb_test "print foo.five_tdef(2)" \
          " = 5"
@@ -250,40 +250,3 @@ gdb_test "print foo.five_tdef'last" \
 
 gdb_test "print foo.five_tdef'length" \
          " = 5"
-
-gdb_test_no_output "set lang c"
-
-# foo__three
-
-gdb_test "print foo__three" \
-         " = \\{1, 2, 3\\}"
-
-gdb_test "ptype foo__three" \
-         "type = integer \\\[3\\\]"
-
-# foo__three_tdef
-
-gdb_test "print foo__three_tdef" \
-         " = \\{1, 2, 3\\}"
-
-gdb_test "ptype foo__three_tdef" \
-         "type = integer \\\[3\\\]"
-
-# foo__five
-
-gdb_test "print foo__five" \
-         " = \\{5, 8, 13, 21, 34\\}"
-
-gdb_test "ptype foo__five" \
-         "type = integer \\\[5\\\]"
-
-# foo__five_tdef
-
-gdb_test "print foo__five_tdef" \
-         " = \\{5, 8, 13, 21, 34\\}"
-
-gdb_test "ptype foo__five_tdef" \
-         "type = integer \\\[5\\\]"
-
-gdb_test "ptype foo__array_type" \
-         "type = integer \\\[variable length\\\]"
-- 
2.26.2



More information about the Gdb-patches mailing list