FIX: Conditional Breakpoint Doesn't Stop in Recursive FunctionLast reviewed: September 18, 1997Article ID: Q123160 |
1.50 1.51 | 1.00 2.00 2.10
WINDOWS | WINDOWS NTkbtool kbfixlist The information in this article applies to:
SYMPTOMSUsing "Break when Expression is True" in a recursive function in the Visual C++ integrated debugger may fail to stop program execution even if the expression becomes true.
RESOLUTIONInstead of using "Break when Expression is True," use "Break at Location if Expression is True" to work around the problem.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was not reproducible in Microsoft Visual C++, 32-bit Edition, version 4.0.
MORE INFORMATIONTo demonstrate the problem, build the sample code below for debug mode and do the following:
Sample Code
/* Compile options needed: /Zi /Od */ #include <stdio.h> int function1( int i, int j ){ if ( i>0 ) { return function1( i-1, j+1 ); } else { return j; }}
void main(void){ int i; printf( "Before Recursive Call.\n" ); i = function1( 10, 0 ); printf( "Back from Recursive Call.\n" );}
|
Additional reference words: 1.00 1.50 2.00 2.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |