Q106394
Setting a watch on a data member of a structure whose tag name is the
same as the struct variable name produces an incorrect result.
This problem occurs with C++ programs in the Visual Workbench Debugger
for Windows, CodeView for Windows, and CodeView for MS-DOS.
This problem occurs with C programs in the Visual Workbench Debugger
for Windows NT and CodeView for Win32s.
The best solution is to not use the same name for the struct tag and the struct variable. Another option is to use the Locals window to display the data member.
Microsoft has confirmed this to be a problem in the Microsoft products listed above. This problem was fixed in Microsoft Visual C++, 32-bit Edition, version 4.0.
To reproduce the problem in the Visual Workbench debugger, compile and
link the following sample as a QuickWin program or place similar code
in a Windows program. If you set a watch on test, it will expand
correctly in the Watch window.
The incorrect expansion is:
-test
int a
The correct expansion is:
-test = {...}
a = 1;
/* Compiler Options needed: /Od /Zi
*/
void main()
{
struct test
{
int a;
} test;
test.a=1;
}
Additional query words: 1.00 1.10 1.50 2.00 4.00 4.10 tagname
Keywords : kbCodeView kbDebug kbide kbVC
Issue type : kbbug
Technology :
|
Last Reviewed: July 30, 2001 |