Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Pedro Alves'" <pedro@codesourcery.com>, <gdb-patches@sourceware.org>
Subject: RE: [RFA] Fix display of array of unspecified length inside structures
Date: Fri, 18 Feb 2011 15:01:00 -0000	[thread overview]
Message-ID: <00c301cbcf7b$afaa6d20$0eff4760$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <201102181147.52337.pedro@codesourcery.com>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : vendredi 18 février 2011 12:48
> À : gdb-patches@sourceware.org
> Cc : Pierre Muller
> Objet : Re: [RFA] Fix display of array of unspecified length inside
> structures
> 
> On Friday 18 February 2011 11:08:38, Pierre Muller wrote:
> 
> > 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?
> 
> 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?
 
> 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

  
> 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...
> 
> > 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...

 
> > 2011-02-18  Pierre Muller  <muller@ics.u-strasbg.fr>
> >
> > 	* c-valprint.c (c_val_print): Add embedded_offset to address
> > 	for arrays of unspecified length.
> > 	* p-valprint.c (pascal_val_print): Likewise.
> 
> Okay, thanks.
  Thanks for the approval,
committed to main branch.

Pierre


  reply	other threads:[~2011-02-18 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 11:34 Pierre Muller
2011-02-18 11:59 ` Pedro Alves
2011-02-18 15:01   ` Pierre Muller [this message]
2011-02-18 15:38     ` Pedro Alves
2011-02-18 17:39       ` Pierre Muller
2011-02-18 17:41         ` Pedro Alves

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='00c301cbcf7b$afaa6d20$0eff4760$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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