W
Whitney Kew
Hello,
I don't know if this has been discussed before, but I believe I've
found a bug in the .NET debugger. I'm on Win2KSP4, .NET 2003, and
..NET Framework 1.1. This bug occurs in a Managed C++ .NET project,
and is manifested in the Watch Window, QuickWatch, and Tool Tips
displaying incorrect variable values during runtime debugging.
Steps to reproduce:
1. Create a new Visual C++ .NET Console application using the New
Project wizard.
2. Replace the generated sample code in the main .CPP file with the
following:
struct B
{
int n;
};
struct A
{
B b[2];
};
int _tmain()
{
A a = {0};
a.b[0].n = 123;
a.b[1].n = 123;
int a0 = a.b[0].n;
int a1 = a.b[1].n;
return 0;
}
3. Place a breakpoint at the "return 0;" line, and then compile and
run the app.
4. Open a Watch Window, and display the following four quantities:
a.b[0].n
a.b[1].n
a0
a1
- Observe that the Watch Window displays the value of a.b[1].n as 0,
NOT 123!
- Observe that by simply hovering the mouse cursor over the a1
variable, the Tool Tip that is displayed for a1's value shows a value
of 123, but that the Tool Tip that is displayed for the value of
a.b[1].n shows a value of 0!
I had a colleague of mine verify the exact same behavior. Could
someone either confirm or deny that this is a bug? By the way, this
behavior has cost me many hours of wasted debugging time, since I've
pretty much placed my trust in the Watch Window/Tool Tips debugging
features of Visual C++ compilers until now....
Thank you!
Whitney Kew
Software Engineer
Rain Bird Corp.
I don't know if this has been discussed before, but I believe I've
found a bug in the .NET debugger. I'm on Win2KSP4, .NET 2003, and
..NET Framework 1.1. This bug occurs in a Managed C++ .NET project,
and is manifested in the Watch Window, QuickWatch, and Tool Tips
displaying incorrect variable values during runtime debugging.
Steps to reproduce:
1. Create a new Visual C++ .NET Console application using the New
Project wizard.
2. Replace the generated sample code in the main .CPP file with the
following:
struct B
{
int n;
};
struct A
{
B b[2];
};
int _tmain()
{
A a = {0};
a.b[0].n = 123;
a.b[1].n = 123;
int a0 = a.b[0].n;
int a1 = a.b[1].n;
return 0;
}
3. Place a breakpoint at the "return 0;" line, and then compile and
run the app.
4. Open a Watch Window, and display the following four quantities:
a.b[0].n
a.b[1].n
a0
a1
- Observe that the Watch Window displays the value of a.b[1].n as 0,
NOT 123!
- Observe that by simply hovering the mouse cursor over the a1
variable, the Tool Tip that is displayed for a1's value shows a value
of 123, but that the Tool Tip that is displayed for the value of
a.b[1].n shows a value of 0!
I had a colleague of mine verify the exact same behavior. Could
someone either confirm or deny that this is a bug? By the way, this
behavior has cost me many hours of wasted debugging time, since I've
pretty much placed my trust in the Watch Window/Tool Tips debugging
features of Visual C++ compilers until now....
Thank you!
Whitney Kew
Software Engineer
Rain Bird Corp.