public void OnAsyncBreakComplete(DebuggedThread thread) { // This will get called when the engine receives the breakpoint event that is created when the user // hits the pause button in vs. //Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId); Send(new AD7AsyncBreakCompleteEvent(), thread.Client); }
public void OnBreakpoint(DebuggedThread thread, ReadOnlyCollection<object> clients, uint address) { // An engine that supports more advanced breakpoint features such as hit counts, conditions and filters // should notify each bound breakpoint that it has been hit and evaluate conditions here. // The sample engine does not support these features. var boundBreakpointsEnum = new AD7BoundBreakpointsEnum(clients.Select(c => (IDebugBoundBreakpoint2)c)); Send(new AD7BreakpointEvent(boundBreakpointsEnum), thread.Client); }
public void OnLoadComplete(DebuggedThread thread) { Send(new AD7LoadCompleteEvent(), thread.Client); }
public void OnException(DebuggedThread thread, uint code) { // Exception events are sent when an exception occurs in the debuggee that the debugger was not expecting. // The sample engine does not support these. throw new Exception("The method or operation is not implemented."); }
public void OnThreadExit(DebuggedThread debuggedThread, uint exitCode) { //Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId); var ad7Thread = debuggedThread.Client; Debug.Assert(ad7Thread != null); Send(new AD7ThreadDestroyEvent(exitCode), ad7Thread); }
public void OnThreadStart(DebuggedThread debuggedThread) { // This will get called when the entrypoint breakpoint is fired because the engine sends a thread start event // for the main thread of the application. if (m_engine.DebuggedProcess != null) { //Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId); } var ad7Thread = new AD7Thread(m_engine, debuggedThread); debuggedThread.Client = ad7Thread; Send(new AD7ThreadCreateEvent(), ad7Thread); }
private bool FetchFrames(DebuggedThread debuggedThread, int fromFrame, int count, ref int totalFrames) { // we have a problem here: http://code.google.com/p/v8/issues/detail?id=1705 // better use inlineRefs = true (https://github.com/joyent/node/pull/2379/files) var resp = dbg.RequestSync("backtrace", new { fromFrame, toFrame = fromFrame + count, inlineRefs = true }, 1000); if (resp == null) return false; totalFrames = (int)resp["body"]["totalFrames"]; var frames = (JArray)resp["body"]["frames"]; if (frames != null) debuggedThread.StackFrames.AddRange(frames.Select(x => new NodeThreadContext((JObject)x, this))); return true; }
public void OnStepComplete(DebuggedThread thread) { // Step complete is sent when a step has finished. The sample engine does not support stepping. throw new Exception("The method or operation is not implemented."); }
internal void Step(DebuggedThread debuggedThread, Microsoft.VisualStudio.Debugger.Interop.enum_STEPKIND sk) { MyLogger.Trace("DebuggedProcess.Step"); var stepaction = "next"; switch (sk) { case Microsoft.VisualStudio.Debugger.Interop.enum_STEPKIND.STEP_INTO: stepaction = "in"; break; case Microsoft.VisualStudio.Debugger.Interop.enum_STEPKIND.STEP_OUT: stepaction = "out"; break; } dbg.Request("continue", new { stepaction, stepcount = 1 }); }
internal void DoStackWalk(DebuggedThread debuggedThread) { MyLogger.Trace("< DebuggedProcess.DoStackWalk"); debuggedThread.StackFrames = new List<NodeThreadContext>(); var frameId = 0; var totalFrames = int.MaxValue; var maxTicks = DateTime.Now.AddSeconds(5).Ticks; while (frameId < totalFrames && DateTime.Now.Ticks < maxTicks) { if (!FetchFrames(debuggedThread, frameId, 5, ref totalFrames)) break; frameId += 5; } MyLogger.Trace("> DebuggedProcess.DoStackWalk"); }
public void Execute(DebuggedThread thread) { MyLogger.Trace("DebuggedProcess.Execute"); dbg.Request("continue", ""); }
public AD7Thread(AD7Engine engine, DebuggedThread debuggedThread) { m_engine = engine; m_debuggedThread = debuggedThread; }
public void Execute(DebuggedThread thread) { dbg.Request("continue", ""); }