public VSCodeDebuggerBacktrace(VSCodeDebuggerSession vsCodeDebuggerSession, int threadId) { this.threadId = threadId; this.vsCodeDebuggerSession = vsCodeDebuggerSession; frame0Format = VsCodeStackFrame.GetStackFrameFormat(vsCodeDebuggerSession.EvaluationOptions); var body = vsCodeDebuggerSession.protocolClient.SendRequestSync(new StackTraceRequest(threadId, 0, 1, frame0Format)); totalFramesCount = body.TotalFrames ?? 0; frames = new Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Messages.StackFrame [totalFramesCount]; if (totalFramesCount > 0 && body.StackFrames.Count > 0) { frames [0] = body.StackFrames [0]; } }
public Mono.Debugging.Client.StackFrame [] GetStackFrames(int firstIndex, int lastIndex) { //Optimisation for getting 1st frame of thread(used for ThreadPad) if (firstIndex == 0 && lastIndex == 1 && totalFramesCount > 0) { return(new Mono.Debugging.Client.StackFrame [] { new VsCodeStackFrame(frame0Format, threadId, 0, frames [0]) }); } var stackFrames = new Mono.Debugging.Client.StackFrame [Math.Min(lastIndex - firstIndex, totalFramesCount - firstIndex)]; var format = VsCodeStackFrame.GetStackFrameFormat(vsCodeDebuggerSession.EvaluationOptions); var body = vsCodeDebuggerSession.protocolClient.SendRequestSync(new StackTraceRequest(threadId, firstIndex, stackFrames.Length, format)); for (int i = 0; i < stackFrames.Length; i++) { frames [i + firstIndex] = body.StackFrames [i]; stackFrames [i] = new VsCodeStackFrame(format, threadId, i, body.StackFrames [i]); } return(stackFrames); }
public VSCodeDebuggerBacktrace(VSCodeDebuggerSession session, int threadId) { this.session = session; this.threadId = threadId; format = VsCodeStackFrame.GetStackFrameFormat(session.EvaluationOptions); var response = session.protocolClient.SendRequestSync(new StackTraceRequest(threadId) { StartFrame = 0, Levels = 1, Format = format }); FrameCount = response.TotalFrames ?? 0; frames = new VsStackFrame[FrameCount]; scopes = new List <Scope> [FrameCount]; if (FrameCount > 0 && response.StackFrames.Count > 0) { frames[0] = response.StackFrames[0]; } }
public StackFrame [] GetStackFrames(int firstIndex, int lastIndex) { //Optimisation for getting 1st frame of thread(used for ThreadPad) if (firstIndex == 0 && lastIndex == 1 && FrameCount > 0) { return new StackFrame[] { new VsCodeStackFrame(this.format, threadId, 0, frames[0]) } } ; var stackFrames = new StackFrame [Math.Min(lastIndex - firstIndex, FrameCount - firstIndex)]; var format = VsCodeStackFrame.GetStackFrameFormat(session.EvaluationOptions); var body = session.protocolClient.SendRequestSync(new StackTraceRequest(threadId) { StartFrame = firstIndex, Levels = stackFrames.Length, Format = format }); for (int i = 0; i < stackFrames.Length; i++) { frames[i + firstIndex] = body.StackFrames [i]; stackFrames[i] = new VsCodeStackFrame(format, threadId, i, body.StackFrames [i]); } return(stackFrames); }