void HandleAction(VSCodeDebug.Event obj) { switch (obj.eventType) { case "initialized": //OnStarted(); break; case "stopped": TargetEventArgs args; switch ((string)obj.body.reason) { case "breakpoint": args = new TargetEventArgs(TargetEventType.TargetHitBreakpoint); var bp = breakpoints.Select(b => b.Key).OfType <Breakpoint>().FirstOrDefault(b => b.FileName == (string)obj.body.source.path && b.Line == (int)obj.body.line); if (bp == null) { OnContinue(); return; } args.BreakEvent = bp; break; case "step": case "pause": args = new TargetEventArgs(TargetEventType.TargetStopped); break; case "exception": args = new TargetEventArgs(TargetEventType.ExceptionThrown); break; default: throw new NotImplementedException((string)obj.body.reason); } currentThreadId = (long)obj.body.threadId; args.Process = OnGetProcesses()[0]; args.Thread = GetThread(args.Process, (long)obj.body.threadId); args.Backtrace = GetThreadBacktrace((long)obj.body.threadId); OnTargetEvent(args); break; case "terminated": OnTargetEvent(new TargetEventArgs(TargetEventType.TargetExited)); break; case "exited": OnTargetEvent(new TargetEventArgs(TargetEventType.TargetExited) { ExitCode = (int)obj.body.exitCode }); break; } }
public void SendEvent(Event e) { SendMessage(e); }