BUG: Visual Workbench Debugger May Not Break in a Constructor

Last reviewed: July 22, 1997
Article ID: Q104636
1.00 1.50 WINDOWS kbtool kbbuglist

The information in this article applies to:

  • The Visual Workbench Integrated Debugger included with: Microsoft Visual Workbench for Windows, versions 1.0 and 1.5

SYMPTOMS

The Visual Workbench debugger does not stop at the breakpoint in a constructor called when a global object is instantiated in a C++ program.

RESOLUTION

A possible workaround is to add an interrupt 3 call to force the debugger to break inside the constructor, and then begin debugging from the interrupt 3 call. The code would resemble the following:

  _asm int 3

Another workaround is to use the CodeView debugger with Visual C++ Professional Edition 1.0.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Visual Workbench debugger. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

This problem does not occur in Microsoft Visual C++ 32-bit Edition, version 1.0.

MORE INFORMATION

The following sample program demonstrates the problem. To reproduce the problem in the Visual Workbench debugger, compile and link the sample as a QuickWin program or place the similar code in a Windows program. Then you can set a breakpoint on the cout statement and press F5.

Sample Code

#include <iostream.h>
class test{
      int a;
      public:
      test();
      };
 test::test(){
      a=0;
      cout<<"This is inside constructor"; //Set a breakpoint here.
      };

test dummy; test *ptr=new test; // This call should be fine.
void main()
{ }


Additional reference words: 1.00 1.50
KBCategory: kbtool kbbuglist
KBSubcategory: WBDebug
Keywords : kb16bitonly


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.