internal DebugFrame( DebugThread thread, FunctionInfo funcInfo) { _thread = thread; _funcInfo = funcInfo; _variables = new Dictionary<IList<VariableInfo>, ScopeData>(); }
public static int GetCurrentSequencePointForLeafGeneratorFrame(DebugThread thread) { DebugFrame frame = thread.GetLeafFrame(); Debug.Assert(frame.Generator != null); return(frame.CurrentLocationCookie); }
internal DebugFrame( DebugThread thread, FunctionInfo funcInfo) { Thread = thread; _funcInfo = funcInfo; _variables = new Dictionary <IList <VariableInfo>, ScopeData>(); }
internal DebugFrame( DebugThread thread, FunctionInfo funcInfo, IRuntimeVariables liftedLocals, int frameOrder) : this(thread, funcInfo) { _liftedLocals = liftedLocals; _stackDepth = frameOrder; }
internal DebugFrame( DebugThread thread, FunctionInfo funcInfo, IRuntimeVariables liftedLocals, int frameOrder) : this(thread, funcInfo) { _liftedLocals = liftedLocals; StackDepth = frameOrder; }
public static bool IsCurrentLeafFrameRemappingToGenerator(DebugThread thread) { DebugFrame frame = null; if (thread.TryGetLeafFrame(ref frame)) { return(frame.ForceSwitchToGeneratorLoop); } return(false); }
void IDebugCallback.OnDebugEvent(TraceEventKind kind, DebugThread thread, FunctionInfo functionInfo, int sequencePointIndex, int stackDepth, object payload) { ITraceCallback traceCallback = _traceCallback; if (traceCallback != null) { // $TODO: what if the callback throws an exception? should we swallow it? var curThread = _traceFrame.Value; try { if (kind == TraceEventKind.FrameExit || kind == TraceEventKind.ThreadExit) { traceCallback.OnTraceEvent( kind, kind == TraceEventKind.FrameExit ? functionInfo.Name : null, null, SourceSpan.None, null, payload, functionInfo != null ? functionInfo.CustomPayload : null ); } else { DebugFrame leafFrame = thread.GetLeafFrame(); _traceFrame.Value = leafFrame; Debug.Assert(sequencePointIndex >= 0 && sequencePointIndex < functionInfo.SequencePoints.Length); DebugSourceSpan sourceSpan = functionInfo.SequencePoints[sequencePointIndex]; traceCallback.OnTraceEvent( kind, functionInfo.Name, sourceSpan.SourceFile.Name, sourceSpan.ToDlrSpan(), () => { return(leafFrame.GetLocalsScope()); }, payload, functionInfo.CustomPayload ); } } finally { _traceFrame.Value = curThread; } } }
void IDebugCallback.OnDebugEvent(TraceEventKind kind, DebugThread thread, FunctionInfo functionInfo, int sequencePointIndex, int stackDepth, object payload) { ITraceCallback traceCallback = _traceCallback; if (traceCallback != null) { // $TODO: what if the callback throws an exception? should we swallow it? var curThread = _traceFrame.Value; try { if (kind == TraceEventKind.FrameExit || kind == TraceEventKind.ThreadExit) { traceCallback.OnTraceEvent( kind, kind == TraceEventKind.FrameExit ? functionInfo.Name : null, null, SourceSpan.None, null, payload, functionInfo != null ? functionInfo.CustomPayload : null ); } else { DebugFrame leafFrame = thread.GetLeafFrame(); _traceFrame.Value = leafFrame; Debug.Assert(sequencePointIndex >= 0 && sequencePointIndex < functionInfo.SequencePoints.Length); DebugSourceSpan sourceSpan = functionInfo.SequencePoints[sequencePointIndex]; traceCallback.OnTraceEvent( kind, functionInfo.Name, sourceSpan.SourceFile.Name, sourceSpan.ToDlrSpan(), () => { return leafFrame.GetLocalsScope(); }, payload, functionInfo.CustomPayload ); } } finally { _traceFrame.Value = curThread; } } }
public static object GeneratorLoopProc(DebugThread thread) { return(thread.DebugContext.GeneratorLoopProc(thread.GetLeafFrame(), out bool _)); }
public static void OnThreadExitEvent(DebugThread thread) { thread.DebugContext.DispatchDebugEvent(thread, Int32.MaxValue, TraceEventKind.ThreadExit, null); }
public static void OnFrameExitTraceEvent(DebugThread thread, int debugMarker, object retVal) { thread.DebugContext.DispatchDebugEvent(thread, debugMarker, TraceEventKind.FrameExit, retVal); }
public static void OnFrameEnterTraceEvent(DebugThread thread) { thread.DebugContext.DispatchDebugEvent(thread, 0, TraceEventKind.FrameEnter, null); }
public static void OnTraceEventUnwind(DebugThread thread, int debugMarker, Exception exception) { thread.DebugContext.DispatchDebugEvent(thread, debugMarker, TraceEventKind.ExceptionUnwind, exception); }
public static void OnTraceEvent(DebugThread thread, int debugMarker, Exception exception) { thread.DebugContext.DispatchDebugEvent(thread, debugMarker, exception != null ? TraceEventKind.Exception : TraceEventKind.TracePoint, exception); }
public static bool PopFrame(DebugThread thread) { return(thread.PopFrame()); }
public static void LiftVariables(DebugThread thread, IRuntimeVariables runtimeVariables) { ((DefaultDebugThread)thread).LiftVariables(runtimeVariables); }