MCPcopy Create free account
hub / github.com/adventuregamestudio/ags / scriptDebugHook

Function scriptDebugHook

Engine/debug/debug.cpp:674–707  ·  view source on GitHub ↗

allow LShift to single-step, RShift to pause flow

Source from the content-addressed store, hash-verified

672
673// allow LShift to single-step, RShift to pause flow
674void scriptDebugHook(ScriptExecutor *exec, int linenum)
675{
676 if (!exec || !exec->GetRunningScript())
677 {
678 return; // not inside script
679 }
680
681 if (pluginsWantingDebugHooks > 0)
682 {
683 // a plugin is handling the debugging
684 String scname = exec->GetRunningScript()->GetScriptName();
685 pl_run_plugin_debug_hooks(scname.GetCStr(), linenum);
686 return;
687 }
688
689 // no plugin, use built-in debugger
690 if (break_on_next_script_step)
691 {
692 break_on_next_script_step = 0;
693 break_into_debugger();
694 return;
695 }
696
697 String scriptName = exec->GetRunningScript()->GetSectionName(exec->GetPC());
698 for (const auto & breakpoint : breakpoints)
699 {
700 if ((breakpoint.lineNumber == linenum) &&
701 (scriptName.Compare(breakpoint.scriptName) == 0))
702 {
703 break_into_debugger();
704 break;
705 }
706 }
707}
708
709int scrlockWasDown = 0;
710

Callers

nothing calls this directly

Calls 6

break_into_debuggerFunction · 0.85
GetRunningScriptMethod · 0.80
GetCStrMethod · 0.80
GetPCMethod · 0.80
CompareMethod · 0.45

Tested by

no test coverage detected