From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80972 invoked by alias); 24 Jul 2015 11:41:25 -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 80961 invoked by uid 89); 24 Jul 2015 11:41:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Jul 2015 11:41:24 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D9E5F8EA4C; Fri, 24 Jul 2015 11:41:22 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6OBfLl5021768; Fri, 24 Jul 2015 07:41:22 -0400 Message-ID: <55B22461.8090702@redhat.com> Date: Fri, 24 Jul 2015 11:41:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 5/5] Add new test internalvar.exp References: <1437072684-26565-1-git-send-email-simon.marchi@ericsson.com> <1437072684-26565-5-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1437072684-26565-5-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00694.txt.bz2 On 07/16/2015 07:51 PM, Simon Marchi wrote: > I wrote this test While doing the work that lead to the previous patch, > so I thought I would contribute it upstream. From what I can see, there > is no test currently to verify operations on internal variables (please > point me to it if I'm wrong). Pedantically, it'd be better to call these convenience vars. Convenience var specifics are tested in gdbvars.exp. Likely we have this more covered on the C++ tests. Something like what you're testing, but for bitfields, is done in bitfields.exp. structs.exp is for infcalls, which IIRC your target doesn't do. I guess one could hack a bug in the value field access code somewhere in value.c/valops.c/valprint.c, and the find the test that has more failures. :-) In any case, more tests can't hurt. :-) AFAICS, this is really more about getting value field offsets and contents right than convenience vars per se, which end up just exercising the routine value paths. You could put these in gdb.base/struct3.c|.exp, which if you look at struct3.c, it's structure is similar, with an inner and outer struct too. Otherwise, I'd suggest renaming the test in the value direction -- value-fields.exp, value-units.exp, value-offsets.exp or some such. I'd also suggest making the describing comment be something like: # Test accessing different fields of structures, inner structures, # arrays, etc., and make sure GDB prints the right contents. Handy to # exercise the value machinery code that handles host vs target bytes/memory # units. Anyway, the test code itself looks good to me, with: > --- > gdb/testsuite/gdb.base/internalvar.c | 45 ++++++++++++++++++++++++++++++++++ > gdb/testsuite/gdb.base/internalvar.exp | 42 +++++++++++++++++++++++++++++++ > 2 files changed, 87 insertions(+) > create mode 100644 gdb/testsuite/gdb.base/internalvar.c > create mode 100644 gdb/testsuite/gdb.base/internalvar.exp > > diff --git a/gdb/testsuite/gdb.base/internalvar.c b/gdb/testsuite/gdb.base/internalvar.c > new file mode 100644 > index 0000000..2aadc11 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/internalvar.c > @@ -0,0 +1,45 @@ Copyright header missing. Thanks, Pedro Alves