aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-04-26 10:57:52 -0600
committerTom Tromey <tromey@adacore.com>2019-05-01 08:09:22 -0600
commitd48e62f4a263a871b7a62793e8000625735bc2f6 (patch)
treed5e30d500bccde97f8d27793cd6d3fe0d77e83f4 /gdb/testsuite
parent25a0274483cb00c27945b0337005be4f169ff09f (diff)
downloadgdb-d48e62f4a263a871b7a62793e8000625735bc2f6.zip
gdb-d48e62f4a263a871b7a62793e8000625735bc2f6.tar.gz
gdb-d48e62f4a263a871b7a62793e8000625735bc2f6.tar.bz2
Fix big-endian aggregate assignment in Ada
A bug internal to AdaCore notes that assigning a non-scalar value to an element of a packed array will sometimes fail. The bug turns out to be that ada_value_assign incorrectly computes the starting point for the assignment. This patch fixes the problem. gdb/ChangeLog 2019-05-01 Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_value_assign): Correctly compute starting offset for big-endian copies. gdb/testsuite/ChangeLog 2019-05-01 Tom Tromey <tromey@adacore.com> * gdb.ada/packed_array_assign.exp: Add packed assignment regression test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/packed_array_assign.exp5
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6331e52..573aa16 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-01 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/packed_array_assign.exp: Add packed assignment
+ regression test.
+
2019-05-01 Tom de Vries <tdevries@suse.de>
* boards/cc-with-tweaks.exp: Generate gdb.sh, and pass it in env(GDB).
diff --git a/gdb/testsuite/gdb.ada/packed_array_assign.exp b/gdb/testsuite/gdb.ada/packed_array_assign.exp
index 93910ac..8ed2d63 100644
--- a/gdb/testsuite/gdb.ada/packed_array_assign.exp
+++ b/gdb/testsuite/gdb.ada/packed_array_assign.exp
@@ -28,3 +28,8 @@ runto "aggregates.run_test"
gdb_test \
"print pra := ((packed_array_assign_x => 2, packed_array_assign_y => 0, packed_array_assign_w => 17), pr, (packed_array_assign_x => 7, packed_array_assign_y => 1, packed_array_assign_w => 23))" \
" = \\(\\(packed_array_assign_w => 17, packed_array_assign_x => 2, packed_array_assign_y => 0\\), \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\), \\(packed_array_assign_w => 23, packed_array_assign_x => 7, packed_array_assign_y => 1\\)\\)"
+
+gdb_test "print pra(1) := pr" \
+ " = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"
+gdb_test "print pra(1)" \
+ " = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"