Inheritance: TargetMethodSignature
コード例 #1
0
        public override TargetMethodSignature GetSignature(Thread thread)
        {
            if (signature != null)
            {
                return(signature);
            }

            if (!ContainsGenericParameters)
            {
                return(new MonoMethodSignature(return_type, parameter_types));
            }

            if (!thread.CurrentFrame.Language.IsManaged)
            {
                throw new TargetException(TargetError.InvalidContext);
            }

            TargetAddress addr = (TargetAddress)thread.ThreadServant.DoTargetAccess(
                delegate(TargetMemoryAccess target)  {
                MonoClassInfo class_info = ResolveClass(target, true);
                return(class_info.GetMethodAddress(target, token));
            });

            MonoLanguageBackend mono = klass.File.MonoLanguage;

            TargetAddress sig = thread.CallMethod(
                mono.MonoDebuggerInfo.GetMethodSignature, addr, 0);

            signature = (MonoMethodSignature)thread.ThreadServant.DoTargetAccess(
                delegate(TargetMemoryAccess target)  {
                return(mono.MetadataHelper.GetMethodSignature(mono, target, sig));
            });

            return(signature);
        }
コード例 #2
0
ファイル: MonoFunctionType.cs プロジェクト: baulig/debugger
        public override TargetMethodSignature GetSignature(Thread thread)
        {
            if (signature != null)
                return signature;

            if (!ContainsGenericParameters)
                return new MonoMethodSignature (return_type, parameter_types);

            if (!thread.CurrentFrame.Language.IsManaged)
                throw new TargetException (TargetError.InvalidContext);

            TargetAddress addr = (TargetAddress) thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target)  {
                    MonoClassInfo class_info = ResolveClass (target, true);
                    return class_info.GetMethodAddress (target, token);
            });

            MonoLanguageBackend mono = klass.File.MonoLanguage;

            TargetAddress sig = thread.CallMethod (
                mono.MonoDebuggerInfo.GetMethodSignature, addr, 0);

            signature = (MonoMethodSignature) thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target)  {
                    return mono.MetadataHelper.GetMethodSignature (mono, target, sig);
            });

            return signature;
        }