diff options
author | Tom Tromey <tromey@adacore.com> | 2021-04-15 08:54:06 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-04-30 07:33:01 -0600 |
commit | 2869ac4b59d58caf736f216f7bc65377116bd5f7 (patch) | |
tree | 41800bc393f05104e2e55de0cbaf48a3d0394b4f /gdb/testsuite/gdb.ada/enum_idx_packed.exp | |
parent | d1fbc3ba09fb2e79acf633df29ccbe9285624419 (diff) | |
download | gdb-2869ac4b59d58caf736f216f7bc65377116bd5f7.zip gdb-2869ac4b59d58caf736f216f7bc65377116bd5f7.tar.gz gdb-2869ac4b59d58caf736f216f7bc65377116bd5f7.tar.bz2 |
Fix crash with GNAT minimal encodings
Running the AdaCore internal test suite with -fgnat-encodings=minimal
found a gdb crash. The bug is that GDB ends up with a typedef in
ada_index_type, resulting in a NULL dereference.
This crash can be reproduced using GCC 11 with the included test case.
Tested on x86-64 Fedora 32. Because this is Ada-specific, and was
already reviewed by Joel, I am going to check it in.
2021-04-30 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_index_type): Use ada_check_typedef.
gdb/testsuite/ChangeLog
2021-04-30 Tom Tromey <tromey@adacore.com>
* gdb.ada/enum_idx_packed/pck.ads (My_Enum, My_Array_Type)
(Confused_Array): New types.
* gdb.ada/enum_idx_packed/foo.adb (Confused_Array): New variable.
* gdb.ada/enum_idx_packed.exp: Add new tests.
Diffstat (limited to 'gdb/testsuite/gdb.ada/enum_idx_packed.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/enum_idx_packed.exp | 3 |
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 1497f53..f7d57a7 100644 --- a/gdb/testsuite/gdb.ada/enum_idx_packed.exp +++ b/gdb/testsuite/gdb.ada/enum_idx_packed.exp @@ -122,4 +122,7 @@ foreach_with_prefix scenario {all minimal} { gdb_test "print multi_access.all" \ " = \\(\\(8, 13, 21, 34, 55\\), \\(1, 1, 2, 3, 5\\)\\)" + + gdb_test "print confused_array(red, green)" " = 2" + gdb_test "print confused_array(green, red)" " = 6" } |