* Fix stepping for `using` statement.
* Fix stepping for `finally` block.
* Fix stack trace for `finally` block.
Related to https://github.com/Samsung/netcoredbg/issues/154
ULONG32 ilOffset;\r
CorDebugMappingResult mappingResult;\r
IfFailRet(pILFrame->GetIP(&ilOffset, &mappingResult));\r
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||\r
+ mappingResult == MAPPING_NO_INFO)\r
+ return E_FAIL;\r
\r
fullyQualifiedIlOffset.modAddress = modAddress;\r
fullyQualifiedIlOffset.methodToken = methodToken;\r
return Status;
#endif // INTEROP_DEBUGGING
+ ToRelease<ICorDebugILFrame> pILFrame;
+ IfFailRet(iCorFrame->QueryInterface(IID_ICorDebugILFrame, (LPVOID*) &pILFrame));
+
+ ULONG32 nOffset;
+ CorDebugMappingResult mappingResult;
+ IfFailRet(pILFrame->GetIP(&nOffset, &mappingResult));
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||
+ mappingResult == MAPPING_NO_INFO)
+ continue;
+
IfFailRet(cb(FrameCLRManaged, GetIP(¤tCtx), iCorFrame, nullptr));
continue;
}
ULONG32 ipOffset;\r
CorDebugMappingResult mappingResult;\r
IfFailRet(pILFrame->GetIP(&ipOffset, &mappingResult));\r
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||\r
+ mappingResult == MAPPING_NO_INFO)\r
+ return E_FAIL;\r
\r
// If we are at end of async method with await blocks and doing step-in or step-over,\r
// switch to step-out, so whole NotifyDebuggerOfWaitCompletion magic happens.\r
ULONG32 ipOffset;\r
CorDebugMappingResult mappingResult;\r
if (FAILED(pFrame->QueryInterface(IID_ICorDebugILFrame, (LPVOID*) &pILFrame)) ||\r
- FAILED(pILFrame->GetIP(&ipOffset, &mappingResult)))\r
+ FAILED(pILFrame->GetIP(&ipOffset, &mappingResult)) ||\r
+ mappingResult == MAPPING_UNMAPPED_ADDRESS ||\r
+ mappingResult == MAPPING_NO_INFO)\r
{\r
LOGE("Failed receive current IP offset for async step");\r
return S_FALSE;\r
{\r
HRESULT Status;\r
m_filteredPrevStep = false;\r
+ m_initialStepType = stepType;\r
\r
ToRelease<ICorDebugProcess> pProcess;\r
IfFailRet(pThread->GetProcess(&pProcess));\r
DisableAllSteppers(pProcess);\r
\r
+ ToRelease<ICorDebugFrame> pFrame;\r
+ IfFailRet(pThread->GetActiveFrame(&pFrame));\r
+ if (pFrame == nullptr)\r
+ return E_FAIL;\r
+\r
+ ULONG32 ilOffset;\r
+ IfFailRet(m_sharedModules->GetFrameILAndSequencePoint(pFrame, ilOffset, m_StepStartSP));\r
+\r
IfFailRet(m_asyncStepper->SetupStep(pThread, stepType));\r
if (Status == S_OK) // S_FALSE = setup simple stepper\r
return S_OK;\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
+ if (reason == CorDebugStepReason::STEP_NORMAL)\r
+ {\r
+ if (ipOffset != ilNextUserCodeOffset)\r
+ {\r
+ // Step completed on some compiler generated (not user) code inside user code (for example, `finally` block related code)\r
+ IfFailRet(m_simpleStepper->SetupStep(pThread, m_initialStepType));\r
+ return S_OK;\r
+ }\r
+ else\r
+ {\r
+ // Step completed on same location in source as it was started, this happens when some user code block have several\r
+ // SequencePoints for same line (for example, `using` related code could mix user/compiler generated code for same line).\r
+ ULONG32 ilOffset;\r
+ Modules::SequencePoint sp;\r
+ IfFailRet(m_sharedModules->GetFrameILAndSequencePoint(iCorFrame, ilOffset, sp));\r
+ if (sp.startLine == m_StepStartSP.startLine &&\r
+ sp.startColumn == m_StepStartSP.startColumn &&\r
+ sp.endLine == m_StepStartSP.endLine &&\r
+ sp.endColumn == m_StepStartSP.endColumn &&\r
+ sp.document == m_StepStartSP.document)\r
+ {\r
+ IfFailRet(m_simpleStepper->SetupStep(pThread, m_initialStepType));\r
+ return S_OK;\r
+ }\r
+ }\r
+ }\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
+ else if (reason == CorDebugStepReason::STEP_CALL && ipOffset < ilNextUserCodeOffset)\r
{\r
IfFailRet(m_simpleStepper->SetupStep(pThread, IDebugger::StepType::STEP_OVER));\r
return S_OK;\r
}\r
else if (noUserCodeFound)\r
{\r
- IfFailRet(m_simpleStepper->SetupStep(pThread, IDebugger::StepType::STEP_IN));\r
+ IfFailRet(m_simpleStepper->SetupStep(pThread, m_initialStepType));\r
// In case step-in will return from method and no user code was called in user module, step-in again.\r
m_filteredPrevStep = true;\r
return S_OK;\r
m_simpleStepper(new SimpleStepper(sharedModules)),\r
m_asyncStepper(new AsyncStepper(m_simpleStepper, sharedModules, sharedEvalHelpers)),\r
m_sharedModules(sharedModules),\r
+ m_initialStepType(IDebugger::StepType::STEP_OVER),\r
m_justMyCode(true),\r
m_stepFiltering(true),\r
m_filteredPrevStep(false)\r
std::shared_ptr<SimpleStepper> m_simpleStepper;\r
std::unique_ptr<AsyncStepper> m_asyncStepper;\r
std::shared_ptr<Modules> m_sharedModules;\r
+ IDebugger::StepType m_initialStepType;\r
+ Modules::SequencePoint m_StepStartSP;\r
bool m_justMyCode;\r
// https://docs.microsoft.com/en-us/visualstudio/debugger/navigating-through-code-with-the-debugger?view=vs-2019#BKMK_Step_into_properties_and_operators_in_managed_code\r
// The debugger steps over properties and operators in managed code by default. In most cases, this provides a better debugging experience.\r
CorDebugMappingResult mappingResult;
IfFailRet(pILFrame->GetIP(&ilOffset, &mappingResult));
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||
+ mappingResult == MAPPING_NO_INFO)
+ return E_FAIL;
ToRelease<ICorDebugModule> pModule;
IfFailRet(pFunc->GetModule(&pModule));
CorDebugMappingResult mappingResult;
IfFailRet(pILFrame->GetIP(&ilOffset, &mappingResult));
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||
+ mappingResult == MAPPING_NO_INFO)
+ return E_FAIL;
ToRelease<ICorDebugModule> pModule;
IfFailRet(pFunc->GetModule(&pModule));
ULONG32 nOffset;
CorDebugMappingResult mappingResult;
IfFailRet(pILFrame->GetIP(&nOffset, &mappingResult));
+ if (mappingResult == MAPPING_UNMAPPED_ADDRESS ||
+ mappingResult == MAPPING_NO_INFO)
+ return E_FAIL;
CORDB_ADDRESS modAddress;
IfFailRet(pModule->GetBaseAddress(&modAddress));
}\r
}\r
\r
+ class TestStepWithCompilerGenCode : IDisposable\r
+ {\r
+ public void Dispose()\r
+ { Label.Breakpoint("test_step_comp_Dispose_1");\r
+ ; Label.Breakpoint("test_step_comp_Dispose_2");\r
+ Label.Breakpoint("test_step_comp_Dispose_3");}\r
+\r
+ public static void M()\r
+ { Label.Breakpoint("test_step_comp_M_1");\r
+ Label.Breakpoint("test_step_comp_M_2");using (var c = new TestStepWithCompilerGenCode())\r
+ { Label.Breakpoint("test_step_comp_M_3");\r
+ ; Label.Breakpoint("test_step_comp_M_4");\r
+ Label.Breakpoint("test_step_comp_M_5");}\r
+ using var c2 = new TestStepWithCompilerGenCode(); Label.Breakpoint("test_step_comp_M_6");\r
+ try\r
+ { Label.Breakpoint("test_step_comp_M_7");\r
+ ; Label.Breakpoint("test_step_comp_M_8");\r
+ Label.Breakpoint("test_step_comp_M_9");}\r
+ finally\r
+ { Label.Breakpoint("test_step_comp_M_10");\r
+ ; Label.Breakpoint("test_step_comp_M_11");\r
+ Label.Breakpoint("test_step_comp_M_12");}\r
+ Label.Breakpoint("test_step_comp_M_13");}\r
+ }\r
+\r
class Program\r
{\r
static void Main(string[] args)\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
+ Label.Checkpoint("test_step_arguments", "test_step_comp", (Object context) => {\r
Context Context = (Context)context;\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");\r
Context.StepOver(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test step-in/step-over for compiler generated code inside user code.\r
+\r
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_1");\r
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_2");\r
+ Console.WriteLine("Test steps end."); Label.Breakpoint("test_step_comp_end");\r
+\r
+ Label.Checkpoint("test_step_comp", "finish", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_end");\r
Context.StepOut(@"__FILE__:__LINE__");\r
});\r
\r
}
}
+ class TestStepWithCompilerGenCode : IDisposable
+ {
+ public void Dispose()
+ { Label.Breakpoint("test_step_comp_Dispose_1");
+ ; Label.Breakpoint("test_step_comp_Dispose_2");
+ Label.Breakpoint("test_step_comp_Dispose_3");}
+
+ public static void M()
+ { Label.Breakpoint("test_step_comp_M_1");
+ Label.Breakpoint("test_step_comp_M_2");using (var c = new TestStepWithCompilerGenCode())
+ { Label.Breakpoint("test_step_comp_M_3");
+ ; Label.Breakpoint("test_step_comp_M_4");
+ Label.Breakpoint("test_step_comp_M_5");}
+ using var c2 = new TestStepWithCompilerGenCode(); Label.Breakpoint("test_step_comp_M_6");
+ try
+ { Label.Breakpoint("test_step_comp_M_7");
+ ; Label.Breakpoint("test_step_comp_M_8");
+ Label.Breakpoint("test_step_comp_M_9");}
+ finally
+ { Label.Breakpoint("test_step_comp_M_10");
+ ; Label.Breakpoint("test_step_comp_M_11");
+ Label.Breakpoint("test_step_comp_M_12");}
+ Label.Breakpoint("test_step_comp_M_13");}
+ }
+
class Program
{
static void Main(string[] args)
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) => {
+ Label.Checkpoint("test_step_arguments", "test_step_comp", (Object context) => {
Context Context = (Context)context;
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");
Context.StepOver(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test step-in/step-over for compiler generated code inside user code.
+
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_1");
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_2");
+ Console.WriteLine("Test steps end."); Label.Breakpoint("test_step_comp_end");
+
+ Label.Checkpoint("test_step_comp", "finish", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_end");
Context.StepOut(@"__FILE__:__LINE__");
});
}\r
}\r
\r
+ class TestStepWithCompilerGenCode : IDisposable\r
+ {\r
+ public void Dispose()\r
+ { Label.Breakpoint("test_step_comp_Dispose_1");\r
+ ; Label.Breakpoint("test_step_comp_Dispose_2");\r
+ Label.Breakpoint("test_step_comp_Dispose_3");}\r
+\r
+ public static void M()\r
+ { Label.Breakpoint("test_step_comp_M_1");\r
+ Label.Breakpoint("test_step_comp_M_2");using (var c = new TestStepWithCompilerGenCode())\r
+ { Label.Breakpoint("test_step_comp_M_3");\r
+ ; Label.Breakpoint("test_step_comp_M_4");\r
+ Label.Breakpoint("test_step_comp_M_5");}\r
+ using var c2 = new TestStepWithCompilerGenCode(); Label.Breakpoint("test_step_comp_M_6");\r
+ try\r
+ { Label.Breakpoint("test_step_comp_M_7");\r
+ ; Label.Breakpoint("test_step_comp_M_8");\r
+ Label.Breakpoint("test_step_comp_M_9");}\r
+ finally\r
+ { Label.Breakpoint("test_step_comp_M_10");\r
+ ; Label.Breakpoint("test_step_comp_M_11");\r
+ Label.Breakpoint("test_step_comp_M_12");}\r
+ Label.Breakpoint("test_step_comp_M_13");}\r
+ }\r
+\r
class Program\r
{\r
static void Main(string[] args)\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
+ Label.Checkpoint("test_step_arguments", "test_step_comp", (Object context) => {\r
Context Context = (Context)context;\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");\r
Context.StepOver(@"__FILE__:__LINE__");\r
Context.StepIn(@"__FILE__:__LINE__");\r
\r
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ });\r
+\r
+ // Test step-in/step-over for compiler generated code inside user code.\r
+\r
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_1");\r
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_2");\r
+ Console.WriteLine("Test steps end."); Label.Breakpoint("test_step_comp_end");\r
+\r
+ Label.Checkpoint("test_step_comp", "finish", (Object context) => {\r
+ Context Context = (Context)context;\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");\r
+ Context.StepIn(@"__FILE__:__LINE__");\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");\r
+ Context.StepOver(@"__FILE__:__LINE__");\r
+\r
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_end");\r
Context.StepOut(@"__FILE__:__LINE__");\r
});\r
\r
}
}
+ class TestStepWithCompilerGenCode : IDisposable
+ {
+ public void Dispose()
+ { Label.Breakpoint("test_step_comp_Dispose_1");
+ ; Label.Breakpoint("test_step_comp_Dispose_2");
+ Label.Breakpoint("test_step_comp_Dispose_3");}
+
+ public static void M()
+ { Label.Breakpoint("test_step_comp_M_1");
+ Label.Breakpoint("test_step_comp_M_2");using (var c = new TestStepWithCompilerGenCode())
+ { Label.Breakpoint("test_step_comp_M_3");
+ ; Label.Breakpoint("test_step_comp_M_4");
+ Label.Breakpoint("test_step_comp_M_5");}
+ using var c2 = new TestStepWithCompilerGenCode(); Label.Breakpoint("test_step_comp_M_6");
+ try
+ { Label.Breakpoint("test_step_comp_M_7");
+ ; Label.Breakpoint("test_step_comp_M_8");
+ Label.Breakpoint("test_step_comp_M_9");}
+ finally
+ { Label.Breakpoint("test_step_comp_M_10");
+ ; Label.Breakpoint("test_step_comp_M_11");
+ Label.Breakpoint("test_step_comp_M_12");}
+ Label.Breakpoint("test_step_comp_M_13");}
+ }
+
class Program
{
static void Main(string[] args)
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) => {
+ Label.Checkpoint("test_step_arguments", "test_step_comp", (Object context) => {
Context Context = (Context)context;
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_1");
Context.StepOver(@"__FILE__:__LINE__");
Context.StepIn(@"__FILE__:__LINE__");
Context.WasStep(@"__FILE__:__LINE__", "test_step_arguments_end");
+ Context.StepOver(@"__FILE__:__LINE__");
+ });
+
+ // Test step-in/step-over for compiler generated code inside user code.
+
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_1");
+ TestStepWithCompilerGenCode.M(); Label.Breakpoint("test_step_comp_2");
+ Console.WriteLine("Test steps end."); Label.Breakpoint("test_step_comp_end");
+
+ Label.Checkpoint("test_step_comp", "finish", (Object context) => {
+ Context Context = (Context)context;
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepOver(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_1");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_4");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_5");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_6");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_7");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_8");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_9");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_10");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_11");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_12");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_1");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_2");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_Dispose_3");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_M_13");
+ Context.StepIn(@"__FILE__:__LINE__");
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_2");
+ Context.StepOver(@"__FILE__:__LINE__");
+
+ Context.WasStep(@"__FILE__:__LINE__", "test_step_comp_end");
Context.StepOut(@"__FILE__:__LINE__");
});