BUG: Breakpoint Skip Count Resets to Zero After First PassLast reviewed: July 14, 1997Article ID: Q171065 |
The information in this article applies to:
SYMPTOMSIf you set a breakpoint with a skip count, the debugger behaves correctly and stops at the breakpoint for the first time after skipping the breakpoint the number of counts specified. However, after the first pass the breakpoint is hit every time without skipping the breakpoint for the specified counts.
CAUSEThe debugger resets the skip count to 0 after the first pass.
RESOLUTIONSee the MORE INFORMATION section for a workaround.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe skip count feature is very useful in a loop where you want to stop inside the loop after skipping a line of code for a certain number of times. The following sample describes a situation of this nature.
Steps to Reproduce BehaviorBuild the following code with debug information.
// File name test.cpp #include <iostream.h> int main() { cout << "Start debugging" << endl; for( int i = 0; i < 100; ++i ) cout << i << "\n"; //SET A BREAKPOINT HERE return 0; }Set a breakpoint on the line shown and press the F5 key (Debug Go). The debugger will stop at this line of code. The Auto window will show the value of i to be 0. Press the F5 key. Again, the debugger stops at the breakpoint and the value of i is shown to be 1.
WorkaroundChange the skip count to a value other than the last set using Condition. For example set it to 0, click OK, and go back to main dialog box. Set Condition to 5, click OK, and click OK again to close the main dialog box. Press the F5 key, and the breakpoint is skipped 5 times. You must repeat this process every time you want to skip more than once. Alternatively, if your loop has a count variable like "i" in the sample code above, you can use conditional breakpoint to get the same effect. Set breakpoint to break when 'i % 5 == 0' is true. |
Keywords : WBDebug
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |