gdb: Fix alignment computation for structs with only static fields
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sat, 6 Apr 2019 10:02:04 +0000 (11:02 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 11 Apr 2019 22:40:25 +0000 (23:40 +0100)
commit41077b6625d16cc6c0c4b404a177a8850300b8a0
treee640c63cbf1e3d28841c1139c5b412782a8fb5a7
parent9f0272f8548164b024ff9fd151686b2b904a5d59
gdb: Fix alignment computation for structs with only static fields

The current code in gdbtypes.c:type_align incorrectly returns 0 as the
alignment for a structure containing only static fields.  After this
patch the correct value of 1 is returned.  The gdb.base/align.exp test
is extended to cover this case.

gdb/ChangeLog:

* gdbtypes.c (type_align): A struct with no non-static fields also
has alignment of 1.

gdb/testsuite/ChangeLog:

* gdb.base/align.exp: Extend test to cover structures containing
only static fields.
gdb/ChangeLog
gdb/gdbtypes.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/align.exp