Esempio n. 1
0
        internal MethodBodyInfo Method_GetBody(long id)
        {
            var res = SendReceive (CommandSet.METHOD, (int)CmdMethod.GET_BODY, new PacketWriter ().WriteId (id));

            MethodBodyInfo info = new MethodBodyInfo ();
            info.il = new byte [res.ReadInt ()];
            for (int i = 0; i < info.il.Length; ++i)
                info.il [i] = (byte)res.ReadByte ();

            if (Version.AtLeast (2, 18)) {
                info.clauses = new ExceptionClauseInfo [res.ReadInt ()];

                for (int i = 0; i < info.clauses.Length; ++i) {
                    var clause = new ExceptionClauseInfo {
                        flags = (ExceptionClauseFlags) res.ReadInt (),
                        try_offset = res.ReadInt (),
                        try_length = res.ReadInt (),
                        handler_offset = res.ReadInt (),
                        handler_length = res.ReadInt (),
                    };

                    if (clause.flags == ExceptionClauseFlags.None)
                        clause.catch_type_id = res.ReadId ();
                    else if (clause.flags == ExceptionClauseFlags.Filter)
                        clause.filter_offset = res.ReadInt ();

                    info.clauses [i] = clause;
                }
            } else
                info.clauses = new ExceptionClauseInfo [0];

            return info;
        }
Esempio n. 2
0
		internal MethodBodyMirror (VirtualMachine vm, MethodMirror method, MethodBodyInfo info) : base (vm, 0) {
			this.method = method;
			this.info = info;
		}
Esempio n. 3
0
		internal MethodBodyInfo Method_GetBody (long id) {
			var res = SendReceive (CommandSet.METHOD, (int)CmdMethod.GET_BODY, new PacketWriter ().WriteId (id));

			MethodBodyInfo info = new MethodBodyInfo ();
			info.il = new byte [res.ReadInt ()];
			for (int i = 0; i < info.il.Length; ++i)
				info.il [i] = (byte)res.ReadByte ();

			return info;
		}