gdb/aarch64: Use type_align instead of aarch64_type_align
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 7 Apr 2019 21:48:00 +0000 (22:48 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 23 Apr 2019 21:02:59 +0000 (22:02 +0100)
commitb907456c3eb8a08f6b211f66abb448df962749e1
tree3f0051221a92673b3a9b8e99299884923dfcf136
parent9e97ba436a8e59ac4574001d618240eac0328934
gdb/aarch64: Use type_align instead of aarch64_type_align

Replaces use of aarch64_type_align with common type_align function.

Doing this fixes a bug in aarch64_type_align where static fields are
considered as part of the alignment calculation of a struct, which
results in arguments passed on the stack being misaligned.  This bug
is exposed in the new test gdb.cp/many-args.exp.

Part of the old aarch64_type_align is retained and used as the gdbarch
type align callback in order to correctly align vectors.

gdb/ChangeLog:

* aarch64-tdep.c (aarch64_type_align): Only handle vector override
case.
(pass_on_stack): Use type_align.
(aarch64_gdbarch_init): Register aarch64_type_align gdbarch
function.

gdb/testsuite/ChangeLog:

* gdb.cp/many-args.cc: New file.
* gdb.cp/many-args.exp: New file.
gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/many-args.cc [new file with mode: 0644]
gdb/testsuite/gdb.cp/many-args.exp [new file with mode: 0644]