FIX: Cannot Set Breakpoint with Boolean Type

Last reviewed: September 18, 1997
Article ID: Q116312
1.00 1.50 1.51 WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Visual Workbench Integrated Debugger included with:

        - Microsoft Visual C++ for Windows, versions 1.0, 1.5, and 1.51
    

SYMPTOMS

When setting a breakpoint in the Visual Workbench or CodeView for Windows, using the breakpoint type "Break at Location If Expression has Changed" and specifying the expression as a BOOL (int) value causes the breakpoint not to be hit.

STATUS

Microsoft has confirmed this to be a bug in the products listed at the beginning of this article. This problem was corrected in Visual C++ 1.52.

MORE INFORMATION

To reproduce this problem, use the FONTEST sample program and perform the following steps:

  1. Start the debugger.

  2. Load the file PRINT.C from the FONTEST project.

  3. In the function InitPrinting, shown below, break on the line "bUserAbort = FALSE:".

          BOOL bUserAbort = TRUE;
    

          BOOL PASCAL InitPrinting(HDC hdc, HWND hWnd, LPSTR msg)
          {
    
               HANDLE hInst = GetWindowWord(hWnd, GWW_HINSTANCE);
    
               bError = FALSE;
               bUserAbort = FALSE;     /* Set breakpoint here. */
          }
    
    

  4. To set a breakpoint, choose the Breakpoints option from the Data menu in CodeView for Windows or from the Debug menu in the Visual Workbench. Set the breakpoint with the following attributes:

          Type:       Break At Location If Expression has Changed
          Where:      At line 75 in print.c
          Expression: {InitPrinting}bUserAbort
          Length:     1
    
    

  5. Choose Add from the dialog box, and then select Close to save the breakpoints.

  6. Return to the main menu. Choose Go from the Run menu in CodeView for Windows (or from the Debug menu in the Visual Workbench) to start the application.

The debugger never stops at the breakpoint, although it should because the value of bUserAbort changes from TRUE to FALSE at that location.


Additional reference words: 1.00 1.50 Boolean
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: WBDebug
Keywords : kb16bitonly WBDebug kbbuglist kbfixlist kbtool
Version : 1.00 1.50 1.51
Platform : 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 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.