当前位置: 首页>>代码示例>>C#>>正文


C# DkmProcess.GetPythonRuntimeInfo方法代码示例

本文整理汇总了C#中Microsoft.VisualStudio.Debugger.DkmProcess.GetPythonRuntimeInfo方法的典型用法代码示例。如果您正苦于以下问题:C# DkmProcess.GetPythonRuntimeInfo方法的具体用法?C# DkmProcess.GetPythonRuntimeInfo怎么用?C# DkmProcess.GetPythonRuntimeInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.VisualStudio.Debugger.DkmProcess的用法示例。


在下文中一共展示了DkmProcess.GetPythonRuntimeInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DummyHolder

 public DummyHolder(DkmProcess process) {
     var pyrtInfo = process.GetPythonRuntimeInfo();
     Dummy = 
         pyrtInfo.LanguageVersion >= PythonLanguageVersion.V34 ? 
         pyrtInfo.DLLs.Python.GetStaticVariable<PointerProxy<PyObject>>("_PySet_Dummy") :
         pyrtInfo.DLLs.Python.GetStaticVariable<PointerProxy<PyObject>>("dummy", "setobject.obj");
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:7,代码来源:PySetObject.cs

示例2: ModuleManager

        public ModuleManager(DkmProcess process) {
            _process = process;
            _pyrtInfo = process.GetPythonRuntimeInfo();

            LoadInitialPythonModules();
            LocalComponent.CreateRuntimeDllFunctionBreakpoint(_pyrtInfo.DLLs.Python, "PyCode_New", PythonDllBreakpointHandlers.PyCode_New, enable: true, debugStart: true);
            LocalComponent.CreateRuntimeDllFunctionBreakpoint(_pyrtInfo.DLLs.Python, "PyCode_NewEmpty", PythonDllBreakpointHandlers.PyCode_NewEmpty, enable: true, debugStart: true);
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:8,代码来源:ModuleManager.cs

示例3: PyFrameObject

 public PyFrameObject(DkmProcess process, ulong address)
     : base(process, address) {
     var pythonInfo = process.GetPythonRuntimeInfo();
     if (pythonInfo.LanguageVersion <= PythonLanguageVersion.V35) {
         Fields_27_35 fields;
         InitializeStruct(this, out fields);
         _fields = fields;
     } else {
         Fields_36 fields;
         InitializeStruct(this, out fields);
         _fields = fields;
     }
     CheckPyType<PyFrameObject>();
 }
开发者ID:zooba,项目名称:PTVS,代码行数:14,代码来源:PyFrameObject.cs

示例4: ExpressionEvaluator

        public ExpressionEvaluator(DkmProcess process) {
            _process = process;
            var pyrtInfo = process.GetPythonRuntimeInfo();

            _evalLoopThreadId = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopThreadId");
            _evalLoopFrame = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopFrame");
            _evalLoopResult = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopResult");
            _evalLoopExcType = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopExcType");
            _evalLoopExcValue = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopExcValue");
            _evalLoopExcStr = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt64Proxy>("evalLoopExcStr");
            _evalLoopSEHCode = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<UInt32Proxy>("evalLoopSEHCode");
            _evalLoopInput = pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<CStringProxy>("evalLoopInput");

            LocalComponent.CreateRuntimeDllExportedFunctionBreakpoint(pyrtInfo.DLLs.DebuggerHelper, "OnEvalComplete", OnEvalComplete, enable: true);
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:15,代码来源:ExpressionEvaluator.cs

示例5: PyFrameObject_FieldOffsets

 public PyFrameObject_FieldOffsets(DkmProcess process) {
     if (process.GetPythonRuntimeInfo().LanguageVersion <= PythonLanguageVersion.V35) {
         var fields = StructProxy.GetStructFields<PyFrameObject, PyFrameObject.Fields_27_35>(process);
         f_back = -1;
         f_code = fields.f_code.Offset;
         f_globals = fields.f_globals.Offset;
         f_locals = fields.f_locals.Offset;
         f_lineno = fields.f_lineno.Offset;
     } else {
         var fields = StructProxy.GetStructFields<PyFrameObject, PyFrameObject.Fields_36>(process);
         f_back = fields.f_back.Offset;
         f_code = fields.f_code.Offset;
         f_globals = fields.f_globals.Offset;
         f_locals = fields.f_locals.Offset;
         f_lineno = fields.f_lineno.Offset;
     }
 }
开发者ID:zooba,项目名称:PTVS,代码行数:17,代码来源:TraceManagerLocalHelper.cs

示例6: InterpHeadHolder

 public InterpHeadHolder(DkmProcess process) {
     Proxy = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariable<PointerProxy<PyInterpreterState>>("interp_head");
 }
开发者ID:zooba,项目名称:PTVS,代码行数:3,代码来源:PyInterpreterState.cs

示例7: TraceManagerLocalHelper

        public unsafe TraceManagerLocalHelper(DkmProcess process, Kind kind) {
            _process = process;
            _pyrtInfo = process.GetPythonRuntimeInfo();

            _traceFunc = _pyrtInfo.DLLs.DebuggerHelper.GetExportedFunctionAddress("TraceFunc");
            _isTracing = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<ByteProxy>("isTracing");
            _pyTracingPossible = _pyrtInfo.DLLs.Python.GetStaticVariable<UInt32Proxy>("_Py_TracingPossible");

            if (kind == Kind.StepIn) {
                var fieldOffsets = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<CliStructProxy<FieldOffsets>>("fieldOffsets");
                fieldOffsets.Write(new FieldOffsets(process, _pyrtInfo));

                var types = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<CliStructProxy<Types>>("types");
                types.Write(new Types(process, _pyrtInfo));

                var functionPointers = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<CliStructProxy<FunctionPointers>>("functionPointers");
                functionPointers.Write(new FunctionPointers(process, _pyrtInfo));

                var stringEquals = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable<PointerProxy>("stringEquals");
                if (_pyrtInfo.LanguageVersion <= PythonLanguageVersion.V27) {
                    stringEquals.Write(_pyrtInfo.DLLs.DebuggerHelper.GetExportedFunctionAddress("StringEquals27").GetPointer());
                } else {
                    stringEquals.Write(_pyrtInfo.DLLs.DebuggerHelper.GetExportedFunctionAddress("StringEquals33").GetPointer());
                }

                foreach (var interp in PyInterpreterState.GetInterpreterStates(process)) {
                    foreach (var tstate in interp.GetThreadStates()) {
                        RegisterTracing(tstate);
                    }
                }

                _handlers = new PythonDllBreakpointHandlers(this);
                LocalComponent.CreateRuntimeDllFunctionExitBreakpoints(_pyrtInfo.DLLs.Python, "new_threadstate", _handlers.new_threadstate, enable: true);

                foreach (var methodInfo in _handlers.GetType().GetMethods()) {
                    var stepInAttr = (StepInGateAttribute)Attribute.GetCustomAttribute(methodInfo, typeof(StepInGateAttribute));
                    if (stepInAttr != null &&
                        (stepInAttr.MinVersion == PythonLanguageVersion.None || _pyrtInfo.LanguageVersion >= stepInAttr.MinVersion) &&
                        (stepInAttr.MaxVersion == PythonLanguageVersion.None || _pyrtInfo.LanguageVersion <= stepInAttr.MaxVersion)) {

                        var handler = (StepInGateHandler)Delegate.CreateDelegate(typeof(StepInGateHandler), _handlers, methodInfo);
                        AddStepInGate(handler, _pyrtInfo.DLLs.Python, methodInfo.Name, stepInAttr.HasMultipleExitPoints);
                    }
                }

                if (_pyrtInfo.DLLs.CTypes != null) {
                    OnCTypesLoaded(_pyrtInfo.DLLs.CTypes);
                }
            }
        }
开发者ID:sadapple,项目名称:PTVS,代码行数:50,代码来源:TraceManagerLocalHelper.cs

示例8: DummyHolder

 public DummyHolder(DkmProcess process) {
     Dummy = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariable<PointerProxy<PyObject>>("dummy", "dictobject.obj");
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:3,代码来源:PyDictObject.cs

示例9: FromNativeGlobalVariable

 public unsafe static PyTypeObject FromNativeGlobalVariable(DkmProcess process, string name) {
     var addr = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariableAddress(name);
     return new PyTypeObject(process, addr);
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:4,代码来源:PyTypeObject.cs

示例10: CallStackFilter

 public CallStackFilter(DkmProcess process) {
     _process = process;
     _pyrtInfo = process.GetPythonRuntimeInfo();
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:4,代码来源:CallStackFilter.cs

示例11: ValuesHolder

            public ValuesHolder(DkmProcess process) {
                var pythonDll = process.GetPythonRuntimeInfo().DLLs.Python;

                False = pythonDll.GetStaticVariable<PyBoolObject33>("_Py_FalseStruct");
                True = pythonDll.GetStaticVariable<PyBoolObject33>("_Py_TrueStruct");
            }
开发者ID:wenh123,项目名称:PTVS,代码行数:6,代码来源:PyBoolObject.cs


注:本文中的Microsoft.VisualStudio.Debugger.DkmProcess.GetPythonRuntimeInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。