Bug 14772 - __attribute__ type output is sometimes incorrectly formatted
Summary: __attribute__ type output is sometimes incorrectly formatted
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: cli (show other bugs)
Version: unknown
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-26 18:51 UTC by Tom Tromey
Modified: 2012-10-31 11:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2012-10-26 18:51:23 UTC
The __attribute__((vector_size)) type output is sometimes wrong.
On Fedora 16 with a recent gdb:

(gdb) ptype $_siginfo
type = struct {
    int si_signo;
    int si_errno;
    int si_code;
    union {
        int _pad__attribute__ ((vector_size(28)));

There should be a space after "_pad".
Comment 1 Sourceware Commits 2012-10-31 09:26:27 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	aburgess@sourceware.org	2012-10-31 09:26:22

Modified files:
	gdb            : ChangeLog c-typeprint.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: gnu_vector.c gnu_vector.exp 

Log message:
	http://sourceware.org/ml/gdb-patches/2012-10/msg00525.html
	
	gdb/ChangeLog
	
	PR cli/14772
	* c-typeprint.c (c_print_type): Don't print a space for vector
	types, this is handled within the suffix.
	(c_type_print_varspec_suffix): Add a space to vector suffix
	
	gdb/testsuite/ChangeLog
	
	PR cli/14772
	* gdb.base/gnu_vector.c (union_with_vector_1)
	(struct_with_vector_1): Add new struct and union for testing
	ptype.
	* gdb.base/gnu_vector.exp: Add testing of ptype on vectors, and
	structs / unions containing vectors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14765&r2=1.14766
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-typeprint.c.diff?cvsroot=src&r1=1.81&r2=1.82
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3431&r2=1.3432
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/gnu_vector.c.diff?cvsroot=src&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/gnu_vector.exp.diff?cvsroot=src&r1=1.9&r2=1.10
Comment 2 Andrew Burgess 2012-10-31 11:40:56 UTC
Fixed by recent commit.