mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
1
Commits
master
...
bug51294repro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c096418920 |
No files matched your search
@@ -19,11 +19,14 @@ TEST_HELPERS_SOURCES = \
|
||||
../test-helpers/NetworkHelpers.cs \
|
||||
Test/TypeLoadClass.cs
|
||||
|
||||
test-local: dtest-app.exe dtest-excfilter.exe
|
||||
test-local: dtest-app.exe dtest-excfilter.exe appdomain-client.exe
|
||||
|
||||
dtest-app.exe: Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
|
||||
|
||||
appdomain-client.exe: ../../../mono/tests/appdomain-client.cs
|
||||
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:appdomain-client.exe -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- ../../../mono/tests/appdomain-client.cs
|
||||
|
||||
dtest-excfilter.exe: Test/dtest-excfilter.il
|
||||
MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Mono.Debugger.Soft
|
||||
}
|
||||
}
|
||||
|
||||
internal long Id {
|
||||
public long Id {
|
||||
get {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -292,6 +292,28 @@ public class Tests : TestsBase, ITest2
|
||||
evt.WaitOne ();
|
||||
}
|
||||
|
||||
static void multi_domain_load()
|
||||
{
|
||||
var setup = new AppDomainSetup();
|
||||
setup.ApplicationBase = ".";
|
||||
|
||||
AppDomain newDomain = AppDomain.CreateDomain("multi_domain_load_domain_1", null, setup);
|
||||
|
||||
string[] args = { "1", "2", "3" };
|
||||
newDomain.ExecuteAssembly("appdomain-client.exe", null, args);
|
||||
|
||||
|
||||
AppDomainSetup setup2 = new AppDomainSetup();
|
||||
setup2.ApplicationBase = ".";
|
||||
|
||||
AppDomain newDomain2 = AppDomain.CreateDomain($"multi_domain_load_domain_2", null, setup2);
|
||||
|
||||
newDomain2.ExecuteAssembly("appdomain-client.exe", null, args);
|
||||
|
||||
AppDomain.Unload(newDomain);
|
||||
AppDomain.Unload(newDomain2);
|
||||
}
|
||||
|
||||
public static int Main (String[] args) {
|
||||
tls_i = 42;
|
||||
|
||||
@@ -323,6 +345,7 @@ public class Tests : TestsBase, ITest2
|
||||
return 0;
|
||||
}
|
||||
assembly_load ();
|
||||
multi_domain_load();
|
||||
breakpoints ();
|
||||
single_stepping ();
|
||||
arguments ();
|
||||
|
||||
@@ -2497,6 +2497,52 @@ public class DebuggerTests
|
||||
vm = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MultiDomainLoad () {
|
||||
Event e = run_until ("multi_domain_load");
|
||||
|
||||
vm.EnableEvents (EventType.AppDomainCreate, EventType.AppDomainUnload, EventType.AssemblyUnload, EventType.AssemblyLoad);
|
||||
|
||||
vm.Resume ();
|
||||
var listOfAllAssembliesLoaded=new List<AssemblyMirror>();
|
||||
bool exitLoop = false;
|
||||
while (!exitLoop) {
|
||||
e = GetNextEvent ();
|
||||
switch(e)
|
||||
{
|
||||
case AssemblyLoadEvent al:
|
||||
Console.WriteLine($"({al.Assembly.Id})Assembly loaded {al.Assembly.Location} in {al.Assembly.Domain.FriendlyName} at thread:{e.Thread.Name}");
|
||||
listOfAllAssembliesLoaded.Add(((AssemblyLoadEvent)e).Assembly);
|
||||
vm.Resume();
|
||||
break;
|
||||
case AssemblyUnloadEvent au:
|
||||
Console.WriteLine($"({au.Assembly.Id})Assembly unloaded {au.Assembly.Location} in {au.Assembly.Domain.FriendlyName} at thread:{e.Thread.Name}");
|
||||
vm.Resume();
|
||||
break;
|
||||
case AppDomainCreateEvent dc:
|
||||
Console.WriteLine($"Domain created {dc.Domain.FriendlyName} at thread:{e.Thread.Name}");
|
||||
vm.Resume();
|
||||
break;
|
||||
case AppDomainUnloadEvent du:
|
||||
Console.WriteLine($"Domain unloaded {du.Domain.FriendlyName} at thread:{e.Thread.Name}");
|
||||
vm.Resume();
|
||||
break;
|
||||
case VMDeathEvent vmd:
|
||||
exitLoop=true;
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine(e.GetType().FullName);
|
||||
vm.Resume();
|
||||
break;
|
||||
}
|
||||
}
|
||||
Assert.AreEqual(
|
||||
1/*Mono.Security.dll which loads before AppDomains are created*/+
|
||||
2/*appdomain-client.exe which loads twice for 2 domains, see dtest-app.cs*/+
|
||||
1/*System.Core.dll which loads at end*/
|
||||
,listOfAllAssembliesLoaded.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AssemblyLoad () {
|
||||
Event e = run_until ("assembly_load");
|
||||
|
||||
Reference in new issue
Block a user