This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

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

Should be fine.

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

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]