本文整理汇总了C#中ICorDebugFunction.GetModule方法的典型用法代码示例。如果您正苦于以下问题:C# ICorDebugFunction.GetModule方法的具体用法?C# ICorDebugFunction.GetModule怎么用?C# ICorDebugFunction.GetModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICorDebugFunction
的用法示例。
在下文中一共展示了ICorDebugFunction.GetModule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CorFunction
public CorFunction(ICorDebugFunction funtion)
{
corFunction = funtion;
ICorDebugModule imodule = null;
corFunction.GetModule(out imodule);
module = new CorModule(imodule);
corFunction.GetToken(out token);
//corFunction.GetLocalVarSigToken(
//ICorDebugFunctionBreakpoint breakPoint = null;
//corFunction.
}
示例2: Import
public static IMethod Import(this ICompilation compilation, ICorDebugFunction corFunction)
{
Module module = compilation.GetAppDomain().Process.GetModule(corFunction.GetModule());
if (module.IsDynamic || module.IsInMemory) {
return module.Assembly.GetTypeDefinition("", "UnknownDynamicType").Methods.First();
}
var info = GetInfo(module.Assembly);
uint functionToken = corFunction.GetToken();
var unresolvedMethod = info.GetMethodFromToken(functionToken);
if (unresolvedMethod == null) {
// The type containing this function wasn't loaded yet
uint classToken = corFunction.GetClass().GetToken();
var definition = ToTypeDefinitionReference(module, classToken).Resolve(new SimpleTypeResolveContext(module.Assembly)).GetDefinition();
if (definition == null)
throw new InvalidOperationException("Could not find class for token " + classToken);
definition.Methods.ToList(); // enforce loading the methods so that they get added to the dictionary
unresolvedMethod = info.GetMethodFromToken(functionToken);
if (unresolvedMethod == null)
throw new InvalidOperationException("Could not find function with token " + functionToken);
}
return unresolvedMethod.Resolve(new SimpleTypeResolveContext(module.Assembly));
}