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:
authorThays Grazia <thaystg@gmail.com>2019-06-21 01:48:13 +0300
committerZoltan Varga <vargaz@gmail.com>2019-06-21 01:48:13 +0300
commit405d521149b8fe4caef2eaa3665e5f6020ef298b (patch)
treebb15cf8745eccfdc57a986ce30a531556ff62785 /mcs/class/Mono.Debugger.Soft
parentb4e43abbcc328a932ff9c5b71203ce5d35f794b8 (diff)
[debugger] Debugger doesn't break on unhandled exceptions (#15234)
* When the catch found is in a MONO_WRAPPER_RUNTIME_INVOKE the exception should be treated as an UNHANDLED by the debugger. * Adding unit test. * trying to fix side effect. * I've tested the MonoTests.DebuggerTests.UnhandledException_2 test on VsWin using .net Framework and I think the test is wrong because the first break is in throw and the next break will be on breakpoint. In our implementation we were ignoring the unhandled exception and stopping only on breakpoint.
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs8
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest.cs20
2 files changed, 28 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 f376840fbb4..bf560421bd2 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
@@ -414,6 +414,10 @@ public class Tests : TestsBase, ITest2
unhandled_exception ();
return 0;
}
+ if (args.Length >0 && args [0] == "unhandled-exception-wrapper") {
+ unhandled_exception_wrapper ();
+ return 0;
+ }
if (args.Length >0 && args [0] == "unhandled-exception-endinvoke") {
unhandled_exception_endinvoke ();
return 0;
@@ -1484,6 +1488,10 @@ public class Tests : TestsBase, ITest2
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void unhandled_exception_wrapper () {
+ throw new ArgumentException("test");
+ }
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void unhandled_exception_endinvoke_2 () {
}
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
index bd768e64e58..1f394d53c53 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
@@ -4218,6 +4218,8 @@ public class DebuggerTests
var e = run_until ("unhandled_exception_endinvoke");
vm.Resume ();
+ var e1 = GetNextEvent (); //this should be the exception
+ vm.Resume ();
var e2 = GetNextEvent ();
Assert.IsFalse (e2 is ExceptionEvent);
@@ -4247,6 +4249,24 @@ public class DebuggerTests
}
[Test]
+ public void UnhandledException3 () {
+ vm.Exit (0);
+
+ Start (dtest_app_path, "unhandled-exception-wrapper");
+
+ var req = vm.CreateExceptionRequest (null, false, true);
+ req.Enable ();
+
+ var e = run_until ("unhandled_exception_wrapper");
+ vm.Resume ();
+
+ var e2 = GetNextEvent ();
+ Assert.IsTrue (e2 is ExceptionEvent);
+ vm.Exit (0);
+ vm = null;
+ }
+
+ [Test]
public void GCWhileSuspended () {
// Check that objects are kept alive during suspensions
Event e = run_until ("gc_suspend_1");