Fix bug in assignment to nested packed structure
authorTom Tromey <tromey@adacore.com>
Mon, 29 Apr 2019 15:55:39 +0000 (09:55 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 1 May 2019 14:09:22 +0000 (08:09 -0600)
commit4504bbdec57c77b6468838276e62b2137eedfdd5
treeeabe799da4aabe549b571f5601c2d74b92940d79
parentd48e62f4a263a871b7a62793e8000625735bc2f6
Fix bug in assignment to nested packed structure

A user at AdaCore found a case where assignment to a nested packed
structure would fail.  The bug is that ada_value_primitive_field
doesn't account for the situation where a field is not packed relative
to its containing structure, but where the structure itself is packed
in its parent.

gdb/ChangeLog
2019-05-01  Tom Tromey  <tromey@adacore.com>

* ada-lang.c (ada_value_primitive_field): Treat more fields as
bitfields.

gdb/testsuite/ChangeLog
2019-05-01  Tom Tromey  <tromey@adacore.com>

* gdb.ada/packed_array_assign/aggregates.ads (Nested_Packed): New
record.
(NPR): New variable.
* gdb.ada/packed_array_assign.exp: Add nested packed assignment
test.
gdb/ChangeLog
gdb/ada-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/packed_array_assign.exp
gdb/testsuite/gdb.ada/packed_array_assign/aggregates.ads