aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ada/enum_idx_packed.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-11-04 08:49:16 -0700
committerTom Tromey <tromey@adacore.com>2020-11-04 08:49:18 -0700
commit10f6a3add6b4bdd1c83494cad9e9497271fe0922 (patch)
tree05a6b642c9632e078286abad56a9b5d731ede1e1 /gdb/testsuite/gdb.ada/enum_idx_packed.exp
parentb72795a8f573c36aaeedd1a64f58ad52b4c72439 (diff)
downloadgdb-10f6a3add6b4bdd1c83494cad9e9497271fe0922.zip
gdb-10f6a3add6b4bdd1c83494cad9e9497271fe0922.tar.gz
gdb-10f6a3add6b4bdd1c83494cad9e9497271fe0922.tar.bz2
Only use stride for final element type
A DWARF array type may specify a stride. Currently, the DWARF reader applies this stride to every dimension of an array. However, this seems incorrect to me -- only the innermost array ought to use the stride, while outer arrays should compute a stride based on the size of the inner arrays. This patch arranges to apply the stride only to the innermost array type. This fixes a bug noticed when running some Ada tests with -fgnat-encodings=minimal. gdb/ChangeLog 2020-11-04 Tom Tromey <tromey@adacore.com> * dwarf2/read.c (read_array_type): Only apply stride to innermost array. gdb/testsuite/ChangeLog 2020-11-04 Tom Tromey <tromey@adacore.com> * gdb.ada/enum_idx_packed.exp: Add test. * gdb.ada/enum_idx_packed/foo.adb (Multi_Access): New variable. * gdb.ada/enum_idx_packed/pck.ads (Short) (Multi_Dimension, Multi_Dimension_Access): New types.
Diffstat (limited to 'gdb/testsuite/gdb.ada/enum_idx_packed.exp')
-rw-r--r--gdb/testsuite/gdb.ada/enum_idx_packed.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed.exp b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
index 9185968..2e5a85e 100644
--- a/gdb/testsuite/gdb.ada/enum_idx_packed.exp
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
@@ -118,4 +118,7 @@ foreach_with_prefix scenario {all minimal} {
setup_kfail "minimal encodings" *-*-*
}
gdb_test "print multi_multi(2)" " = $matrix"
+
+ gdb_test "print multi_access.all" \
+ " = \\(\\(8, 13, 21, 34, 55\\), \\(1, 1, 2, 3, 5\\)\\)"
}