Esempio n. 1
0
        public void SetValue(ParameterInfoMirror param, Value value)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }
            if (param.Method != Method)
            {
                throw new ArgumentException("Parameter doesn't belong to this frame's method.");
            }
            if (param.IsRetval)
            {
                throw new ArgumentException("Parameter represents the method return value.");
            }
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            CheckMirror(value);

            // FIXME: Liveness
            // FIXME: Allow setting the frame return value if possible
            try {
                vm.conn.StackFrame_SetValues(thread.Id, Id, new int [] { (-param.Position) - 1 }, new ValueImpl [] { vm.EncodeValue(value) });
            } catch (CommandException ex) {
                if (ex.ErrorCode == ErrorCode.INVALID_ARGUMENT)
                {
                    throw new ArgumentException("Value does not match the type of the variable.");
                }
                else
                {
                    throw;
                }
            }
        }
		public Value GetValue (ParameterInfoMirror param) {
			if (param == null)
				throw new ArgumentNullException ("param");
			if (param.Method != Method)
				throw new ArgumentException ("Parameter doesn't belong to this frame's method.");
			if (param.IsRetval)
				throw new ArgumentException ("Parameter represents the method return value.");

			// FIXME: Liveness
			// FIXME: Allow returning the frame return value if possible
			return vm.DecodeValue (vm.conn.StackFrame_GetValues (thread.Id, Id, new int [] { (- param.Position) - 1 })[0]);
		}
Esempio n. 3
0
        public ParameterInfoMirror[] GetParameters()
        {
            if (param_info == null)
            {
                var pi = vm.conn.Method_GetParamInfo(id);
                param_info = new ParameterInfoMirror [pi.param_count];
                // Return
                ret_param = new ParameterInfoMirror(this, -1, vm.GetType(pi.ret_type), null, ParameterAttributes.Retval);
                // FIXME: this
                // FIXME: Attributes
                for (int i = 0; i < pi.param_count; ++i)
                {
                    param_info [i] = new ParameterInfoMirror(this, i, vm.GetType(pi.param_types [i]), pi.param_names [i], 0);
                }
            }

            return(param_info);
        }
Esempio n. 4
0
        public Value GetValue(ParameterInfoMirror param)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }
            if (param.Method != Method)
            {
                throw new ArgumentException("Parameter doesn't belong to this frame's method.");
            }
            if (param.IsRetval)
            {
                throw new ArgumentException("Parameter represents the method return value.");
            }

            // FIXME: Liveness
            // FIXME: Allow returning the frame return value if possible
            return(vm.DecodeValue(vm.conn.StackFrame_GetValues(thread.Id, Id, new int [] { (-param.Position) - 1 })[0]));
        }
		public void SetValue (ParameterInfoMirror param, Value value) {
			if (param == null)
				throw new ArgumentNullException ("param");
			if (param.Method != Method)
				throw new ArgumentException ("Parameter doesn't belong to this frame's method.");
			if (param.IsRetval)
				throw new ArgumentException ("Parameter represents the method return value.");
			if (value == null)
				throw new ArgumentNullException ("value");
			CheckMirror (value);

			// FIXME: Liveness
			// FIXME: Allow setting the frame return value if possible
			try {
				vm.conn.StackFrame_SetValues (thread.Id, Id, new int [] { (- param.Position) - 1 }, new ValueImpl [] { vm.EncodeValue (value) });
			} catch (CommandException ex) {
				if (ex.ErrorCode == ErrorCode.INVALID_ARGUMENT)
					throw new ArgumentException ("Value does not match the type of the variable.");
				else
					throw;
			}
		}
Esempio n. 6
0
		public ParameterInfoMirror[] GetParameters () {
			if (param_info == null) {
				var pi = vm.conn.Method_GetParamInfo (id);
				param_info = new ParameterInfoMirror [pi.param_count];
				// Return
				ret_param = new ParameterInfoMirror (this, -1, vm.GetType (pi.ret_type), null, ParameterAttributes.Retval);
				// FIXME: this
				// FIXME: Attributes
				for (int i = 0; i < pi.param_count; ++i) {
					param_info [i] = new ParameterInfoMirror (this, i, vm.GetType (pi.param_types [i]), pi.param_names [i], 0);
				}
			}

			return param_info;
		}