本文整理汇总了C#中IDataReader.GetArchitecture方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetArchitecture方法的具体用法?C# IDataReader.GetArchitecture怎么用?C# IDataReader.GetArchitecture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetArchitecture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataTargetImpl
public DataTargetImpl(IDataReader dataReader, IDebugClient client)
{
if (dataReader == null)
throw new ArgumentNullException("dataReader");
_dataReader = dataReader;
_client = client;
_architecture = _dataReader.GetArchitecture();
}
示例2: DataTargetImpl
public DataTargetImpl(IDataReader dataReader, IDebugClient client)
{
if (dataReader == null)
throw new ArgumentNullException("dataReader");
m_dataReader = dataReader;
m_client = client;
m_architecture = m_dataReader.GetArchitecture();
var sympath = SymPath._NT_SYMBOL_PATH;
if (string.IsNullOrEmpty(sympath))
sympath = SymPath.MicrosoftSymbolServerPath;
m_symPath = new SymPath(sympath);
}
示例3: GetThreadContextSize
protected uint GetThreadContextSize(IDataReader dataReader)
{
uint result = 0;
var plat = dataReader.GetArchitecture();
if (plat == Architecture.Amd64)
result = CONTEXT_SIZE_AMD64;
else if (plat == Architecture.X86)
result = CONTEXT_SIZE_X86;
else if (plat == Architecture.Arm)
result = CONTEXT_SIZE_ARM;
else
throw new InvalidOperationException("Unexpected architecture.");
return result;
}
示例4: ProcessQuerierStrategy
public ProcessQuerierStrategy(IDebugClient debugClient, IDataReader dataReader, ClrRuntime runtime)
{
_isDispsed = false;
_runtime = runtime;
_dataReader = dataReader;
_debugClient = debugClient;
if (dataReader.GetArchitecture() == Architecture.Amd64)//Environment.Is64BitProcess
{
_unmanagedStackWalkerStrategy = new Unmanaged_x64_StackWalkerStrategy(_runtime);
_threadContextStrategy = new ThreadContext_x64_Strategy();
}
else
{
_unmanagedStackWalkerStrategy = new Unmanaged_x86_StackWalkerStrategy();
_threadContextStrategy = new ThreadContext_x86_Strategy();
}
_unmanagedBlockingObjectsHandler = new UnmanagedBlockingObjectsHandler(_unmanagedStackWalkerStrategy);
}
示例5: SetThreadContext
public override bool SetThreadContext(ThreadInfo threadInfo, IDebugAdvanced debugClient, IDataReader dataReader)
{
bool result = false;
var plat = dataReader.GetArchitecture();
if (plat == Architecture.Amd64)
{
throw new InvalidOperationException("Unexpected architecture.");
}
byte[] contextBytes = new byte[GetThreadContextSize(dataReader)];
if (SetCurrentThreadId(threadInfo.EngineThreadId, debugClient) == DbgEng.S_OK)
{
var gch = GCHandle.Alloc(contextBytes, GCHandleType.Pinned);
var h_result = ((IDebugAdvanced)debugClient).GetThreadContext(gch.AddrOfPinnedObject(), (uint)contextBytes.Length);
if (h_result == DbgEng.S_OK)
{
try
{
var structure = Marshal.PtrToStructure<CONTEXT_X86>(gch.AddrOfPinnedObject());
threadInfo.ContextStruct = new Model.UnifiedThreadContext(structure, threadInfo);
result = true;
}
finally
{
gch.Free();
}
}
}
return result;
}