DOCUMENT:Q130667 27-JUL-2001 [visualc] TITLE :PRB: F12 Causes Hard-Coded Breakpoint Exception When Debugging PRODUCT :Microsoft C Compiler PROD/VER:WINDOWS NT:1.0,2.0,2.1,4.0,5.0 OPER/SYS: KEYWORDS:kbDebug kbide kbVC100 kbVC200 kbVC210 kbVC400 kbVC500 kbVC600 ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - The Integrated Debugger, included with: - Microsoft Visual C++, 32-bit Editions, versions 1.0, 2.0, 2.1, 4.0 - Microsoft Visual C++, 32-bit Enterprise Edition, version 5.0 - Microsoft Visual C++, 32-bit Professional Edition, version 5.0 - Microsoft Visual C++, 32-bit Enterprise Edition, version 6.0 - Microsoft Visual C++, 32-bit Professional Edition, version 6.0 - Microsoft Visual C++, 32-bit Learning Edition, version 6.0 ------------------------------------------------------------------------------- SYMPTOMS ======== When debugging an application under Windows NT, pressing the F12 key when the debuggee (the application) has focus causes the integrated debugger to pause the debuggee and display a dialog with one of the following messages: Break caused by hard coded breakpoint instruction. -or- User breakpoint called from code at
This occurs only under Windows NT, not under any other Win32 platform. CAUSE ===== When the F12 key is pressed and the application in focus is being debugged, Windows NT calls a function similar to DebugBreak(), which executes a hard coded breakpoint instruction. The integrated debugger then traps the exception generated by this instruction. This behavior is intentional and occurs with other debuggers such as WinDbg from the Windows 32-bit SDK. RESOLUTION ========== While there is no way to disable this functionality, it doesn't affect the application that's being debugged other than to pause debugging and change focus. You can continue debugging by pressing the F5 key. This can be annoying if you have an application that heavily uses the F12 key, so you may want to temporarily assign another key to handle the F12 key functionality in your program when debugging. STATUS ====== This behavior is by design. Additional query words: IDE ====================================================================== Keywords : kbDebug kbide kbVC100 kbVC200 kbVC210 kbVC400 kbVC500 kbVC600 Technology : kbVCsearch kbAudDeveloper kbIntegratedDebugger Version : WINDOWS NT:1.0,2.0,2.1,4.0,5.0 Issue type : kbprb ============================================================================= 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. Copyright Microsoft Corporation 2001.