Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Alan Hayward <Alan.Hayward@arm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH 2/2] AArch64 AAPCS: Ignore static members
Date: Thu, 17 Jan 2019 17:22:00 -0000	[thread overview]
Message-ID: <a3ed574d-46f2-623e-4e28-eda8e66a1865@redhat.com> (raw)
In-Reply-To: <20190116155734.53824-3-alan.hayward@arm.com>

On 01/16/2019 03:57 PM, Alan Hayward wrote:
> Static members in C++ structs are global data and therefore not part of the
> list of struct members considered for passing in registers.
> 
> Note the corresponding code in GCC (from which the GDB AAPCS code is based)
> does not have any static member checks due to the static members not being
> part of the struct type at that point.
> 
> Add a new test based on gdb.base/infcall-nested-structs.exp, adding static
> members.

Diffing the files, it seems a lot is shared.  Would it be
possible and make sense to put the static members tests in
infcall-nested-structs.c, wrapped with #ifdef __cplusplus?

> diff --git a/gdb/testsuite/gdb.cp/infcall-nested-static-structs.cc b/gdb/testsuite/gdb.cp/infcall-nested-static-structs.cc
> new file mode 100644
> index 0000000000..bec63728f4
> --- /dev/null
> +++ b/gdb/testsuite/gdb.cp/infcall-nested-static-structs.cc
> @@ -0,0 +1,222 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> +   Copyright 2018 Free Software Foundation, Inc.

This would be 2018-2019.

> +
> +/* Structures with two fields nested to various depths, one of which is static,
> +   along with some empty structures.  */

Is the "along with some empty structures." part important for this test?
Kind of seems like the other bug bleeds into this test?

> +
> +int cmp_struct_02_01 (struct struct_02_01 a,
> +			     struct struct_02_01 b)
> +{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == a.s2.s1.b; }
> +
> +int cmp_struct_02_02 (struct struct_02_02 a,
> +			     struct struct_02_02 b)
> +{ return a.a == b.a && a.b == b.b; }
> +
> +int cmp_struct_02_03 (struct struct_02_03 a,
> +			     struct struct_02_03 b)
> +{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b; }
> +
> +int cmp_struct_02_04 (struct struct_02_04 a,
> +			     struct struct_02_04 b)
> +{ return a.a == b.a && a.b == b.b; }
> +

While diffing I noticed formatting changes spurious here.

> +foreach ta $int_types {
> +    start_gdb_and_run_tests $ta
> +}
> +
> +# if [support_complex_tests] {
> +#     foreach ta $complex_types {
> +# 	start_gdb_and_run_tests $ta
> +#     }
> +# }
> +

Looks like you meant to remove this.

Thanks,
Pedro Alves


  reply	other threads:[~2019-01-17 17:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 15:57 [PATCH 0/2] AArch64 AAPCS: Improve argument passing Alan Hayward
2019-01-16 15:57 ` [PATCH 2/2] AArch64 AAPCS: Ignore static members Alan Hayward
2019-01-17 17:22   ` Pedro Alves [this message]
2019-01-16 15:57 ` [PATCH 1/2] AArch64 AAPCS: Empty structs have non zero size in C++ Alan Hayward
2019-01-17 17:08   ` Pedro Alves
2019-01-18 10:34     ` Alan Hayward
2019-01-21 15:52       ` Alan Hayward
2019-10-10 23:49         ` Tom de Vries
2019-10-11 12:14           ` [gdb/tdep] Fix 'Unexpected register class' assert in amd64_push_arguments Tom de Vries
2019-10-14 13:10             ` Alan Hayward
2019-10-14 15:23               ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3ed574d-46f2-623e-4e28-eda8e66a1865@redhat.com \
    --to=palves@redhat.com \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox