diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2012-06-01 00:00:21 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2012-06-01 00:01:45 +0400 |
commit | 885ec0a04d913516c4aff1d7031dcac57785a329 (patch) | |
tree | d80ca643d11f58942b4470387de98374619f8c71 /main | |
parent | f2c85ebbddf16b800690b172abb656ee497068f3 (diff) |
[Debugger] Need to box values before calling class methods on them
Fixes bug #5433.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftEvaluationContext.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftEvaluationContext.cs b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftEvaluationContext.cs index d7cdb63063..6c475b461d 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftEvaluationContext.cs +++ b/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftEvaluationContext.cs @@ -128,6 +128,22 @@ namespace Mono.Debugging.Soft } } } + + if (method.DeclaringType.IsClass) { + object type = Adapter.GetValueType (this, target); + TypeMirror targetTypeMirror = type as TypeMirror; + Type targetType = type as Type; + + if ((targetTypeMirror != null && (targetTypeMirror.IsValueType || targetTypeMirror.IsPrimitive)) || (targetType != null && (targetType.IsValueType || targetType.IsPrimitive))) { + // A value type being assigned to a parameter which is not a value type. The value has to be boxed. + try { + target = Thread.Domain.CreateBoxedValue ((Value) target); + } catch (NotSupportedException) { + // This runtime doesn't support creating boxed values + throw new EvaluatorException ("This runtime does not support creating boxed values."); + } + } + } MethodCall mc = new MethodCall (this, method, target, values); Adapter.AsyncExecute (mc, Options.EvaluationTimeout); |