Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2016-11-17 22:07:04 +0300
committerZoltan Varga <vargaz@gmail.com>2016-11-17 22:07:11 +0300
commit218e0a8081dfe598a8814ae40cc09a8ac5ab5cc7 (patch)
tree25acf3b733b922ff74085ff54b83827417b73cfe /mcs/class/Mono.Debugger.Soft
parent22577feecfa38fc15a01887f27aa5687b0c5504c (diff)
[sdb] Error out when trying to obtain objects from unloaded domains, we have to check domain->state as well since the object references become invalid before we received the domain unloaded profiler event. Fixes #44381.
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs11
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest.cs3
2 files changed, 14 insertions, 0 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
index ac3b91b9247..16e35d301e1 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
@@ -1322,6 +1322,8 @@ public class Tests : TestsBase, ITest2
o.invoke_2 ();
+ o.assembly_load ();
+
AppDomain.Unload (domain);
domains_3 ();
@@ -1354,6 +1356,11 @@ public class Tests : TestsBase, ITest2
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void assembly_load_in_domain () {
+ Assembly.Load ("System.Transactions");
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void dynamic_methods () {
var m = new DynamicMethod ("dyn_method", typeof (void), new Type [] { typeof (int) }, typeof (object).Module);
var ig = m.GetILGenerator ();
@@ -1627,6 +1634,10 @@ public class CrossDomain : MarshalByRefObject
public int invoke_3 () {
return 42;
}
+
+ public void assembly_load () {
+ Tests.assembly_load_in_domain ();
+ }
}
public class Foo
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
index c07fdd26d21..f40e1aa83de 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
@@ -3345,6 +3345,9 @@ public class DebuggerTests
vm.Resume ();
e = GetNextEvent ();
if (e is AssemblyUnloadEvent) {
+ AssertThrows<Exception> (delegate () {
+ var assembly_obj = (e as AssemblyUnloadEvent).Assembly.GetAssemblyObject ();
+ });
continue;
} else {
break;