This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
ptype bug
- From: Stewart Brown <sb24 at avaya dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Apr 2002 10:33:33 -0600
- Subject: 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