public DkmILEvaluationResult[] Execute(DkmILExecuteIntrinsic executeIntrinsic, DkmILContext iLContext, DkmCompiledILInspectionQuery inspectionQuery, DkmILEvaluationResult[] arguments, ReadOnlyCollection<DkmCompiledInspectionQuery> subroutines, out DkmILFailureReason failureReason) {
            var pythonRuntime = iLContext.StackFrame.Process.GetPythonRuntimeInstance();

            // The mapping between functions and IDs is defined in PythonDkm.natvis.
            switch (executeIntrinsic.Id) {
                case 1: // PTVS_ShowPythonViewNodes
                    failureReason = DkmILFailureReason.None;
                    return new[] { DkmILEvaluationResult.Create(executeIntrinsic.SourceId, new ReadOnlyCollection<byte>(new byte[] {
                        pythonRuntime != null && DebuggerOptions.ShowPythonViewNodes ? (byte)1 : (byte)0
                    }))};

                default:
                    throw new NotSupportedException();
            }
        }
        public DkmILEvaluationResult[] Execute(DkmILExecuteIntrinsic executeIntrinsic, DkmILContext iLContext, DkmCompiledILInspectionQuery inspectionQuery, DkmILEvaluationResult[] arguments, ReadOnlyCollection <DkmCompiledInspectionQuery> subroutines, out DkmILFailureReason failureReason)
        {
            var pythonRuntime = iLContext.StackFrame.Process.GetPythonRuntimeInstance();

            // The mapping between functions and IDs is defined in PythonDkm.natvis.
            switch (executeIntrinsic.Id)
            {
            case 1:     // PTVS_ShowPythonViewNodes
                failureReason = DkmILFailureReason.None;
                return(new[] { DkmILEvaluationResult.Create(executeIntrinsic.SourceId, new ReadOnlyCollection <byte>(new byte[] {
                        pythonRuntime != null && DebuggerOptions.ShowPythonViewNodes ? (byte)1 : (byte)0
                    })) });

            default:
                throw new NotSupportedException();
            }
        }
Beispiel #3
0
        DkmILEvaluationResult[] IDkmIntrinsicFunctionEvaluator140.Execute(DkmILExecuteIntrinsic executeIntrinsic, DkmILContext iLContext, DkmCompiledILInspectionQuery inspectionQuery, DkmILEvaluationResult[] arguments, ReadOnlyCollection <DkmCompiledInspectionQuery> subroutines, out DkmILFailureReason failureReason)
        {
            var natVis = iLContext.StackFrame.Process.GetOrCreateDataItem(() => new PyObjectNativeVisualizer());

            return(natVis.Execute(executeIntrinsic, iLContext, inspectionQuery, arguments, subroutines, out failureReason));
        }