From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25741 invoked by alias); 17 Oct 2002 20:08:53 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25734 invoked from network); 17 Oct 2002 20:08:52 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 17 Oct 2002 20:08:52 -0000 Received: from redhat.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id B19268000E3; Thu, 17 Oct 2002 16:08:51 -0400 (EDT) Message-ID: <3DAF185B.7010100@redhat.com> Date: Thu, 17 Oct 2002 13:08:00 -0000 From: Fernando Nasser Organization: Red Hat Canada User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH RFA] New constvars.exp tests References: <1021010203259.ZM16308@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00290.txt.bz2 This looks good. If I am not mistaken, your patch that fixes the printing has been already committed so these tests will either PASS or XFAIL. Pleas check it in. Thanks for the extra tests, Regards, Fernando Kevin Buettner wrote: > I am about to submit a patch which causes ptype to print a struct with > qualifiers correctly. E.g, for the "crass" test, gdb currently > exhibits the following behavior: > > (gdb) ptype crass > type = struct crass { > char * constptr; > } > > This is incorrect because gdb failed to print a space in between > "const" and "ptr". > > Unfortunately, if you don't use Dwarf 2, you'll simply end up seeing > > type = struct crass { > char *ptr; > } > > ...which is also wrong, but not unexpected (hence the xfail). > > For the "crisp" test, gdb currently does the following: > > (gdb) ptype crisp > type = struct crisp { > char * const*ptr; > } > > Here is what I regard to be the correct behavior for these commands: > > (gdb) ptype crass > type = struct crass { > char * const ptr; > } > (gdb) ptype crisp > type = struct crisp { > char * const *ptr; > } > > Okay? > > * gdb.base/constvars.c (struct crass, struct crisp): New structs. > * gdb.base/constvars.exp (ptype crass, ptype crisp): New tests. > > Index: testsuite/gdb.base/constvars.c > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/constvars.c,v > retrieving revision 1.1.1.1 > diff -u -p -r1.1.1.1 constvars.c > --- testsuite/gdb.base/constvars.c 16 Apr 1999 01:34:30 -0000 1.1.1.1 > +++ testsuite/gdb.base/constvars.c 10 Oct 2002 20:12:12 -0000 > @@ -166,6 +166,11 @@ main (void) > > const volatile char * const volatile vagary = &victor; > const volatile unsigned char * const volatile vendor = &vicar; > + > + /* various structs with const members */ > + > + struct crass { char * const ptr; } crass; > + struct crisp { char * const *ptr; } crisp; > > /* misc. references */ > /* > Index: testsuite/gdb.base/constvars.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.base/constvars.exp,v > retrieving revision 1.7 > diff -u -p -r1.7 constvars.exp > --- testsuite/gdb.base/constvars.exp 19 Dec 2001 21:08:45 -0000 1.7 > +++ testsuite/gdb.base/constvars.exp 10 Oct 2002 20:12:12 -0000 > @@ -278,6 +278,11 @@ proc do_constvar_tests {} { > gdb_test "print *locust" " = 70" > local_compiler_xfail_check > gdb_test "ptype locust" "type = double \\* const" > + > + local_compiler_xfail_check > + gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}" > + local_compiler_xfail_check > + gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}" > } > > do_constvar_tests > -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9