Inheritance: TargetFunctionType
Example #1
0
        internal static MonoMethodInfo Create(IMonoStructType klass, int index,
                                              Cecil.MethodDefinition minfo)
        {
            MonoFunctionType type = klass.LookupFunction(minfo);

            return(new MonoMethodInfo(klass, index, minfo, type));
        }
Example #2
0
 private MonoMethodInfo(IMonoStructType klass, int index, Cecil.MethodDefinition minfo,
                        MonoFunctionType type)
     : base(type, MonoFunctionType.GetMethodName(minfo), index,
            minfo.IsStatic, GetAccessibility(minfo), type.FullName)
 {
     FunctionType = type;
 }
Example #3
0
        private MonoEventInfo(IMonoStructType klass, int index, Cecil.EventDefinition einfo,
				       TargetType type, bool is_static,
				       TargetMemberAccessibility accessibility, MonoFunctionType add,
				       MonoFunctionType remove, MonoFunctionType raise)
            : base(type, einfo.Name, index, is_static, accessibility, add, remove, raise)
        {
            this.Klass = klass;
            this.AddType = add;
            this.RemoveType = remove;
            this.RaiseType = raise;
        }
Example #4
0
 private MonoEventInfo(IMonoStructType klass, int index, Cecil.EventDefinition einfo,
                       TargetType type, bool is_static,
                       TargetMemberAccessibility accessibility, MonoFunctionType add,
                       MonoFunctionType remove, MonoFunctionType raise)
     : base(type, einfo.Name, index, is_static, accessibility, add, remove, raise)
 {
     this.Klass      = klass;
     this.AddType    = add;
     this.RemoveType = remove;
     this.RaiseType  = raise;
 }
Example #5
0
        public MonoFunctionType LookupFunction(Cecil.MethodDefinition mdef)
        {
            int token = MonoDebuggerSupport.GetMethodToken(mdef);

            if (function_hash == null)
            {
                function_hash = new Dictionary <int, MonoFunctionType> ();
            }
            if (!function_hash.ContainsKey(token))
            {
                MonoFunctionType function = new MonoFunctionType(this, mdef);
                function_hash.Add(token, function);
                return(function);
            }

            return(function_hash [token]);
        }
Example #6
0
        private MonoPropertyInfo(TargetType type, IMonoStructType klass, int index,
                                 bool is_static, Cecil.PropertyDefinition pinfo,
                                 TargetMemberAccessibility accessibility,
                                 MonoFunctionType getter, MonoFunctionType setter)
            : base(type, pinfo.Name, index, is_static, accessibility, getter, setter)
        {
            this.Klass      = klass;
            this.GetterType = getter;
            this.SetterType = setter;

            bool is_compiler_generated;
            DebuggerTypeProxyAttribute type_proxy;

            MonoSymbolFile.CheckCustomAttributes(pinfo,
                                                 out browsable_state,
                                                 out debugger_display,
                                                 out type_proxy,
                                                 out is_compiler_generated);
        }
Example #7
0
        void get_methods()
        {
            lock (this) {
                if (methods != null)
                {
                    return;
                }

                function_hash = new Dictionary <Cecil.MethodDefinition, MonoFunctionType> ();

                foreach (Cecil.MethodDefinition method in TypeDef.Methods)
                {
                    MonoFunctionType func = new MonoFunctionType(this, method);
                    function_hash.Add(method, func);
                }

                int num_methods = 0;
                foreach (Cecil.MethodDefinition method in GetMethods(TypeDef, false))
                {
                    if ((method.Attributes & Cecil.MethodAttributes.SpecialName) != 0)
                    {
                        continue;
                    }
                    num_methods++;
                }

                methods = new MonoMethodInfo [num_methods];

                int pos = 0;
                foreach (Cecil.MethodDefinition method in GetMethods(TypeDef, false))
                {
                    if ((method.Attributes & Cecil.MethodAttributes.SpecialName) != 0)
                    {
                        continue;
                    }
                    methods [pos] = MonoMethodInfo.Create(this, pos, method);
                    pos++;
                }
            }
        }
        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;
        }
 void reached_main(TargetMemoryAccess target, TargetAddress method)
 {
     main_method = ReadMonoMethod (target, method);
 }
Example #10
0
        public MonoFunctionType LookupFunction(Cecil.MethodDefinition mdef)
        {
            int token = MonoDebuggerSupport.GetMethodToken (mdef);
            if (function_hash == null)
                function_hash = new Dictionary<int,MonoFunctionType> ();
            if (!function_hash.ContainsKey (token)) {
                MonoFunctionType function = new MonoFunctionType (this, mdef);
                function_hash.Add (token, function);
                return function;
            }

            return function_hash [token];
        }
Example #11
0
            public MyBreakpointHandle(Breakpoint bpt, MonoFunctionType function,
						   int line, int column)
                : base(bpt, function, line, column)
            {
                this.function = function;
            }
Example #12
0
        private MonoMethodInfo(IMonoStructType klass, int index, Cecil.MethodDefinition minfo,
					MonoFunctionType type)
            : base(type, MonoFunctionType.GetMethodName (minfo), index,
				minfo.IsStatic, GetAccessibility (minfo), type.FullName)
        {
            FunctionType = type;
        }
Example #13
0
            public OperationRuntimeInvoke(SingleSteppingEngine sse,
					       TargetFunctionType function,
					       TargetStructObject instance,
					       TargetObject[] param_objects,
					       RuntimeInvokeFlags flags,
					       RuntimeInvokeResult result)
                : base(sse, result)
            {
                this.Result = result;
                this.Function = (MonoFunctionType) function;
                this.Instance = instance;
                this.ParamObjects = param_objects;
                this.Flags = flags;
            }
Example #14
0
            public MonoMethodSource(MonoSymbolFile file, SourceFile source_file,
						 C.MethodEntry method, Cecil.MethodDefinition mdef,
						 MonoClassType klass, MonoFunctionType function)
            {
                this.file = file;
                this.source_file = source_file;
                this.method = method;
                this.mdef = mdef;
                this.function = function;
                this.klass = klass;

                full_name = method.GetRealName ();
                if (full_name == null)
                    full_name = MonoSymbolFile.GetMethodName (mdef);

                C.LineNumberEntry start, end;
                C.LineNumberTable lnt = method.GetLineNumberTable ();
                if (lnt.GetMethodBounds (out start, out end))
                    start_row = start.Row; end_row = end.Row;
            }
 public MyBreakpointHandle(Breakpoint bpt, MonoFunctionType function,
                           int line, int column)
     : base(bpt, function, line, column)
 {
     this.function = function;
 }
Example #16
0
        void get_methods()
        {
            lock (this) {
                if (methods != null)
                    return;

                function_hash = new Dictionary<Cecil.MethodDefinition, MonoFunctionType> ();

                foreach (Cecil.MethodDefinition method in TypeDef.Methods) {
                    MonoFunctionType func = new MonoFunctionType (this, method);
                    function_hash.Add (method, func);
                }

                foreach (Cecil.MethodDefinition method in TypeDef.Constructors) {
                    MonoFunctionType func = new MonoFunctionType (this, method);
                    function_hash.Add (method, func);
                }

                int num_methods = 0;
                foreach (Cecil.MethodDefinition method in TypeDef.Methods) {
                    if ((method.Attributes & Cecil.MethodAttributes.SpecialName) != 0)
                        continue;
                    num_methods++;
                }

                methods = new MonoMethodInfo [num_methods];

                int pos = 0;
                foreach (Cecil.MethodDefinition method in TypeDef.Methods) {
                    if ((method.Attributes & Cecil.MethodAttributes.SpecialName) != 0)
                        continue;
                    methods [pos] = MonoMethodInfo.Create (this, pos, method);
                    pos++;
                }
            }
        }
Example #17
0
        private MonoPropertyInfo(TargetType type, IMonoStructType klass, int index,
					  bool is_static, Cecil.PropertyDefinition pinfo,
					  TargetMemberAccessibility accessibility,
					  MonoFunctionType getter, MonoFunctionType setter)
            : base(type, pinfo.Name, index, is_static, accessibility, getter, setter)
        {
            this.Klass = klass;
            this.GetterType = getter;
            this.SetterType = setter;

            bool is_compiler_generated;
            DebuggerTypeProxyAttribute type_proxy;
            MonoSymbolFile.CheckCustomAttributes (pinfo,
                                  out browsable_state,
                                  out debugger_display,
                                  out type_proxy,
                                  out is_compiler_generated);
        }