public void SetValue (LocalVariable var, Value value) {
if (var == null)
throw new ArgumentNullException ("var");
if (var.Method != Method)
throw new ArgumentException ("Local variable doesn't belong to this frame's method.");
if (value == null)
throw new ArgumentNullException ("value");
CheckMirror (value);
// FIXME: Liveness
// FIXME: Check for return value
try {
vm.conn.StackFrame_SetValues (thread.Id, Id, new int [] { var.GetValueIndex }, 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 local variable.");
else
throw;
}
}