This is the mail archive of the gdb-patches@sources.redhat.com 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]

ptype bug


I found a bug with ptype.  Below is a description of the bug.  In the
attached tar file is a README file with more details, a test program
demonstating this bug, a ChangeLog and a patch file with my fix in it.

ptype command outputs wrong type when type is a typedef *.  For example
with the code:

typedef char* CHAR;
typedef CHAR* CHAR2;

the gdb command 'ptype CHAR' correctly reports char*, but 'ptype CHAR2'
reports
char *.  This is incorrect, as CHAR2 is actually a char**.

Another example:

typedef void (*fptr) (void);
typedef fptr* ptr;
fptr f;
ptr p;

the commands 'ptype f' and 'ptype fptr' both correctly return 'void
(*)(void)',
but the commands 'ptype ptr' and 'ptype p' both return 'void *', where
they
should return 'void (**)(void)'

Stewart Brown



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