Fix passing of struct with bitfields on x86-64
authorTom Tromey <tromey@adacore.com>
Tue, 16 Apr 2019 17:11:10 +0000 (11:11 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 24 Apr 2019 18:01:03 +0000 (12:01 -0600)
commita59240a41ac34d91e4ef5dd8b484763639388364
tree8543a94201f810ff63de79fcf095c68bb84f2eb1
parent1b8dd6432644c256ab294d205a8e00f6c6dc5073
Fix passing of struct with bitfields on x86-64

Commit 4aa866af ("Fix AMD64 return value ABI in expression
evaluation") introduced a regression when calling a function with a
structure that contains bitfields.

Because the caller of amd64_has_unaligned_fields handles bitfields
already, it seemed to me that the simplest fix was to ignore bitfields
here.

gdb/ChangeLog
2019-04-24  Tom Tromey  <tromey@adacore.com>

* amd64-tdep.c (amd64_has_unaligned_fields): Ignore bitfields.

gdb/testsuite/ChangeLog
2019-04-24  Tom Tromey  <tromey@adacore.com>

* gdb.arch/amd64-eval.exp: Test bitfield return.
* gdb.arch/amd64-eval.cc (struct Bitfields): New.
(class Foo) <return_bitfields>: New method.
(main): Call it.
gdb/ChangeLog
gdb/amd64-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-eval.cc
gdb/testsuite/gdb.arch/amd64-eval.exp