当前位置: 首页>>代码示例>>C#>>正文


C# Thread.CallMethod方法代码示例

本文整理汇总了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;
        }
开发者ID:atomia,项目名称:mono_debugger,代码行数:27,代码来源:MonoLanguageBackend.cs

示例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);
        }
开发者ID:atomia,项目名称:mono_debugger,代码行数:8,代码来源:MonoLanguageBackend.cs

示例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));
        }
开发者ID:atomia,项目名称:mono_debugger,代码行数:25,代码来源:MonoLanguageBackend.cs


注:本文中的Thread.CallMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。