FIX: Visual C++ Debugger Unable to Watch Base Class Members

Last reviewed: September 16, 1997
Article ID: Q102212
4.10 | 1.00 4.10 MS-DOS | WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Visual Workbench Integrated Debugger included with: Microsoft Visual C++ for Windows, version 1.0
  • Microsoft CodeView for MS-DOS, version 4.1
  • Microsoft CodeView for Windows, version 4.1

SYMPTOMS

An attempt to place a watchpoint on a base class member variable of a derived class may fail. Microsoft CodeView for MS-DOS, CodeView for Windows, and the Visual Workbench debugger may display one of the following messages in the Watch or Locals window:

   CXX0030: Error: expression cannot be evaluated

   +??? * = {...} which expands into the CXX0030 message

In CodeView version 4.1 for MS-DOS, expanding a local object in the Locals window may cause the debugging session to hang. However, expanding the local, static, global, or external object in the Watch window does not cause the debugging session to hang.

In CodeView version 4.1 for Windows or in the Visual Workbench version 1.0 debugger, expanding a local, static, global, or external object in the Locals or Watch window does not cause the debugging session to hang.

This problem does not occur in CodeView versions 4.0 and 4.01 for MS-DOS and Windows.

RESOLUTION

To work around this problem, modify the code to add a constructor for the base class. The comments in the code example below demonstrate this procedure.

STATUS

Microsoft has confirmed this to be a problem in CodeView version 4.1 for MS-DOS and Windows and the Visual Workbench version 1.0 for Windows. This problem was corrected in Visual Workbench 32-bit Edition version 1.1 and in CodeView version 4.25 for Win32s.

MORE INFORMATION

The following code example demonstrates this problem. The error occurs if you attempt to expand the local instantiation of Derived_from_Test or if you place the cursor on the local object "local_object" and press SHIFT+F9 to activate the QuickWatch window.

Sample Code

/*
 * Compiler options needed: none
 */

class Test { public:
   // To work around this problem, remove the comment from the
   // following line to define a default constructor.
   // Test() { }
   int test_int;
};

class Derived_from_Test : public Test { };

void main(void)
{
   Derived_from_Test local_object;
}


Additional reference words: 1.00 4.10
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: WBDebug CvwIss
Keywords : CvwIss kb16bitonly WBDebug kbbuglist kbfixlist kbtool
Version : 4.10 | 1.00 4.10
Platform : MS-DOS WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.