Stepping into wrong function
I have an interface that lists some methods:
----------IToken.h-----------------
public IToken {
virtual string getSomeToken() = 0;
virtual void setSomeToken(string tt) = 0;
}
---------MyToken.h---------------
public MyToken: public IToken {
private:
string m_tt;
public:
string getSomeToken();
void setSomeToken(string tt);
}
---------MyToken.cpp------------
string MyToken::getSomeToken(){
return m_tt;
}
void MyToken::setSomeToken(string tt){
m_tt = tt;
}
Now this has been working all along. Suddenly I decided to add 2 more
methods:
----------IToken.h-----------------
public IToken {
virtual string getSomeToken() = 0;
virtual void setSomeToken(string tt) = 0;
virtual string getToken2() = 0;
virtual void setToken2() = 0;
virtual string getToken3() = 0;
virtual void setToken3() = 0;
}
---------MyToken.h---------------
public MyToken: public IToken {
private:
string m_tt;
string m_tok2;
string m_tok3;
public:
string getSomeToken();
void setSomeToken(string tt);
string getToken2();
void setToken2();
string getToken3();
void setToken3();
}
---------MyToken.cpp------------
string MyToken::getSomeToken(){
return m_tt;
}
void MyToken::setSomeToken(string tt){
m_tt = tt;
}
void MyToken::setToken2(){
m_tok2 = "preset_token2";
}
string MyToken::getToken2(){
return m_tok2;
}
void MyToken::setToken3(){
m_tok3 = "preset_token3";
}
string MyToken::getToken3(){
return m_tok3;
}
What happens when I run it under the debugger is that the if some code
is calling the new method setToken3(), the debugger steps into
setToken2(). It does this consistently.
I have deleted all obj files, pdb files, exp, ilk, etc. and exe files
that are generated by the VC build process and cleaned and rebuilt
from scratch. But it didn't do any good. The same thing happens. I
believe this is a well-known problem with VC's implementation of V-
tables. Can someone please guide me as to how to go about solving
this?
Thanks in advance.