Reject slicing a packed array
authorTom Tromey <tromey@adacore.com>
Wed, 4 Nov 2020 15:49:16 +0000 (08:49 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 4 Nov 2020 15:49:17 +0000 (08:49 -0700)
commitc9a28cbed612a32efca1167d3b4641278a85059e
tree11f0a148742b08aaea32656df77f8e985171e1ec
parent575673752cade1772f4a6ba2e38306e5ac9a91f6
Reject slicing a packed array

In Ada mode, gdb rejects slicing a packed array.  However, with
-fgnat-encodings=minimal, gdb will instead print incorrect results.
This patch changes gdb to also reject slicing a packed array in this
mode.

FWIW I believe that this rejection is a gdb limitation.  Removing it
looked complicated, though, and meanwhile my main goal for the time
being is to bring the DWARF encodings up to par with Gnat encodings.

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

* ada-lang.c (ada_is_any_packed_array_type): New function.
(ada_evaluate_subexp) <case TERNOP_SLICE>: Use it.

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

* gdb.ada/mod_from_name.exp: Test printing slice.
gdb/ChangeLog
gdb/ada-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/mod_from_name.exp