public PyCFunctionObject(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); CheckPyType <PyCFunctionObject>(); }
public PyIntObject(DkmProcess process, ulong address) : this(process, address, true) { }
public PyDictKeysObject36(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); }
DkmCustomMessage IMessage.Handle(DkmProcess process) { Handle(process); return(null); }
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); } } }
public static DkmRuntimeInstructionBreakpoint CreateBreakpoint(this DkmProcess process, Guid sourceId, ulong address) { var iaddr = process.CreateNativeInstructionAddress(address); return(DkmRuntimeInstructionBreakpoint.Create(sourceId, null, iaddr, false, null)); }
public DebuggerOptionsPropagator(DkmProcess process) { _process = process; DebuggerOptions.PropertyChanged += DebuggerOptions_PropertyChanged; DebuggerOptions_PropertyChanged(null, null); }
public Py_complex(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); }
/// <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)); }
public DummyHolder(DkmProcess process) { Dummy = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariable <PointerProxy <PyObject> >("dummy", "dictobject.obj"); }
public DkmRuntimeInstance(bool enableNativeDebugging) { Process = new DkmProcess(enableNativeDebugging); }
public static long SizeOf <TStruct>(DkmProcess process) where TStruct : StructProxy { return(GetStructMetadata <TStruct>(process).Size); }
protected StructProxy(DkmProcess process, ulong address) { Debug.Assert(process != null && address != 0); _process = process; _address = address; }
protected PyDictObject(DkmProcess process, ulong address) : base(process, address) { }
public setentry(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); }
public PyMemberDef(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); }
public static byte GetPointerSize(this DkmProcess process) { return(process.Is64Bit() ? (byte)8 : (byte)4); }
public ReprOptions(DkmProcess process) { Is64Bit = process.Is64Bit(); LanguageVersion = process.GetPythonRuntimeInfo().LanguageVersion; }
public static DkmCustomRuntimeInstance GetPythonRuntimeInstance(this DkmProcess process) { return((DkmCustomRuntimeInstance)process.GetRuntimeInstances().FirstOrDefault(rti => rti.Id.RuntimeType == Guids.PythonRuntimeTypeGuid)); }
public ExceptionManager(DkmProcess process) { _process = process; }
public abstract void Handle(DkmProcess process);
public PyHeapTypeObject(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); }
public PyBytesObject_FieldOffsets(DkmProcess process) { var fields = StructProxy.GetStructFields <PyBytesObject, PyBytesObject.Fields>(process); ob_sval = fields.ob_sval.Offset; }
private PyTypeObject(DkmProcess process, ulong addr, bool checkType) : base(process, addr) { InitializeStruct(this, out _fields); }
public PyVarObject_FieldOffsets(DkmProcess process) { var fields = StructProxy.GetStructFields <PyVarObject, PyVarObject.PyVarObject_Fields>(process); ob_size = fields.ob_size.Offset; }
public PyTypeObject(DkmProcess process, ulong addr) : this(process, addr, true) { }
public static PythonRuntimeInfo GetPythonRuntimeInfo(this DkmProcess process) { return(process.GetOrCreateDataItem(() => new PythonRuntimeInfo())); }
public static unsafe PyTypeObject FromNativeGlobalVariable(DkmProcess process, string name) { var addr = process.GetPythonRuntimeInfo().DLLs.Python.GetStaticVariableAddress(name); return(new PyTypeObject(process, addr)); }
public PyDictObject36(DkmProcess process, ulong address) : base(process, address) { InitializeStruct(this, out _fields); CheckPyType <PyDictObject36>(); }
public static bool Is64Bit(this DkmProcess process) { return((process.SystemInformation.Flags & DkmSystemInformationFlags.Is64Bit) != 0); }
public DkmRuntimeInstance(bool enableNativeDebugging) { Process = enableNativeDebugging ? ProcessWithNativeDebugging : DefaultProcess; }