本文整理汇总了C#中Microsoft.VisualStudio.Debugger.DkmProcess类的典型用法代码示例。如果您正苦于以下问题:C# DkmProcess类的具体用法?C# DkmProcess怎么用?C# DkmProcess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DkmProcess类属于Microsoft.VisualStudio.Debugger命名空间,在下文中一共展示了DkmProcess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例2: PySetObject
public PySetObject(DkmProcess process, ulong address)
: base(process, address) {
InitializeStruct(this, out _fields);
CheckPyType<PySetObject>();
_dummy = Process.GetOrCreateDataItem(() => new DummyHolder(Process)).Dummy.TryRead();
}
示例3: PyIntObject
protected PyIntObject(DkmProcess process, ulong address, bool checkType)
: base(process, address) {
InitializeStruct(this, out _fields);
if (checkType) {
CheckPyType<PyIntObject>();
}
}
示例4: PyFrameObject_FieldOffsets
public PyFrameObject_FieldOffsets(DkmProcess process) {
var fields = StructProxy.GetStructFields<PyFrameObject, PyFrameObject.Fields>(process);
f_code = fields.f_code.Offset;
f_globals = fields.f_globals.Offset;
f_locals = fields.f_locals.Offset;
f_lineno = fields.f_lineno.Offset;
}
示例5: TryCreate
public static PyInterpreterState TryCreate(DkmProcess process, ulong address) {
if (address == 0) {
return null;
}
return new PyInterpreterState(process, address);
}
示例6: 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);
}
示例7: ClearExceptionTriggers
public void ClearExceptionTriggers(DkmProcess process, Guid sourceId) {
if (_monitoredExceptions.Count != 0) {
_monitoredExceptions.Clear();
new LocalComponent.MonitorExceptionsRequest { MonitorExceptions = false }.SendHigher(process);
}
process.ClearExceptionTriggers(sourceId);
}
示例8: Create
public static PyIntObject Create(DkmProcess process, int value) {
var allocator = process.GetDataItem<PyObjectAllocator>();
Debug.Assert(allocator != null);
var result = allocator.Allocate<PyIntObject>();
result.ob_ival.Write(value);
return result;
}
示例9: Create
public static PyComplexObject Create(DkmProcess process, Complex value) {
var allocator = process.GetDataItem<PyObjectAllocator>();
Debug.Assert(allocator != null);
var result = allocator.Allocate<PyComplexObject>();
result.cval.real.Write(value.Real);
result.cval.imag.Write(value.Imaginary);
return result;
}
示例10: Create
public static PyBytesObject Create(DkmProcess process, AsciiString value) {
var allocator = process.GetDataItem<PyObjectAllocator>();
Debug.Assert(allocator != null);
var result = allocator.Allocate<PyBytesObject>(value.Bytes.Length);
result.ob_size.Write(value.Bytes.Length);
process.WriteMemory(result.ob_sval.Address, value.Bytes);
return result;
}
示例11: 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>();
}
示例12: 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);
}
示例13: Create
public static PyUnicodeObject27 Create(DkmProcess process, string value) {
// Allocate string buffer together with the object itself in a single block.
var allocator = process.GetDataItem<PyObjectAllocator>();
Debug.Assert(allocator != null);
var result = allocator.Allocate<PyUnicodeObject27>(value.Length * 2);
result.length.Write(value.Length);
var str = result.Address.OffsetBy(StructProxy.SizeOf<PyUnicodeObject27>(process));
result.str.Raw.Write(str);
var buf = Encoding.Unicode.GetBytes(value);
process.WriteMemory(str, buf);
return result;
}
示例14: 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;
}
}
示例15: ShouldEnableChildDebugging
private static bool ShouldEnableChildDebugging(DkmProcess process, DebugProcessOptions options) {
if (options.ChildDebuggingMode == ChildDebuggingMode.AlwaysAttach)
return true;
if (options.ChildDebuggingMode == ChildDebuggingMode.UseDefault) {
Logger.LogInfo(
"Requesting default child process debugging mode for process {0}.",
process.UniqueId);
DkmCustomMessage attachRequest = DkmCustomMessage.Create(
process.Connection,
process,
PackageServices.VsPackageMessageGuid,
(int)VsPackageMessage.IsChildDebuggingEnabled,
process.UniqueId,
process.Connection.UniqueId);
// This needs to happen synchronously in order to guarantee that child debugging is enabled
// before the process finishes initializing.
attachRequest.SendToVsService(PackageServices.DkmComponentEventHandler, true);
}
return false;
}