* Fix step-in and step-over in "filtered" methods after stop at breakpoint.
* Fix step-in fome method arguments that also contains methods.
* Fix step-in in case disabled Just My Code, and method have DebuggerStepThrough or DebuggerHidden attribute.
Related to https://github.com/Samsung/netcoredbg/issues/154
\r
auto methodShouldBeFltered = [&]() -> bool\r
{\r
+ // In case stepping by method code lines or return to caller, don't check filtering (don't need to):\r
+ // 1) filtering check for this method was already "passed" or 2) execution was stopped at breakpoint inside method or its callee.\r
+ if (reason != CorDebugStepReason::STEP_CALL)\r
+ return false;\r
+\r
ULONG nameLen;\r
WCHAR szFunctionName[mdNameLen] = {0};\r
if (SUCCEEDED(iMD->GetMethodProps(methodDef, nullptr, szFunctionName, _countof(szFunctionName),\r
bool noUserCodeFound = false; // Must be initialized with `false`, since GetFrameILAndNextUserCodeILOffset call could be failed before delegate call.\r
if (SUCCEEDED(Status = m_sharedModules->GetFrameILAndNextUserCodeILOffset(iCorFrame, ipOffset, ilNextUserCodeOffset, &noUserCodeFound)))\r
{\r
- // Current IL offset less than IL offset of next close user code line.\r
- if (ipOffset < ilNextUserCodeOffset)\r
+ // Current IL offset less than IL offset of next close user code line (for example, step-in into async method)\r
+ if (reason == CorDebugStepReason::STEP_CALL && ipOffset < ilNextUserCodeOffset)\r
{\r
IfFailRet(m_simpleStepper->SetupStep(pThread, IDebugger::StepType::STEP_OVER));\r
return S_OK;\r
{\r
IfFailRet(m_simpleStepper->SetupStep(pThread, IDebugger::StepType::STEP_IN));\r
// In case step-in will return from filtered method and no user code was called, step-in again.\r
- if (!m_stepFiltering && methodShouldBeFltered())\r
- m_filteredPrevStep = true;\r
+ m_filteredPrevStep = true;\r
\r
return S_OK;\r
}\r
Label.Checkpoint("step_out_func1_check", "step_in_func4", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func4");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func4_check", "step_in_func2", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func4");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func2");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func2_check", "step_in_func3_cycle1", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle1");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func3_check_cycle1", "step_in_func3_cycle2", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle2");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_whenall", "test_attr1", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_whenall_1");
Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "step_whenall_2");
Context Context = (Context)context;\r
\r
Context.StepOut(@"__FILE__:__LINE__");\r
- Context.WasStep(@"__FILE__:__LINE__", 16);\r
+ Context.WasStep(@"__FILE__:__LINE__", 15);\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
});\r
Context Context = (Context)context;\r
\r
Context.StepOut(@"__FILE__:__LINE__");\r
- Context.WasStep(@"__FILE__:__LINE__", 16);\r
+ Context.WasStep(@"__FILE__:__LINE__", 15);\r
\r
Context.Continue(@"__FILE__:__LINE__");\r
});\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_end");\r
\r
Context.EnableBreakpoint(@"__FILE__:__LINE__", "test_async_void1");\r
\r
namespace MITestNoJMCNoFilterStepping\r
{\r
+ public readonly struct Digit\r
+ {\r
+ private readonly byte digit;\r
+\r
+ public Digit(byte digit)\r
+ {\r
+ this.digit = digit;\r
+ }\r
+ public static implicit operator byte(Digit d)\r
+ { Label.Breakpoint("test_op_implicit_1");\r
+ return d.digit; Label.Breakpoint("test_op_implicit_2");\r
+ Label.Breakpoint("test_op_implicit_3");}\r
+ public static explicit operator Digit(byte b)\r
+ { Label.Breakpoint("test_op_explicit_1");\r
+ return new Digit(b); Label.Breakpoint("test_op_explicit_2");\r
+ Label.Breakpoint("test_op_explicit_3");}\r
+ }\r
+\r
+ public class TestBreakpointInProperty\r
+ {\r
+ private int _value = 7;\r
+\r
+ private int AddOne(int data)\r
+ { Label.Breakpoint("test_break_property_getter_1");\r
+ return data + 1; Label.Breakpoint("test_break_property_getter_2");\r
+ Label.Breakpoint("test_break_property_getter_3");}\r
+\r
+ public int Data\r
+ {\r
+ [DebuggerStepThrough]\r
+ get\r
+ {\r
+ int tmp = AddOne(_value);\r
+ return tmp;\r
+ }\r
+ [DebuggerStepThrough]\r
+ set\r
+ {\r
+ _value = value;\r
+ }\r
+ }\r
+ }\r
+\r
+ class TestStepInArguments\r
+ {\r
+ public int P1\r
+ {\r
+ get\r
+ { Label.Breakpoint("test_step_arguments_P1_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_P1_2");\r
+ Label.Breakpoint("test_step_arguments_P1_3");}\r
+ }\r
+ public int P2\r
+ {\r
+ get\r
+ { Label.Breakpoint("test_step_arguments_P2_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_P2_2");\r
+ Label.Breakpoint("test_step_arguments_P2_3");}\r
+ }\r
+ \r
+ public int M1()\r
+ { Label.Breakpoint("test_step_arguments_M1_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_M1_2");\r
+ Label.Breakpoint("test_step_arguments_M1_3");}\r
+ public int M2()\r
+ { Label.Breakpoint("test_step_arguments_M2_1");\r
+ return 2; Label.Breakpoint("test_step_arguments_M2_2");\r
+ Label.Breakpoint("test_step_arguments_M2_3");}\r
+\r
+ public void M3(int a, int b)\r
+ { Label.Breakpoint("test_step_arguments_M3_1");\r
+ ; Label.Breakpoint("test_step_arguments_M3_2");\r
+ Label.Breakpoint("test_step_arguments_M3_3");}\r
+ public void M4(int a, int b, int c = 0, int d = 0)\r
+ { Label.Breakpoint("test_step_arguments_M4_1");\r
+ ; Label.Breakpoint("test_step_arguments_M4_2");\r
+ Label.Breakpoint("test_step_arguments_M4_3");}\r
+ public int M5(int k)\r
+ { Label.Breakpoint("test_step_arguments_M5_1");\r
+ return k + 1; Label.Breakpoint("test_step_arguments_M5_2");\r
+ Label.Breakpoint("test_step_arguments_M5_3");}\r
+\r
+ [DebuggerStepThrough]\r
+ public int M6()\r
+ {\r
+ return 1;\r
+ }\r
+ }\r
+\r
class Program\r
{\r
static void Main(string[] args)\r
\r
// Test debugger attribute on methods with JMC disabled.\r
\r
- test_attr_func1(); Label.Breakpoint("test_attr_func1");\r
+ test_attr_func1_1(); Label.Breakpoint("test_attr_func1_1");\r
+ test_attr_func1_2(); Label.Breakpoint("test_attr_func1_2");\r
\r
Label.Checkpoint("test_attr1", "test_attr2", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
\r
- test_attr_func2(); Label.Breakpoint("test_attr_func2");\r
+ test_attr_func2_1(); Label.Breakpoint("test_attr_func2_1");\r
+ test_attr_func2_2(); Label.Breakpoint("test_attr_func2_2");\r
\r
Label.Checkpoint("test_attr2", "test_attr3", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_in");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2_in");\r
+ Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
});\r
\r
- test_attr_func3(); Label.Breakpoint("test_attr_func3");\r
+ test_attr_func3_1(); Label.Breakpoint("test_attr_func3_1");\r
+ test_attr_func3_2(); Label.Breakpoint("test_attr_func3_2");\r
\r
Label.Checkpoint("test_attr3", "test_attr4", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
\r
\r
Label.Checkpoint("test_property_attr1", "test_property_attr2", (Object context) => {\r
Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
Context.WasStep(@"__FILE__:__LINE__", "test_property1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
res = TestImplHolder.getImpl2().Calc1(); Label.Breakpoint("test_step_through2");\r
Console.WriteLine("Test step through end."); Label.Breakpoint("test_step_through_end");\r
\r
- Label.Checkpoint("test_step_through", "finish", (Object context) => {\r
+ Label.Checkpoint("test_step_through", "test_step_cast", (Object context) => {\r
Context Context = (Context)context;\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test steps for casts.\r
+\r
+ var d = new Digit(100); Label.Breakpoint("test_step_cast1");\r
+ byte byte_var = d; Label.Breakpoint("test_step_cast2");\r
+ Digit digit_var = (Digit)byte_var; Label.Breakpoint("test_step_cast3");\r
+ Console.WriteLine("Test steps for casts end."); Label.Breakpoint("test_step_cast_end");\r
+\r
+ Label.Checkpoint("test_step_cast", "test_step_breakpoint", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test steps with breakpoint in filtered methods.\r
+\r
+ var test_obj = new TestBreakpointInProperty(); Label.Breakpoint("test_break_property_1");\r
+ test_obj.Data = 5; Label.Breakpoint("test_break_property_2");\r
+ int i = test_obj.Data; Label.Breakpoint("test_break_property_3");\r
+ Console.WriteLine("Test steps with breakpoint end."); Label.Breakpoint("test_step_breakpoint_end");\r
+\r
+ Label.Checkpoint("test_step_breakpoint", "test_step_arguments", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_breakpoint_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test step-in into method arguments.\r
+\r
+ TestStepInArguments C = new TestStepInArguments(); Label.Breakpoint("test_step_arguments_1");\r
+ C.M3(C.P1, C.P2); Label.Breakpoint("test_step_arguments_2");\r
+ C.M4(C.M1(), C.M2(), C.M1()); Label.Breakpoint("test_step_arguments_3");\r
+ C.M3(C.M5(C.P1), C.M5(C.P1)); Label.Breakpoint("test_step_arguments_4");\r
+ C.M6(); Label.Breakpoint("test_step_arguments_5");\r
+ C.M3(C.M6(), C.M6()); Label.Breakpoint("test_step_arguments_6");\r
+ Console.WriteLine("Test steps for arguments end."); Label.Breakpoint("test_step_arguments_end");\r
+\r
+ Label.Checkpoint("test_step_arguments", "finish", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");\r
Context.StepOut(@"__FILE__:__LINE__");\r
});\r
\r
}\r
\r
[DebuggerStepThroughAttribute()]\r
- static void test_attr_func1()\r
+ static void test_attr_func1_1()\r
{\r
}\r
+ [DebuggerStepThroughAttribute()]\r
+ static int test_attr_func1_2()\r
+ {\r
+ return 5;\r
+ }\r
\r
[DebuggerNonUserCodeAttribute()]\r
- static void test_attr_func2()\r
- { Label.Breakpoint("test_attr_func2_in");\r
+ static void test_attr_func2_1()\r
+ { Label.Breakpoint("test_attr_func2_1_in");\r
+ }\r
+ [DebuggerNonUserCodeAttribute()]\r
+ static int test_attr_func2_2()\r
+ { Label.Breakpoint("test_attr_func2_2_in");\r
+ return 5;\r
}\r
\r
[DebuggerHiddenAttribute()]\r
- static void test_attr_func3()\r
+ static void test_attr_func3_1()\r
{\r
}\r
+ [DebuggerHiddenAttribute()]\r
+ static int test_attr_func3_2()\r
+ {\r
+ return 5;\r
+ }\r
\r
public static int test_property1\r
{\r
}
}
+ public class TestBreakpointInProperty
+ {
+ private int _value = 7;
+
+ private int AddOne(int data)
+ {
+ return data + 1; Label.Breakpoint("test_break_property_getter_1");
+ Label.Breakpoint("test_break_property_getter_2");}
+
+ public int Data
+ {
+ get
+ {
+ int tmp = AddOne(_value); Label.Breakpoint("test_break_property_getter_3");
+ return tmp; Label.Breakpoint("test_break_property_getter_4");
+ Label.Breakpoint("test_break_property_getter_5");}
+ set
+ {
+ _value = value; Label.Breakpoint("test_break_property_setter_1");
+ Label.Breakpoint("test_break_property_setter_2");}
+ }
+ }
+
+ class TestStepInArguments
+ {
+ public int P1 => 1;
+ public int P2 => 2;
+
+ public int M1()
+ { Label.Breakpoint("test_step_arguments_M1_1");
+ return 1; Label.Breakpoint("test_step_arguments_M1_2");
+ Label.Breakpoint("test_step_arguments_M1_3");}
+ public int M2()
+ { Label.Breakpoint("test_step_arguments_M2_1");
+ return 2; Label.Breakpoint("test_step_arguments_M2_2");
+ Label.Breakpoint("test_step_arguments_M2_3");}
+
+ public void M3(int a, int b)
+ { Label.Breakpoint("test_step_arguments_M3_1");
+ ; Label.Breakpoint("test_step_arguments_M3_2");
+ Label.Breakpoint("test_step_arguments_M3_3");}
+ public void M4(int a, int b, int c = 0, int d = 0)
+ { Label.Breakpoint("test_step_arguments_M4_1");
+ ; Label.Breakpoint("test_step_arguments_M4_2");
+ Label.Breakpoint("test_step_arguments_M4_3");}
+ public int M5(int k)
+ { Label.Breakpoint("test_step_arguments_M5_1");
+ return k + 1; Label.Breakpoint("test_step_arguments_M5_2");
+ Label.Breakpoint("test_step_arguments_M5_3");}
+
+ [DebuggerStepThrough]
+ public int M6()
+ {
+ return 1;
+ }
+ }
+
class Program
{
static void Main(string[] args)
Context.WasEntryPointHit(@"__FILE__:__LINE__");
Context.EnableBreakpoint(@"__FILE__:__LINE__", "inside_func1_1"); // check, that step-in and breakpoint at same line will generate only one event - step
Context.EnableBreakpoint(@"__FILE__:__LINE__", "inside_func2_1"); // check, that step-over and breakpoint inside method will generate breakpoint and reset step
+ Context.EnableBreakpoint(@"__FILE__:__LINE__", "test_break_property_getter_1");
+ Context.EnableBreakpoint(@"__FILE__:__LINE__", "test_break_property_setter_1");
Context.StepOver(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_over", "step_over_breakpoint", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func1");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "step_func2");
Context.StepOver(@"__FILE__:__LINE__");
});
// Test debugger attribute on methods with JMC enabled.
- test_attr_func1(); Label.Breakpoint("test_attr_func1");
- test_attr_func2(); Label.Breakpoint("test_attr_func2");
- test_attr_func3(); Label.Breakpoint("test_attr_func3");
+ test_attr_func1_1(); Label.Breakpoint("test_attr_func1_1");
+ test_attr_func1_2(); Label.Breakpoint("test_attr_func1_2");
+ test_attr_func2_1(); Label.Breakpoint("test_attr_func2_1");
+ test_attr_func2_2(); Label.Breakpoint("test_attr_func2_2");
+ test_attr_func3_1(); Label.Breakpoint("test_attr_func3_1");
+ test_attr_func3_2(); Label.Breakpoint("test_attr_func3_2");
Label.Checkpoint("test_attr1", "test_attr2", (Object context) => {
Context Context = (Context)context;
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1");
+ Context.WasStep(@"__FILE__:__LINE__", "step_func2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");
Context.StepIn(@"__FILE__:__LINE__");
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");
Context.StepIn(@"__FILE__:__LINE__");
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_2");
Context.StepIn(@"__FILE__:__LINE__");
});
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");
Context.StepOut(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");
Context.StepIn(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");
Context.StepOut(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_end");
Context.StepOver(@"__FILE__:__LINE__");
Digit digit_var = (Digit)byte_var; Label.Breakpoint("test_step_cast3");
Console.WriteLine("Test steps for casts end."); Label.Breakpoint("test_step_cast_end");
- Label.Checkpoint("test_step_cast", "finish", (Object context) => {
+ Label.Checkpoint("test_step_cast", "test_step_breakpoint", (Object context) => {
Context Context = (Context)context;
Context.WasStep(@"__FILE__:__LINE__", "test_step_cast1");
Context.StepOver(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_cast_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test steps with breakpoint in filtered methods.
+
+ var test_obj = new TestBreakpointInProperty(); Label.Breakpoint("test_break_property_1");
+ test_obj.Data = 5; Label.Breakpoint("test_break_property_2");
+ int i = test_obj.Data; Label.Breakpoint("test_break_property_3");
+ Console.WriteLine("Test steps with breakpoint end."); Label.Breakpoint("test_step_breakpoint_end");
+
+ Label.Checkpoint("test_step_breakpoint", "test_step_arguments", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "test_break_property_setter_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_setter_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "test_break_property_getter_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_breakpoint_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test step-in into method arguments.
+
+ TestStepInArguments C = new TestStepInArguments(); Label.Breakpoint("test_step_arguments_1");
+ C.M3(C.P1, C.P2); Label.Breakpoint("test_step_arguments_2");
+ C.M4(C.M1(), C.M2(), C.M1()); Label.Breakpoint("test_step_arguments_3");
+ C.M3(C.M5(C.P1), C.M5(C.P1)); Label.Breakpoint("test_step_arguments_4");
+ C.M6(); Label.Breakpoint("test_step_arguments_5");
+ C.M3(C.M6(), C.M6()); Label.Breakpoint("test_step_arguments_6");
+ Console.WriteLine("Test steps for arguments end."); Label.Breakpoint("test_step_arguments_end");
+
+ Label.Checkpoint("test_step_arguments", "finish", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");
Context.StepOut(@"__FILE__:__LINE__");
});
}
[DebuggerStepThroughAttribute()]
- static void test_attr_func1()
+ static void test_attr_func1_1()
{
}
+ [DebuggerStepThroughAttribute()]
+ static int test_attr_func1_2()
+ {
+ return 5;
+ }
[DebuggerNonUserCodeAttribute()]
- static void test_attr_func2()
+ static void test_attr_func2_1()
+ {
+ }
+ [DebuggerNonUserCodeAttribute()]
+ static int test_attr_func2_2()
{
+ return 5;
}
[DebuggerHiddenAttribute()]
- static void test_attr_func3()
+ static void test_attr_func3_1()
{
}
+ [DebuggerHiddenAttribute()]
+ static int test_attr_func3_2()
+ {
+ return 5;
+ }
public static int test_property1
{
Label.Checkpoint("step_out_func1_check", "step_in_func4", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func4");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func4_check", "step_in_func2", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func4");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func2");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func2_check", "step_in_func3_cycle1", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle1");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_out_func3_check_cycle1", "step_in_func3_cycle2", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle2");
Context.StepIn(@"__FILE__:__LINE__");
});
Label.Checkpoint("step_whenall", "test_attr1", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func3_cycle2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
Context.WasStep(@"__FILE__:__LINE__", "step_whenall_1");
Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "step_whenall_2");
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_attr_end");\r
\r
Context.AddBreakpoint(@"__FILE__:__LINE__", "test_async_void1");\r
\r
namespace VSCodeTestNoJMCNoFilterStepping\r
{\r
+ public readonly struct Digit\r
+ {\r
+ private readonly byte digit;\r
+\r
+ public Digit(byte digit)\r
+ {\r
+ this.digit = digit;\r
+ }\r
+ public static implicit operator byte(Digit d)\r
+ { Label.Breakpoint("test_op_implicit_1");\r
+ return d.digit; Label.Breakpoint("test_op_implicit_2");\r
+ Label.Breakpoint("test_op_implicit_3");}\r
+ public static explicit operator Digit(byte b)\r
+ { Label.Breakpoint("test_op_explicit_1");\r
+ return new Digit(b); Label.Breakpoint("test_op_explicit_2");\r
+ Label.Breakpoint("test_op_explicit_3");}\r
+ }\r
+\r
+ public class TestBreakpointInProperty\r
+ {\r
+ private int _value = 7;\r
+\r
+ private int AddOne(int data)\r
+ { Label.Breakpoint("test_break_property_getter_1");\r
+ return data + 1; Label.Breakpoint("test_break_property_getter_2");\r
+ Label.Breakpoint("test_break_property_getter_3");}\r
+\r
+ public int Data\r
+ {\r
+ [DebuggerStepThrough]\r
+ get\r
+ {\r
+ int tmp = AddOne(_value);\r
+ return tmp;\r
+ }\r
+ [DebuggerStepThrough]\r
+ set\r
+ {\r
+ _value = value;\r
+ }\r
+ }\r
+ }\r
+\r
+ class TestStepInArguments\r
+ {\r
+ public int P1\r
+ {\r
+ get\r
+ { Label.Breakpoint("test_step_arguments_P1_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_P1_2");\r
+ Label.Breakpoint("test_step_arguments_P1_3");}\r
+ }\r
+ public int P2\r
+ {\r
+ get\r
+ { Label.Breakpoint("test_step_arguments_P2_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_P2_2");\r
+ Label.Breakpoint("test_step_arguments_P2_3");}\r
+ }\r
+ \r
+ public int M1()\r
+ { Label.Breakpoint("test_step_arguments_M1_1");\r
+ return 1; Label.Breakpoint("test_step_arguments_M1_2");\r
+ Label.Breakpoint("test_step_arguments_M1_3");}\r
+ public int M2()\r
+ { Label.Breakpoint("test_step_arguments_M2_1");\r
+ return 2; Label.Breakpoint("test_step_arguments_M2_2");\r
+ Label.Breakpoint("test_step_arguments_M2_3");}\r
+\r
+ public void M3(int a, int b)\r
+ { Label.Breakpoint("test_step_arguments_M3_1");\r
+ ; Label.Breakpoint("test_step_arguments_M3_2");\r
+ Label.Breakpoint("test_step_arguments_M3_3");}\r
+ public void M4(int a, int b, int c = 0, int d = 0)\r
+ { Label.Breakpoint("test_step_arguments_M4_1");\r
+ ; Label.Breakpoint("test_step_arguments_M4_2");\r
+ Label.Breakpoint("test_step_arguments_M4_3");}\r
+ public int M5(int k)\r
+ { Label.Breakpoint("test_step_arguments_M5_1");\r
+ return k + 1; Label.Breakpoint("test_step_arguments_M5_2");\r
+ Label.Breakpoint("test_step_arguments_M5_3");}\r
+\r
+ [DebuggerStepThrough]\r
+ public int M6()\r
+ {\r
+ return 1;\r
+ }\r
+ }\r
+\r
class Program\r
{\r
static void Main(string[] args)\r
\r
// Test debugger attribute on methods with JMC disabled.\r
\r
- test_attr_func1(); Label.Breakpoint("test_attr_func1");\r
+ test_attr_func1_1(); Label.Breakpoint("test_attr_func1_1");\r
+ test_attr_func1_2(); Label.Breakpoint("test_attr_func1_2");\r
\r
Label.Checkpoint("test_attr1", "test_attr2", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
\r
- test_attr_func2(); Label.Breakpoint("test_attr_func2");\r
+ test_attr_func2_1(); Label.Breakpoint("test_attr_func2_1");\r
+ test_attr_func2_2(); Label.Breakpoint("test_attr_func2_2");\r
\r
Label.Checkpoint("test_attr2", "test_attr3", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_in");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1_in");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2_in");\r
+ Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
});\r
\r
- test_attr_func3(); Label.Breakpoint("test_attr_func3");\r
+ test_attr_func3_1(); Label.Breakpoint("test_attr_func3_1");\r
+ test_attr_func3_2(); Label.Breakpoint("test_attr_func3_2");\r
\r
Label.Checkpoint("test_attr3", "test_attr4", (Object context) => {\r
Context Context = (Context)context;\r
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
\r
\r
Label.Checkpoint("test_property_attr1", "test_property_attr2", (Object context) => {\r
Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_class2_func");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
Context.WasStep(@"__FILE__:__LINE__", "test_property1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
});\r
res = TestImplHolder.getImpl2().Calc1(); Label.Breakpoint("test_step_through2");\r
Console.WriteLine("Test step through end."); Label.Breakpoint("test_step_through_end");\r
\r
- Label.Checkpoint("test_step_through", "finish", (Object context) => {\r
+ Label.Checkpoint("test_step_through", "test_step_cast", (Object context) => {\r
Context Context = (Context)context;\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");\r
Context.StepOut(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test steps for casts.\r
+\r
+ var d = new Digit(100); Label.Breakpoint("test_step_cast1");\r
+ byte byte_var = d; Label.Breakpoint("test_step_cast2");\r
+ Digit digit_var = (Digit)byte_var; Label.Breakpoint("test_step_cast3");\r
+ Console.WriteLine("Test steps for casts end."); Label.Breakpoint("test_step_cast_end");\r
+\r
+ Label.Checkpoint("test_step_cast", "test_step_breakpoint", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_implicit_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_op_explicit_3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_cast_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test steps with breakpoint in filtered methods.\r
+\r
+ var test_obj = new TestBreakpointInProperty(); Label.Breakpoint("test_break_property_1");\r
+ test_obj.Data = 5; Label.Breakpoint("test_break_property_2");\r
+ int i = test_obj.Data; Label.Breakpoint("test_break_property_3");\r
+ Console.WriteLine("Test steps with breakpoint end."); Label.Breakpoint("test_step_breakpoint_end");\r
+\r
+ Label.Checkpoint("test_step_breakpoint", "test_step_arguments", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_breakpoint_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test step-in into method arguments.\r
+\r
+ TestStepInArguments C = new TestStepInArguments(); Label.Breakpoint("test_step_arguments_1");\r
+ C.M3(C.P1, C.P2); Label.Breakpoint("test_step_arguments_2");\r
+ C.M4(C.M1(), C.M2(), C.M1()); Label.Breakpoint("test_step_arguments_3");\r
+ C.M3(C.M5(C.P1), C.M5(C.P1)); Label.Breakpoint("test_step_arguments_4");\r
+ C.M6(); Label.Breakpoint("test_step_arguments_5");\r
+ C.M3(C.M6(), C.M6()); Label.Breakpoint("test_step_arguments_6");\r
+ Console.WriteLine("Test steps for arguments end."); Label.Breakpoint("test_step_arguments_end");\r
+\r
+ Label.Checkpoint("test_step_arguments", "finish", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P2_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_P1_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");\r
Context.StepOut(@"__FILE__:__LINE__");\r
});\r
\r
}\r
\r
[DebuggerStepThroughAttribute()]\r
- static void test_attr_func1()\r
+ static void test_attr_func1_1()\r
{\r
}\r
+ [DebuggerStepThroughAttribute()]\r
+ static int test_attr_func1_2()\r
+ {\r
+ return 5;\r
+ }\r
\r
[DebuggerNonUserCodeAttribute()]\r
- static void test_attr_func2()\r
- { Label.Breakpoint("test_attr_func2_in");\r
+ static void test_attr_func2_1()\r
+ { Label.Breakpoint("test_attr_func2_1_in");\r
+ }\r
+ [DebuggerNonUserCodeAttribute()]\r
+ static int test_attr_func2_2()\r
+ { Label.Breakpoint("test_attr_func2_2_in");\r
+ return 5;\r
}\r
\r
[DebuggerHiddenAttribute()]\r
- static void test_attr_func3()\r
+ static void test_attr_func3_1()\r
{\r
}\r
+ [DebuggerHiddenAttribute()]\r
+ static int test_attr_func3_2()\r
+ {\r
+ return 5;\r
+ }\r
\r
public static int test_property1\r
{\r
}
}
+ public class TestBreakpointInProperty
+ {
+ private int _value = 7;
+
+ private int AddOne(int data)
+ {
+ return data + 1; Label.Breakpoint("test_break_property_getter_1");
+ Label.Breakpoint("test_break_property_getter_2");}
+
+ public int Data
+ {
+ get
+ {
+ int tmp = AddOne(_value); Label.Breakpoint("test_break_property_getter_3");
+ return tmp; Label.Breakpoint("test_break_property_getter_4");
+ Label.Breakpoint("test_break_property_getter_5");}
+ set
+ {
+ _value = value; Label.Breakpoint("test_break_property_setter_1");
+ Label.Breakpoint("test_break_property_setter_2");}
+ }
+ }
+
+ class TestStepInArguments
+ {
+ public int P1 => 1;
+ public int P2 => 2;
+
+ public int M1()
+ { Label.Breakpoint("test_step_arguments_M1_1");
+ return 1; Label.Breakpoint("test_step_arguments_M1_2");
+ Label.Breakpoint("test_step_arguments_M1_3");}
+ public int M2()
+ { Label.Breakpoint("test_step_arguments_M2_1");
+ return 2; Label.Breakpoint("test_step_arguments_M2_2");
+ Label.Breakpoint("test_step_arguments_M2_3");}
+
+ public void M3(int a, int b)
+ { Label.Breakpoint("test_step_arguments_M3_1");
+ ; Label.Breakpoint("test_step_arguments_M3_2");
+ Label.Breakpoint("test_step_arguments_M3_3");}
+ public void M4(int a, int b, int c = 0, int d = 0)
+ { Label.Breakpoint("test_step_arguments_M4_1");
+ ; Label.Breakpoint("test_step_arguments_M4_2");
+ Label.Breakpoint("test_step_arguments_M4_3");}
+ public int M5(int k)
+ { Label.Breakpoint("test_step_arguments_M5_1");
+ return k + 1; Label.Breakpoint("test_step_arguments_M5_2");
+ Label.Breakpoint("test_step_arguments_M5_3");}
+
+ [DebuggerStepThrough]
+ public int M6()
+ {
+ return 1;
+ }
+ }
+
class Program
{
static void Main(string[] args)
Context.PrepareStart(@"__FILE__:__LINE__");
Context.AddBreakpoint(@"__FILE__:__LINE__", "inside_func1_1"); // check, that step-in and breakpoint at same line will generate only one event - step
Context.AddBreakpoint(@"__FILE__:__LINE__", "inside_func2_1"); // check, that step-over and breakpoint inside method will generate breakpoint and reset step
+ Context.AddBreakpoint(@"__FILE__:__LINE__", "test_break_property_getter_1");
+ Context.AddBreakpoint(@"__FILE__:__LINE__", "test_break_property_setter_1");
Context.SetBreakpoints(@"__FILE__:__LINE__");
Context.PrepareEnd(@"__FILE__:__LINE__");
Context.WasEntryPointHit(@"__FILE__:__LINE__");
Label.Checkpoint("step_over", "step_over_breakpoint", (Object context) => {
Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "step_func1");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "step_func2");
Context.StepOver(@"__FILE__:__LINE__");
});
// Test debugger attribute on methods with JMC enabled.
- test_attr_func1(); Label.Breakpoint("test_attr_func1");
- test_attr_func2(); Label.Breakpoint("test_attr_func2");
- test_attr_func3(); Label.Breakpoint("test_attr_func3");
+ test_attr_func1_1(); Label.Breakpoint("test_attr_func1_1");
+ test_attr_func1_2(); Label.Breakpoint("test_attr_func1_2");
+ test_attr_func2_1(); Label.Breakpoint("test_attr_func2_1");
+ test_attr_func2_2(); Label.Breakpoint("test_attr_func2_2");
+ test_attr_func3_1(); Label.Breakpoint("test_attr_func3_1");
+ test_attr_func3_2(); Label.Breakpoint("test_attr_func3_2");
Label.Checkpoint("test_attr1", "test_attr2", (Object context) => {
Context Context = (Context)context;
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1");
+ Context.WasStep(@"__FILE__:__LINE__", "step_func2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_1");
Context.StepIn(@"__FILE__:__LINE__");
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func2_2");
Context.StepIn(@"__FILE__:__LINE__");
- Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_attr_func3_2");
Context.StepIn(@"__FILE__:__LINE__");
});
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");
Context.StepOut(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through1");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");
Context.StepIn(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_Calc1");
Context.StepOut(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_through2");
+ Context.StepOver(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_through_end");
Context.StepOver(@"__FILE__:__LINE__");
Digit digit_var = (Digit)byte_var; Label.Breakpoint("test_step_cast3");
Console.WriteLine("Test steps for casts end."); Label.Breakpoint("test_step_cast_end");
- Label.Checkpoint("test_step_cast", "finish", (Object context) => {
+ Label.Checkpoint("test_step_cast", "test_step_breakpoint", (Object context) => {
Context Context = (Context)context;
Context.WasStep(@"__FILE__:__LINE__", "test_step_cast1");
Context.StepOver(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_cast_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test steps with breakpoint in filtered methods.
+
+ var test_obj = new TestBreakpointInProperty(); Label.Breakpoint("test_break_property_1");
+ test_obj.Data = 5; Label.Breakpoint("test_break_property_2");
+ int i = test_obj.Data; Label.Breakpoint("test_break_property_3");
+ Console.WriteLine("Test steps with breakpoint end."); Label.Breakpoint("test_step_breakpoint_end");
+
+ Label.Checkpoint("test_step_breakpoint", "test_step_arguments", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "test_break_property_setter_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_setter_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasBreakpointHit(@"__FILE__:__LINE__", "test_break_property_getter_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_getter_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_break_property_3");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_breakpoint_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test step-in into method arguments.
+
+ TestStepInArguments C = new TestStepInArguments(); Label.Breakpoint("test_step_arguments_1");
+ C.M3(C.P1, C.P2); Label.Breakpoint("test_step_arguments_2");
+ C.M4(C.M1(), C.M2(), C.M1()); Label.Breakpoint("test_step_arguments_3");
+ C.M3(C.M5(C.P1), C.M5(C.P1)); Label.Breakpoint("test_step_arguments_4");
+ C.M6(); Label.Breakpoint("test_step_arguments_5");
+ C.M3(C.M6(), C.M6()); Label.Breakpoint("test_step_arguments_6");
+ Console.WriteLine("Test steps for arguments end."); Label.Breakpoint("test_step_arguments_end");
+
+ Label.Checkpoint("test_step_arguments", "finish", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M2_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M1_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M4_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M5_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_M3_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");
Context.StepOut(@"__FILE__:__LINE__");
});
}
[DebuggerStepThroughAttribute()]
- static void test_attr_func1()
+ static void test_attr_func1_1()
{
}
+ [DebuggerStepThroughAttribute()]
+ static int test_attr_func1_2()
+ {
+ return 5;
+ }
[DebuggerNonUserCodeAttribute()]
- static void test_attr_func2()
+ static void test_attr_func2_1()
+ {
+ }
+ [DebuggerNonUserCodeAttribute()]
+ static int test_attr_func2_2()
{
+ return 5;
}
[DebuggerHiddenAttribute()]
- static void test_attr_func3()
+ static void test_attr_func3_1()
{
}
+ [DebuggerHiddenAttribute()]
+ static int test_attr_func3_2()
+ {
+ return 5;
+ }
public static int test_property1
{