From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31081 invoked by alias); 17 Jan 2019 17:22:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31069 invoked by uid 89); 17 Jan 2019 17:22:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=20182019, UD:infcall-nested-static-structs.cc, infcall-nested-static-structs.cc, infcallnestedstaticstructscc X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Jan 2019 17:22:26 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D9C2124570; Thu, 17 Jan 2019 17:22:25 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66EFA1048110; Thu, 17 Jan 2019 17:22:24 +0000 (UTC) Subject: Re: [PATCH 2/2] AArch64 AAPCS: Ignore static members To: Alan Hayward , "gdb-patches@sourceware.org" References: <20190116155734.53824-1-alan.hayward@arm.com> <20190116155734.53824-3-alan.hayward@arm.com> Cc: nd From: Pedro Alves Message-ID: Date: Thu, 17 Jan 2019 17:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190116155734.53824-3-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00409.txt.bz2 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