多亏了TdwsDebugger,我可以调试一个完整的脚本:
Debugger := TdwsDebugger.Create(nil);
Debugger.BeginDebug(Execution);
在我的用例中,我不运行整个脚本,而只运行其中的一个函数:
var Func: IInfo;
begin
[...]
Func := Execution.Info.Func['MyFunction'];
Result := Func.Call.Value;
end;
我现在如何调用TdwsDebugger ?
你必须手动设置调试器在你的执行(通过BeginDebug/EndDebug)。你可以在UDebuggerTests中看到一些示例代码。
你可以在EndDebug之前调用。