Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does type `*` mean for __vfptr?

Yes I know * is a pointer. That's not what I'm talking about. In one of my programs I had a breakpoint set and I noticed that in the autos there was a variable __vfptr with value 0x000007feed210a00.

However under type, it just said * and that's it. All of the other pointers in my program had types like unsigned char* or some::namespace::Frame*, or int*. These make sense since the pointer is tied directly to a particular class or data type. But I have no idea that the * could be, are there really just plain pointer types?

EDIT : I'm using Visual Studio 2010.

like image 262
xcdemon05 Avatar asked Feb 01 '13 14:02

xcdemon05


2 Answers

__vfptr contains the Virtual method table and it contains information that allows dynamic binding in inheritances.

Information in it will include things like function pointers to resolve virtual functions and information on the class and it's parents.

like image 135
Caesar Avatar answered Sep 28 '22 01:09

Caesar


The answer is obviously implementation dependent, and formally concerns your debugger, and not C++. In practice, however, some variant of _vptr is the more or less standard (in the sense usual, and not in the sense of being defined by a formal standard) name for the pointer to the _vtable, which in turn contains all sorts of information necessary for the resolution of virtual functions and RTTI. So the _vptr is a pointer to a table of pointers, offsets, and a lot of other different things. The debugger is probably just avoiding having to give this target a name or describing its structure.

like image 26
James Kanze Avatar answered Sep 28 '22 03:09

James Kanze