allow LShift to single-step, RShift to pause flow
| 672 | |
| 673 | // allow LShift to single-step, RShift to pause flow |
| 674 | void 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 | |
| 709 | int scrlockWasDown = 0; |
| 710 |
nothing calls this directly
no test coverage detected