regarding MSVC debugger
-
hello, lets take the following example. class A { virtual void fun(){} }; class B: public A { void fun(); virtual void funB(){} }; class C:public B { void fun(){} void funB(){} }; now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. somenath m
-
hello, lets take the following example. class A { virtual void fun(){} }; class B: public A { void fun(); virtual void funB(){} }; class C:public B { void fun(){} void funB(){} }; now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. somenath m
To me is mystery why did it compiled, because in class C you try to override fun(), even though you should not be able, because it is already overriden in class B and its not virtual anymore. I cant help you about the rest, because MSVC does not show pointers to funcs to me at all.
-
hello, lets take the following example. class A { virtual void fun(){} }; class B: public A { void fun(); virtual void funB(){} }; class C:public B { void fun(){} void funB(){} }; now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. somenath m
Hi Somenath, now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). =>Class C object will contain vptr pointing to virtual table for class C and as thee are 2 virtual functions and first declared function is fun(), vptr will contain address of this class C "fun()". although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. =>yes as object C will contain only one ptr. class B: public A { void fun(); // modify this as void fun(){};-> add braces / def. virtual void funB(){} };
-
hello, lets take the following example. class A { virtual void fun(){} }; class B: public A { void fun(); virtual void funB(){} }; class C:public B { void fun(){} void funB(){} }; now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. somenath m
Hi Somenath, now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). =>Class C object will contain vptr pointing to virtual table for class C and as thee are 2 virtual functions and first declared function is fun(), vptr will contain address of this class C "fun()". although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. =>yes as object C will contain only one ptr. class B: public A { void fun(); // modify this as void fun(){};-> add braces / def. virtual void funB(){} };
-
To me is mystery why did it compiled, because in class C you try to override fun(), even though you should not be able, because it is already overriden in class B and its not virtual anymore. I cant help you about the rest, because MSVC does not show pointers to funcs to me at all.
-
To me is mystery why did it compiled, because in class C you try to override fun(), even though you should not be able, because it is already overriden in class B and its not virtual anymore. I cant help you about the rest, because MSVC does not show pointers to funcs to me at all.
-
Hi Somenath, now if we define an object of class C, and if we debug the application using MSVC debugger, then inside the object of C, the vtable will show the pointer to only fun(). =>Class C object will contain vptr pointing to virtual table for class C and as thee are 2 virtual functions and first declared function is fun(), vptr will contain address of this class C "fun()". although in actual memory of the vtable the pointer to funB() will be there, it is not displayed in the debugger's vftable entry. i am curious to know why it is like this. =>yes as object C will contain only one ptr. class B: public A { void fun(); // modify this as void fun(){};-> add braces / def. virtual void funB(){} };
Hi Dilip, consider the problem as mentioned below. class A { public: virtual void fun(){} }; class B: public A { public: virtual void fun(){}; virtual void funB(){} }; class C:public B { public: virtual void fun(){} virtual void funB(){cout<<"This is in class c's funB()"<