Breaking During Function Evaluation in the Visual Studio Debugger
The Visual Studio 2005 debugger now lets you break during function evaluation in the same way that it breaks during program execution. Things that will cause the debugger to break during function evaluation include:
A breakpoint in the function is hit.
An unhandled exception is thrown.
An exception is thrown, and the corresponding Thrown box in the Exceptions dialog box is checked. On the Debug menu, click Exceptions to access the Exceptions dialog box.
The experience for each of these cases is similar to what you would experience if you had hit a breakpoint or unhandled exception while debugging normal program execution.
There are certain cases where the debugger will not break, however. These include:
Evaluating the condition of a breakpoint.
Evaluating functions in the Watch window.
Sometimes function evaluation may take longer than expected, or enter an infinite loop. To stop a function evaluation, select Stop Evaluation from the Debug menu while the function is being evaluated.
Threads and Function Evaluation
During function evaluation, all threads other than the function you are evaluating are frozen. You should not evaluate a function that waits for another thread, as the evaluation will never complete.
However, if you create a thread with a function evaluation, the thread is treated the same as it would be during normal program execution.