BUG - Debugger displaying incorrect values in Watch Window/QuickWatch/Tool Tips

  • Thread starter Thread starter Whitney Kew
  • Start date Start date
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.
 
Hello Ken,

Thank you very much for taking the time to evaluate this - I really
appreciate the fact that you and other MS engineers are monitoring and
responding to these newsgroups! I also appreciate your quick
response.

Whitney Kew
Software Engineer
Rain Bird Corp.

I followed your steps, and this does appear to be a bug. Thanks for
bringing this to our attention. I apologize for the time this problem cost
you.
I'm looking into getting this bug fixed for future releases.

Thanks,
Ken

--------------------
From: (e-mail address removed) (Whitney Kew)
Newsgroups: microsoft.public.vsnet.debugging,microsoft.public.vsnet.general,microsoft.pu
blic.dotnet.general
Subject: BUG - Debugger displaying incorrect values in Watch Window/QuickWatch/Tool Tips
Date: 10 Mar 2004 12:17:05 -0800
Organization: http://groups.google.com
Lines: 65
Message-ID: <[email protected]>
NNTP-Posting-Host: 67.97.185.98
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1078949825 29552 127.0.0.1 (10 Mar 2004 20:17:05 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Wed, 10 Mar 2004 20:17:05 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!border2.nntp.ash.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.e
arthlink.net!newshosting.com!nx01.iad01.newshosting.com!news.glorb.com!postn
ews1.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.general:17354
microsoft.public.dotnet.general:127491 microsoft.public.vsnet.debugging:5172
X-Tomcat-NG: microsoft.public.vsnet.debugging

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.
 
Back
Top