コード例 #1
0
 public PyCFunctionObject(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
     CheckPyType <PyCFunctionObject>();
 }
コード例 #2
0
 public PyIntObject(DkmProcess process, ulong address)
     : this(process, address, true)
 {
 }
コード例 #3
0
 public PyDictKeysObject36(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #4
0
 DkmCustomMessage IMessage.Handle(DkmProcess process)
 {
     Handle(process);
     return(null);
 }
コード例 #5
0
        public unsafe TraceManagerLocalHelper(DkmProcess process, Kind kind)
        {
            _process  = process;
            _pyrtInfo = process.GetPythonRuntimeInfo();

            _traceFunc            = _pyrtInfo.DLLs.DebuggerHelper.GetExportedFunctionAddress("TraceFunc");
            _evalFrameFunc        = _pyrtInfo.DLLs.DebuggerHelper.GetExportedFunctionAddress("EvalFrameFunc");
            _defaultEvalFrameFunc = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable <PointerProxy>("DefaultEvalFrameFunc");
            _isTracing            = _pyrtInfo.DLLs.DebuggerHelper.GetExportedStaticVariable <ByteProxy>("isTracing");
            _pyTracingPossible    = _pyrtInfo.GetRuntimeState()?.ceval.tracing_possible
                                    ?? _pyrtInfo.DLLs.Python.GetStaticVariable <Int32Proxy>("_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))
                {
                    if (_pyrtInfo.LanguageVersion >= PythonLanguageVersion.V36)
                    {
                        RegisterJITTracing(interp);
                    }
                    foreach (var tstate in interp.GetThreadStates())
                    {
                        RegisterTracing(tstate);
                    }
                }

                _handlers = new PythonDllBreakpointHandlers(this);
                LocalComponent.CreateRuntimeDllFunctionExitBreakpoints(_pyrtInfo.DLLs.Python, "new_threadstate", _handlers.new_threadstate, enable: true);
                LocalComponent.CreateRuntimeDllFunctionExitBreakpoints(_pyrtInfo.DLLs.Python, "PyInterpreterState_New", _handlers.PyInterpreterState_New, 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);
                }
            }
        }
コード例 #6
0
ファイル: DkmExtensions.cs プロジェクト: JoshVarty/PTVS
        public static DkmRuntimeInstructionBreakpoint CreateBreakpoint(this DkmProcess process, Guid sourceId, ulong address)
        {
            var iaddr = process.CreateNativeInstructionAddress(address);

            return(DkmRuntimeInstructionBreakpoint.Create(sourceId, null, iaddr, false, null));
        }
コード例 #7
0
 public DebuggerOptionsPropagator(DkmProcess process)
 {
     _process = process;
     DebuggerOptions.PropertyChanged += DebuggerOptions_PropertyChanged;
     DebuggerOptions_PropertyChanged(null, null);
 }
コード例 #8
0
ファイル: PyComplexObject.cs プロジェクト: yepeiwen/PTVS
 public Py_complex(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #9
0
ファイル: DataProxy.cs プロジェクト: yepeiwen/PTVS
 /// <summary>
 /// Create a new proxy of a given type. This method exists to facilitate generic programming, as a workaround for the lack
 /// of parametrized constructor constraint in CLR generics.
 /// </summary>
 public static TProxy Create <TProxy>(DkmProcess process, ulong address, bool polymorphic = true)
     where TProxy : IDataProxy
 {
     return(FactoryBuilder <TProxy> .Factory(process, address, polymorphic));
 }
コード例 #10
0
 public DummyHolder(DkmProcess process)
 {
     Dummy = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariable <PointerProxy <PyObject> >("dummy", "dictobject.obj");
 }
コード例 #11
0
 public DkmRuntimeInstance(bool enableNativeDebugging)
 {
     Process = new DkmProcess(enableNativeDebugging);
 }
コード例 #12
0
 public static long SizeOf <TStruct>(DkmProcess process)
     where TStruct : StructProxy
 {
     return(GetStructMetadata <TStruct>(process).Size);
 }
コード例 #13
0
 protected StructProxy(DkmProcess process, ulong address)
 {
     Debug.Assert(process != null && address != 0);
     _process = process;
     _address = address;
 }
コード例 #14
0
 protected PyDictObject(DkmProcess process, ulong address)
     : base(process, address)
 {
 }
コード例 #15
0
 public setentry(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #16
0
 public PyMemberDef(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #17
0
ファイル: DkmExtensions.cs プロジェクト: JoshVarty/PTVS
 public static byte GetPointerSize(this DkmProcess process)
 {
     return(process.Is64Bit() ? (byte)8 : (byte)4);
 }
コード例 #18
0
 public ReprOptions(DkmProcess process)
 {
     Is64Bit         = process.Is64Bit();
     LanguageVersion = process.GetPythonRuntimeInfo().LanguageVersion;
 }
コード例 #19
0
ファイル: DkmExtensions.cs プロジェクト: JoshVarty/PTVS
 public static DkmCustomRuntimeInstance GetPythonRuntimeInstance(this DkmProcess process)
 {
     return((DkmCustomRuntimeInstance)process.GetRuntimeInstances().FirstOrDefault(rti => rti.Id.RuntimeType == Guids.PythonRuntimeTypeGuid));
 }
コード例 #20
0
ファイル: ExceptionManager.cs プロジェクト: jonmwillis/PTVS
 public ExceptionManager(DkmProcess process)
 {
     _process = process;
 }
コード例 #21
0
 public abstract void Handle(DkmProcess process);
コード例 #22
0
ファイル: PyTypeObject.cs プロジェクト: PeezoSlug/PTVS
 public PyHeapTypeObject(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #23
0
            public PyBytesObject_FieldOffsets(DkmProcess process)
            {
                var fields = StructProxy.GetStructFields <PyBytesObject, PyBytesObject.Fields>(process);

                ob_sval = fields.ob_sval.Offset;
            }
コード例 #24
0
ファイル: PyTypeObject.cs プロジェクト: PeezoSlug/PTVS
 private PyTypeObject(DkmProcess process, ulong addr, bool checkType)
     : base(process, addr)
 {
     InitializeStruct(this, out _fields);
 }
コード例 #25
0
            public PyVarObject_FieldOffsets(DkmProcess process)
            {
                var fields = StructProxy.GetStructFields <PyVarObject, PyVarObject.PyVarObject_Fields>(process);

                ob_size = fields.ob_size.Offset;
            }
コード例 #26
0
ファイル: PyTypeObject.cs プロジェクト: PeezoSlug/PTVS
 public PyTypeObject(DkmProcess process, ulong addr)
     : this(process, addr, true)
 {
 }
コード例 #27
0
 public static PythonRuntimeInfo GetPythonRuntimeInfo(this DkmProcess process)
 {
     return(process.GetOrCreateDataItem(() => new PythonRuntimeInfo()));
 }
コード例 #28
0
ファイル: PyTypeObject.cs プロジェクト: PeezoSlug/PTVS
        public static unsafe PyTypeObject FromNativeGlobalVariable(DkmProcess process, string name)
        {
            var addr = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariableAddress(name);

            return(new PyTypeObject(process, addr));
        }
コード例 #29
0
 public PyDictObject36(DkmProcess process, ulong address)
     : base(process, address)
 {
     InitializeStruct(this, out _fields);
     CheckPyType <PyDictObject36>();
 }
コード例 #30
0
ファイル: DkmExtensions.cs プロジェクト: JoshVarty/PTVS
 public static bool Is64Bit(this DkmProcess process)
 {
     return((process.SystemInformation.Flags & DkmSystemInformationFlags.Is64Bit) != 0);
 }
コード例 #31
0
ファイル: DkmRuntimeInstance.cs プロジェクト: CAPCHIK/roslyn
 public DkmRuntimeInstance(bool enableNativeDebugging)
 {
     Process = enableNativeDebugging ?
         ProcessWithNativeDebugging :
         DefaultProcess;
 }
コード例 #32
0
 public DkmRuntimeInstance(bool enableNativeDebugging)
 {
     Process = new DkmProcess(enableNativeDebugging);
 }