struct ptr{
int node;
ptr *next;
ptr(){}
ptr(int _node, ptr *_next){ node=_node; next=_next; }
};
struct list_t{
ptr *sht;
int size;
void push(int node){
size++;
sht=new ptr(node,sht);
}
}shthead[100001], comp[200001], tree[200001];
The struct ptr is a smart pointer, be used as a linked list. But when I debug the code in gdb, I found that the ptr*'s were all converted to void*.
GDB output:
(gdb) pt ptr
type = struct ptr {
int node;
void *next;
public:
ptr(void);
ptr(int, void *);
}
However, I can still see the data of the struct if I covert them back to ptr* in gdb.
What's the reason for this please?
I'm using Arch Linux, GNOME, g++ 4.5.0, gdb 7.1. Without any compilation flags but a -g.
This GDB was configured as "i686-pc-linux-gnu"