Example #1
0
void MCDebuggingExecDebugDo(MCExecContext& ctxt, MCStringRef p_script, uinteger_t p_line, uinteger_t p_pos)
{
	Boolean added = False;
	if (MCnexecutioncontexts < MAX_CONTEXTS)
	{
		ctxt.SetLineAndPos(p_line, p_pos);
		MCexecutioncontexts[MCnexecutioncontexts++] = &ctxt;
		added = True;
	}

	if (MCdebugcontext >= MCnexecutioncontexts)
		MCdebugcontext = MCnexecutioncontexts - 1;

	MCExecContext *t_ctxt_ptr;
	t_ctxt_ptr = MCexecutioncontexts[MCdebugcontext];

	t_ctxt_ptr->GetHandler()->doscript(*t_ctxt_ptr, p_script, p_line, p_pos);
    
    // AL-2014-03-21: [[ Bug 11940 ]] Ensure the debug context is not permanently in a state of error.
    t_ctxt_ptr -> IgnoreLastError();
    
	if (added)
		MCnexecutioncontexts--;
}