I am using Visual Studio 2012, c++ with /clr.
When i'm debugging function void foo2(int w, int h), and move instruction pointer in any way, my arguments w and h are reset to zeros!
Code:
public ref class MyClass
{
public:
foo1(int a, int b);
foo2(int w, int h);
};
System::Void MyApp::FrmMain_Load(System::Object^ sender, System::EventArgs^ e)
{
MyClass myObj;
myObj.foo1(1, 2);
}
void MyClass::foo1(int a, int b)
{
...
int w = 100;
int h = 200;
foo2(w, h);
...
}
void MyClass::foo2(int w, int h)
{
int x = 5; int y = 10; ...
}
When i move instruction pointer in void foo2(int w, int h) in any way, values for arguments w and h reset to zero!
I tried disabling any optimizations and tried changing project options but nothing helps. Of course, i'm not in release mode.
Also, another problem, (less important) is that when arguments names in declaration and in implementation of function are not same, debugger cannot see values.
example:
void foo(int w1, int h1);
void foo(int w, int h)
{
}
Any help?