gdb: Handle alignment for C++ structures with static members
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 22 Feb 2019 22:04:53 +0000 (22:04 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 27 Feb 2019 08:38:17 +0000 (10:38 +0200)
commitbf9a735e239cb7a27c81aa7c98679f7f83fa8314
tree523aab5bf44a2e44119a68413dfc7e072fd67a21
parent5561fc304ff2a93a33a42df63eaf18b92483b307
gdb: Handle alignment for C++ structures with static members

In 'type_align' when computing the alignment of a structure we should
not consider the alignment of static structure members, these are
usually stored outside of the structure and therefore don't have any
impact on the structures alignment requirements.

I've extended the existing alignment calculating test to compile in
both C and C++ now so that we can create structures with static
members.

gdb/ChangeLog:

* gdbtypes.c (type_align): Don't consider static members when
computing structure alignment.

gdb/testsuite/ChangeLog:

* gdb.base/align.exp: Extend to compile in both C and C++, and add
tests for structs with static members.
gdb/ChangeLog
gdb/gdbtypes.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/align.exp
This page took 0.026824 seconds and 4 git commands to generate.