diff options
author | David Karlaš <david.karlas@xamarin.com> | 2017-06-16 09:21:55 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2017-06-16 09:23:29 +0300 |
commit | 9549385e47a9f85b98a8190c39b935f2813b2f9c (patch) | |
tree | 125e3d4d6d0f1d376ae0ebdfd8d7398ab2e431d4 /mcs/class/Mono.Debugger.Soft | |
parent | 3f899a3198843f21f70ae2196ee6af2566340fd7 (diff) |
Bug 44266 - Unable to change variable values whilst debugging
https://github.com/mono/debugger-libs/commit/ac17c08938408abc7f5aaf0f862d83bbd2b56d42
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs index 9d7c9881ab9..40b7d631556 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs @@ -665,7 +665,7 @@ namespace Mono.Debugger.Soft return res; } - internal ValueImpl EncodeValue (Value v) { + internal ValueImpl EncodeValue (Value v, List<Value> duplicates = null) { if (v is PrimitiveValue) { object val = (v as PrimitiveValue).Value; if (val == null) @@ -675,16 +675,22 @@ namespace Mono.Debugger.Soft } else if (v is ObjectMirror) { return new ValueImpl { Type = ElementType.Object, Objid = (v as ObjectMirror).Id }; } else if (v is StructMirror) { - return new ValueImpl { Type = ElementType.ValueType, Klass = (v as StructMirror).Type.Id, Fields = EncodeValues ((v as StructMirror).Fields) }; + if (duplicates == null) + duplicates = new List<Value> (); + if (duplicates.Contains (v)) + return new ValueImpl { Type = (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL, Objid = 0 }; + duplicates.Add (v); + + return new ValueImpl { Type = ElementType.ValueType, Klass = (v as StructMirror).Type.Id, Fields = EncodeValues ((v as StructMirror).Fields, duplicates) }; } else { throw new NotSupportedException (); } } - internal ValueImpl[] EncodeValues (IList<Value> values) { + internal ValueImpl[] EncodeValues (IList<Value> values, List<Value> duplicates = null) { ValueImpl[] res = new ValueImpl [values.Count]; for (int i = 0; i < values.Count; ++i) - res [i] = EncodeValue (values [i]); + res [i] = EncodeValue (values [i], duplicates); return res; } |