DOCUMENT:Q122118 11-FEB-2002 [visualc] TITLE :PRB: Editing While Debugging Causes Breakpoint Misalignment PRODUCT :Microsoft C Compiler PROD/VER::2.0,2.1,2.2,4.0,5.0,6.0 OPER/SYS: KEYWORDS:kbDebug kbide kbVC200 kbVC210 kbVC220 kbVC400 kbVC500 kbVC600 ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - The Integrated Debugger, included with: - Microsoft Visual C++, 32-bit Editions, versions 2.0, 2.1, 2.2, 4.0, 5.0, 6.0 ------------------------------------------------------------------------------- SYMPTOMS ======== During debugging it is common to find bugs and make minor code changes as you continue debugging. However, editing source code while in the middle of a debugging session may cause new or existing "Break At Location" breakpoints to become misaligned with their corresponding instructions. ("Break At Location" is the default type if the breakpoints are set using the toolbar button in the Visual C++ development environment.) If, after editing, the source file remains the same in terms of line positions, then breakpoints will appear as expected. However, if the source file changes in terms of line positions, new breakpoint indicators (the red dots) will shift position with respect to their corresponding instruction by the number of lines added or deleted before each breakpoint. Alternately, the red dot breakpoint indicators for pre-existing breakpoints will follow their corresponding instructions during editing, but after the rebuild warning, the program execution continues and the pre-existing breakpoints are hit, the yellow current instruction pointer will be out of sync with the corresponding instruction by the number of lines added or deleted before each breakpoint. CAUSE ===== The debugger does not track line number changes during editing, so it does not update new breakpoint and the current instruction pointer indicators accordingly. STATUS ====== This behavior is by design. Additional query words: IDE VWB visual workbench source window ====================================================================== Keywords : kbDebug kbide kbVC200 kbVC210 kbVC220 kbVC400 kbVC500 kbVC600 Technology : kbVCsearch kbAudDeveloper kbIntegratedDebugger Version : :2.0,2.1,2.2,4.0,5.0,6.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 2002.