{\r
static void Main(string[] args)\r
{\r
- Label.Checkpoint("init", "test_throw_all", (Object context) => {\r
+ Label.Checkpoint("init", "test_rethrow", (Object context) => {\r
Context Context = (Context)context;\r
Context.Prepare(@"__FILE__:__LINE__");\r
Context.WasEntryPointHit(@"__FILE__:__LINE__");\r
\r
+ Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_0");\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_1");\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_2");\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_3");\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_19");\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "bp_test_20");\r
\r
+ Context.Continue(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // test rethrow without any exception breakpoints setup\r
+\r
+ try {\r
+ try {\r
+ new System.Exception();\r
+ } catch {\r
+ throw;\r
+ }\r
+ } catch {}\r
+\r
+ try {\r
+ try {\r
+ new System.Exception();\r
+ } catch {\r
+ new System.NullReferenceException();\r
+ }\r
+ } catch {}\r
+\r
+ int test_rethrow = 0; Label.Breakpoint("bp_test_0");\r
+\r
+ Label.Checkpoint("test_rethrow", "test_throw_all", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_0");\r
+\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "*");\r
+\r
Context.Continue(@"__FILE__:__LINE__");\r
});\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.Exception", "MITestExceptionBreakpoint.outside_user_code.throw_Exception_with_catch()");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "21");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "22");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.NullReferenceException");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasExceptionBreakpointHitInExternalCode(@"__FILE__:__LINE__", "clr", "throw", "System.NullReferenceException", "MITestExceptionBreakpoint.outside_user_code.throw_NullReferenceException()");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "22");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "23");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "user-unhandled", "*");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_8");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "23");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "24");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "user-unhandled", "System.NullReferenceException");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasExceptionBreakpointHit(@"__FILE__:__LINE__", "bp4", "clr", "user-unhandled", "System.NullReferenceException");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "24");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "25");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw+user-unhandled", "*");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_15");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "25");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "26");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw+user-unhandled", "System.NullReferenceException");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_17");\r
\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "26");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "27");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "user-unhandled", "*");\r
// Important! "unhandled" must be allowed too.\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "unhandled", "System.AppDomainUnloadedException System.Threading.ThreadAbortException");\r
// Note, this is wrong setup for MDA that don't have "System.Exception", but in this way we test MDA/CLR category work.\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "--mda throw", "System.Exception");\r
// Delete only "System.Exception" from "throw" (previously had configured 4 breakpoints by one "throw" command).\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "31");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "32");\r
// Check for breakpoint ID (test CalculateExceptionBreakpointHash() work), if we have 43 here -\r
// all breakpoint were created in proper way, no ID was reused (all breakpoint have unique hash at creation time).\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.Exception");\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "43");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "44");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
});\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.Exception");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.Exception");\r
Context.AddExceptionBreakpoint(@"__FILE__:__LINE__", "throw", "System.Exception");\r
- Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "44");\r
+ Context.DeleteExceptionBreakpoint(@"__FILE__:__LINE__", "45");\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
Context.WasExceptionBreakpointHit(@"__FILE__:__LINE__", "bp3", "clr", "user-unhandled", "System.Exception");\r
{\r
static void Main(string[] args)\r
{\r
- Label.Checkpoint("init", "test_all", (Object context) => {\r
+ Label.Checkpoint("init", "test_rethrow", (Object context) => {\r
Context Context = (Context)context;\r
Context.PrepareStart(@"__FILE__:__LINE__");\r
\r
+ Context.AddBreakpoint(@"__FILE__:__LINE__", "bp_test_0");\r
Context.AddBreakpoint(@"__FILE__:__LINE__", "bp_test_1");\r
Context.AddBreakpoint(@"__FILE__:__LINE__", "bp_test_2");\r
Context.AddBreakpoint(@"__FILE__:__LINE__", "bp_test_3");\r
Context.AddBreakpoint(@"__FILE__:__LINE__", "bp_test_17");\r
Context.SetBreakpoints(@"__FILE__:__LINE__");\r
\r
+ Context.PrepareEnd(@"__FILE__:__LINE__");\r
+ Context.WasEntryPointHit(@"__FILE__:__LINE__");\r
+ Context.Continue(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // test rethrow without any exception breakpoints setup\r
+\r
+ try {\r
+ try {\r
+ new System.Exception();\r
+ } catch {\r
+ throw;\r
+ }\r
+ } catch {}\r
+\r
+ try {\r
+ try {\r
+ new System.Exception();\r
+ } catch {\r
+ new System.NullReferenceException();\r
+ }\r
+ } catch {}\r
+\r
+ int test_rethrow = 0; Label.Breakpoint("bp_test_0");\r
+\r
+ Label.Checkpoint("test_rethrow", "test_all", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "bp_test_0");\r
+\r
Context.ResetExceptionBreakpoints();\r
Context.AddExceptionBreakpointFilterAll();\r
Context.SetExceptionBreakpoints(@"__FILE__:__LINE__");\r
\r
- Context.PrepareEnd(@"__FILE__:__LINE__");\r
- Context.WasEntryPointHit(@"__FILE__:__LINE__");\r
Context.Continue(@"__FILE__:__LINE__");\r
});\r
\r