本文整理汇总了C#中Thread.CallMethod方法的典型用法代码示例。如果您正苦于以下问题:C# Thread.CallMethod方法的具体用法?C# Thread.CallMethod怎么用?C# Thread.CallMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thread
的用法示例。
在下文中一共展示了Thread.CallMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterMethodLoadHandler
internal int RegisterMethodLoadHandler(Thread thread, MonoFunctionType func,
FunctionBreakpointHandle handle)
{
if (method_load_handlers.Contains (handle.Index))
return handle.Index;
if (!thread.CurrentFrame.Language.IsManaged)
throw new TargetException (TargetError.InvalidContext);
TargetAddress retval = thread.CallMethod (
info.InsertSourceBreakpoint, func.SymbolFile.MonoImage,
func.Token, handle.Index, func.DeclaringType.BaseName);
MethodLoadedHandler handler = handle.MethodLoaded;
if (!retval.IsNull) {
thread.ThreadServant.DoTargetAccess (
delegate (TargetMemoryAccess target) {
method_from_jit_info ((TargetAccess) target,
retval, handler);
return null;
});
}
method_load_handlers.Add (handle.Index, handler);
return handle.Index;
}
示例2: RemoveMethodLoadHandler
internal void RemoveMethodLoadHandler(Thread thread, int index)
{
if (!thread.CurrentFrame.Language.IsManaged)
throw new TargetException (TargetError.InvalidContext);
thread.CallMethod (info.RemoveBreakpoint, index, 0);
method_load_handlers.Remove (index);
}
示例3: CreateBoxedObject
public override TargetObjectObject CreateBoxedObject(Thread thread, TargetObject value)
{
TargetAddress klass;
if ((value is MonoClassObject) && !value.Type.IsByRef)
klass = ((MonoClassObject) value).KlassAddress;
else if (value is TargetFundamentalObject) {
MonoClassType ctype = ((MonoFundamentalType) value.Type).MonoClassType;
MonoClassInfo info = (MonoClassInfo) thread.ThreadServant.DoTargetAccess (
delegate (TargetMemoryAccess target) {
return ctype.ResolveClass (target, true);
});
klass = info.KlassAddress;
} else
throw new InvalidOperationException ();
if (!thread.CurrentFrame.Language.IsManaged)
throw new TargetException (TargetError.InvalidContext);
TargetAddress boxed = thread.CallMethod (MonoDebuggerInfo.GetBoxedObjectMethod, klass, value);
if (boxed.IsNull)
return null;
return new MonoObjectObject (builtin_types.ObjectType, new AbsoluteTargetLocation (boxed));
}