diff options
author | Zoltan Varga <vargaz@gmail.com> | 2018-02-10 03:15:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-10 03:15:32 +0300 |
commit | 284c5afdf4363aec956ce370c86fc44458fffe6c (patch) | |
tree | 643398d288ca3dce4846b257192032b61d1d98da /mcs/class/Mono.Debugger.Soft | |
parent | dcda4c77bc910bc3ece378007a3c79a14294b15d (diff) |
Bug 60088 - Assertion at ../../../../external/mono/mono/mini/debugger-agent.c:4765, condition `array->len == 1' not met (#6902)
Problem was that I didn't consider `async void` method when adding that assert
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs | 19 | ||||
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest.cs | 20 |
2 files changed, 39 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 743047ef3f1..97202372c77 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -322,6 +322,12 @@ public class Tests : TestsBase, ITest2 new Tests ().attach (); return 0; } + if (args.Length > 0 && args [0] == "step-out-void-async") { + var wait = new ManualResetEvent (false); + step_out_void_async (wait); + wait.WaitOne ();//Don't exist until step_out_void_async is executed... + return 0; + } assembly_load (); breakpoints (); single_stepping (); @@ -1742,6 +1748,19 @@ public class Tests : TestsBase, ITest2 { UninitializedClass.Call();//Breakpoint here and step in } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + static async void step_out_void_async (ManualResetEvent wait) + { + await Task.Yield (); + step_out_void_async_2 (); + wait.Set (); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + static void step_out_void_async_2 () + { + } } public class SentinelClass : MarshalByRefObject { diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 78be9f85a2d..088fe98b087 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -10,6 +10,7 @@ using Diag = System.Diagnostics; using System.Linq; using System.IO; using System.Security.Cryptography; +using System.Threading.Tasks; using NUnit.Framework; @@ -4287,6 +4288,25 @@ public class DebuggerTests } [Test] + public void StepOutAsync () { + vm.Detach (); + Start (new string [] { "dtest-app.exe", "step-out-void-async" }); + var e = run_until ("step_out_void_async_2"); + create_step (e); + var e2 = step_out (); + assert_location (e2, "MoveNext");//we are in step_out_void_async + step_req.Disable (); + step_req.Depth = StepDepth.Out; + step_req.Enable (); + vm.Resume (); + var e3 = GetNextEvent (); + //after step-out from async void, execution should continue + //and runtime should exit + Assert.IsTrue (e3 is VMDeathEvent, e3.GetType().FullName); + vm = null; + } + + [Test] [Category("NotWorking")] public void ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter() { Event e = run_until ("ss_nested_with_two_args_wrapper"); |