This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Determining type of an object at debug time.
- To: dan at cgsoftware dot com
- Subject: Re: Determining type of an object at debug time.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 14 Mar 2000 02:13:28 +0100
- CC: gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10003131653560.8750-100000@localhost.localdomain>
> Finding the vpointer is easy, we always know where it is.
How exactly do you do that? There might not even be a vpointer in the
struct... Consider
struct Base{
char buf[1000];
int i;
};
struct Derived:virtual Base{
virtual ~Derived();
};
Given a Base*, how exactly do you find out that the complete object is
a Derived*? Or, worse, what if it is
void foo(void*x){
...
}
foo(new Derived);
How do you know x is a Derived* inside foo?
> I have it working.
Very good!
Martin