Inheritance: TargetMethodSignature
Ejemplo n.º 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);
        }
Ejemplo n.º 2
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;
        }