We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second.
There is no mention anywhere within the Active Scripting documentation of how to perform conditional breakpoints because the framework doesn't directly support them. SampleDebugger doesn't provide this functionality, but here's how it can be done.
Create a thread that can be used to resume the application when it hits a breakpoint.
Set a breakpoint for a particular source line.
Modify the BREAKPOINT structure to hold a string parameter that represents the condition that should evaluate to true when the breakpoint executes.
When the breakpoint is reached via the onHandleBreakPoint method, get a pointer to the top stack frame and query it for IDebugExpression.
Execute the expression without side effects and then just wait for it to complete.
If the expression evaluated to true, notify the user that the breakpoint was hit; otherwise, signal the thread created in step 1 to resume the application.
Similar steps can be taken to implement breakpoints that are executed after a number of iterations. Instead of evaluating an expression, a counter is incremented and checked against a maximum value that represents the number of iterations to skip the breakpoint. When the counter and the maximum value are equivalent, then the software would notify the user of the breakpoint. If this does not occur, the application would resume as if nothing happened.