diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EnumMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EnumMirror.cs index 5131b2a43494..66a77b3083b3 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EnumMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EnumMirror.cs @@ -19,7 +19,8 @@ internal EnumMirror (VirtualMachine vm, TypeMirror type, Value[] fields) : base if (!type.IsEnum) throw new ArgumentException ("type must be an enum type", "type"); TypeMirror t = type.EnumUnderlyingType; - if (value.Value == null || !value.Value.GetType ().IsPrimitive || t != vm.RootDomain.GetCorrespondingType (value.Value.GetType ())) + // Can't access t's domain, so compare type names + if (value.Value == null || !value.Value.GetType ().IsPrimitive || t.Name != vm.RootDomain.GetCorrespondingType (value.Value.GetType ()).Name) throw new ArgumentException ("Value '" + value.Value + "' does not match the type of the enum."); } diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 4633ce2ae586..8fb43da5d617 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -3511,6 +3511,10 @@ public void Domains () { Assert.AreEqual ("domains", frames [2].Method.Name); Assert.AreEqual (vm.RootDomain, frames [2].Domain); + // Check enum creation in other domains + var anenum = vm.CreateEnumMirror (d_method.DeclaringType.Assembly.GetType ("AnEnum"), vm.CreateValue (1)); + Assert.AreEqual (1, anenum.Value); + // Test breakpoints on already JITted methods in other domains m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2"); Assert.IsNotNull (m);