Fix Mi Test
authorAnton Zhukov <a.zhukov@samsung.com>
Thu, 17 Oct 2019 15:13:19 +0000 (11:13 -0400)
committerAlexander Soldatov/Staff Engineer/AI Compiler Lab /SRR/Samsung Electronics <soldatov.a@samsung.com>
Wed, 20 Nov 2019 13:14:05 +0000 (16:14 +0300)
* After migration to Exception2 callback MI interrupted after
  catch first unhandled exception event.

* Minor refactoring of filter processing.

src/debug/netcoredbg/breakpoints.cpp
src/debug/netcoredbg/protocol.h
tests/ExceptionBreakpointTest/ExceptionBreakpointTest.cs

index ff12bfa4ccf475f50b3ec1e076f9252c4383bece..c9e26a042b0658c263f2885e3f5dc684ebc852c9 100644 (file)
@@ -795,13 +795,15 @@ bool ExceptionBreakpointStorage::Match(int dwEventType, const string &exceptionN
     GetExceptionBreakMode(mode, exceptionName);
     if (category == ExceptionBreakCategory::ANY || category == mode.category) {
         if (dwEventType == CATCH_HANDLER_FOUND) {
-            if (mode.AnyUser()) {
+            if (mode.UserUnhandled()) {
                 // Expected user-applications exceptions from throw(), but get
                 // explicit/implicit exception from `System.' clases.
                 const string SystemPrefix = "System.";
                 if (exceptionName.compare(0, SystemPrefix.size(), SystemPrefix) != 0)
                     return true;
             }
+            if (mode.Throw())
+                return true;
         }
         if (dwEventType == UNHANDLED) {
             if (mode.Unhandled())
index df9e1b8a8a3b5aec64647cb9fe8709f39924decc..7ec59c5f22bc307f9dda259dc51304ecffed3f4e 100644 (file)
@@ -374,7 +374,7 @@ public:
     }
 
     ExceptionBreakMode() : category(ExceptionBreakCategory::CLR) {
-        setUnhandled();
+        flags.set(Flag::F_Unhandled);
     }
 };
 
index de2da14505e63e093aaf17ca02312310e95140a6..0622f56249483dc4eb3a3fdeda701056fcc7484f 100644 (file)
@@ -261,7 +261,7 @@ Assert.Equal(Lines["PIT_STOP_B"], r.Find("frame").FindInt("line"));
 Send(String.Format("38-break-exception-delete {0}", be10));
 r = Expect("38^done");
 
-//////// Expected result => Raised EXCEPTION_C, EXCEPTION_D, EXCEPTION_E and exit after unhandled EXCEPTION_E.
+//////// Expected result => Raised EXCEPTION_C, EXCEPTION_D, EXCEPTION_E and exit after third unhandled exception.
 //////// "State: !Thow() && UserUnhandled()";
 //////// "name := AppException";
 
@@ -291,12 +291,6 @@ r = Expect("*stopped");
 Assert.Equal("exception-received", r.FindString("reason"));
 Assert.Equal(Lines["EXCEPTION_E"], r.Find("frame").FindInt("line"));
 
-Send("44-exec-continue");
-
-r = Expect("*stopped");
-Assert.Equal("exception-received", r.FindString("reason"));
-Assert.Equal(Lines["EXCEPTION_E"], r.Find("frame").FindInt("line"));
-
 Send("45-exec-continue");
 r = Expect("*stopped");
 Assert.Equal("exited", r.FindString("reason"));