public static void settrace(CodeContext /*!*/ context, object o) { PythonContext pyContext = PythonContext.GetContext(context); pyContext.EnsureDebugContext(); if (o == null) { pyContext.UnregisterTracebackHandler(); PythonTracebackListener.SetTrace(null, null); } else { // We're following CPython behavior here. // If CurrentPythonFrame is not null then we're currently inside a traceback, and // enabling trace while inside a traceback is only allowed through sys.call_tracing() var pyThread = PythonOps.GetFunctionStackNoCreate(); if (pyThread == null || !PythonTracebackListener.InTraceBack) { pyContext.PushTracebackHandler(new PythonTracebackListener((PythonContext)context.LanguageContext)); pyContext.RegisterTracebackHandler(); PythonTracebackListener.SetTrace(o, (TracebackDelegate)Converter.ConvertToDelegate(o, typeof(TracebackDelegate))); } } }
internal TraceBackFrame(PythonTracebackListener traceAdapter, FunctionCode code, TraceBackFrame back, PythonDebuggingPayload debugProperties, Func <IDictionary <object, object> > scopeCallback) { _traceAdapter = traceAdapter; _code = code; _back = back; _debugProperties = debugProperties; _scopeCallback = scopeCallback; }
public static object gettrace(CodeContext /*!*/ context) { return(PythonTracebackListener.GetTraceObject()); }
internal TraceBackFrame(PythonTracebackListener traceAdapter, FunctionCode code, TraceBackFrame back, PythonDebuggingPayload debugProperties, Func<IDictionary<object, object>> scopeCallback) { _traceAdapter = traceAdapter; _code = code; _back = back; _debugProperties = debugProperties; _scopeCallback = scopeCallback; }