Figure 3: Using a conditional to breakpoint on suspect code when a program is in a particular state

// RAM-based variables (upperLimit can be 
// changed at run time) 
bool breakPointC = false;
int upperLimit = 5000;

// ROM-based code
void myAffectedFunction ()
{
    int partialResult = 0;

    // Some unaffected code that modifies 
    // partialResult
    ...

    // Now check for the intermittent bug.
    if (breakPointC &&
        upperLimit < partialResult)
        RamBreakFunction (BrkPointC);

    // Rest of myAffectedFunction()
    ...
}