private void InitDebugger() { var debugPayload = File.ReadAllBytes(DebugInfoPath); var loader = new DebugInfoLoader(); DebugInfo = loader.Load(debugPayload); if (DebugInfo.Version != StoryDebugInfo.CurrentVersion) { throw new InvalidDataException($"Story debug info too old (found version {DebugInfo.Version}, we only support {StoryDebugInfo.CurrentVersion}). Please recompile the story."); } Formatter = new ValueFormatter(DebugInfo); TracePrinter = new StackTracePrinter(DebugInfo, Formatter); TracePrinter.ModUuid = ModUuid; if (Config != null) { TracePrinter.MergeFrames = !Config.rawFrames; } EvalResults = new EvaluationResultManager(Formatter); Evaluator = new ExpressionEvaluator(DebugInfo, Stream, DbgCli, Formatter, EvalResults); Stack = null; Stopped = false; // We're not in debug mode yet. We'll enable debugging when the story is fully synced DebuggingStory = false; }
private void OnDebugSessionEnded() { if (DebuggingStory) { SendOutput("console", "Story unloaded - debug session terminated\r\n"); } DebuggingStory = false; Stopped = false; DebugInfo = null; Evaluator = null; EvalResults = null; TracePrinter = null; Formatter = null; var changedBps = Breakpoints.DebugInfoUnloaded(); // Notify the debugger that the status of breakpoints changed changedBps.ForEach(bp => SendBreakpoint("changed", bp)); }