From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7506 invoked by alias); 18 Feb 2011 14:54:18 -0000 Received: (qmail 7497 invoked by uid 22791); 18 Feb 2011 14:54:16 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Feb 2011 14:54:11 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p1IEs3VS043067 ; Fri, 18 Feb 2011 15:54:03 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms5.u-strasbg.fr [130.79.204.14]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p1IEs2cF019470 ; Fri, 18 Feb 2011 15:54:03 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p1IEs2C7025442 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Fri, 18 Feb 2011 15:54:02 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <00ac01cbcf5c$31f5bc00$95e13400$@muller@ics-cnrs.unistra.fr> <201102181147.52337.pedro@codesourcery.com> In-Reply-To: <201102181147.52337.pedro@codesourcery.com> Subject: RE: [RFA] Fix display of array of unspecified length inside structures Date: Fri, 18 Feb 2011 15:01:00 -0000 Message-ID: <00c301cbcf7b$afaa6d20$0eff4760$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2011-02/txt/msg00460.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=E9=A0: vendredi 18 f=E9vrier 2011 12:48 > =C0=A0: gdb-patches@sourceware.org > Cc=A0: Pierre Muller > Objet=A0: Re: [RFA] Fix display of array of unspecified length inside > structures >=20 > On Friday 18 February 2011 11:08:38, Pierre Muller wrote: >=20 > > PS: It could be wise to add some test in the testsuite for > > this, but I have no idea where I could insert this kind of test, > > any ideas? >=20 > Yes, please. We have surprisingly few tests for this sort of > thing, AFAICS. I'm not even sure this is a regression from > my recent changes, I think it may well not be. I checked out gdb version 7.2 shows this regression, as compared to Cygwin 6.8 at least... Which means that the regression is not really recent. This might means that we should also merge this patch to the branch, no? =20 > Zero-length arrays (as poor man's flexible arrays) are supported > in GNU C as an extension. To be portable, you'd > need to use an array of length 1 (or c99's real flexible arrays), > but that won't trigger the bug. Apparently there is also the flexible array member construct see http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Zero-Length.html =20=20 > I'd point at printcmds.exp, but I'm not sure if there are compilers > out there that choke on the construct... There's always a > new test file option... >=20 > > PS2: It is probably impossible to make such a test without > > alloca or some other memory allocation function, no? > > Are there any system restriction for this? There is a long check at start of gdb.base/funcargs.c but it might just be to really check that alloca really uses the stack... =20 > > 2011-02-18 Pierre Muller > > > > * c-valprint.c (c_val_print): Add embedded_offset to address > > for arrays of unspecified length. > > * p-valprint.c (pascal_val_print): Likewise. >=20 > Okay, thanks. Thanks for the approval, committed to main branch. Pierre