コード例 #1
0
ファイル: sys.cs プロジェクト: Siyy/DynamicLanguageRuntime
        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)));
                }
            }
        }
コード例 #2
0
ファイル: TraceBack.cs プロジェクト: zzkongfu/ironpython3
 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;
 }
コード例 #3
0
ファイル: sys.cs プロジェクト: Siyy/DynamicLanguageRuntime
 public static object gettrace(CodeContext /*!*/ context)
 {
     return(PythonTracebackListener.GetTraceObject());
 }
コード例 #4
0
ファイル: TraceBack.cs プロジェクト: TerabyteX/main
 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;
 }