From 2d4d83bd466a21159b52b21513d86357fc9a2577 Mon Sep 17 00:00:00 2001 From: Zihan Chen Date: Fri, 31 Jul 2020 18:41:40 -0700 Subject: [PATCH] ... --- Tutorial/Console_Workflow/W06_Debugging/Main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Tutorial/Console_Workflow/W06_Debugging/Main.cpp b/Tutorial/Console_Workflow/W06_Debugging/Main.cpp index 4186491e..8e185553 100644 --- a/Tutorial/Console_Workflow/W06_Debugging/Main.cpp +++ b/Tutorial/Console_Workflow/W06_Debugging/Main.cpp @@ -89,12 +89,13 @@ func main(): void class MyDebugger : public WfDebugger { protected: - void OnBlockExecution() + void OnBlockExecution()override { // get the context for the current thread auto context = GetCurrentThreadContext(); - // whatever the input is, change the "name" variable + // whatever the input is, change the "name" variable to be "MyDebugger" + // it will print "Hello, MyDebugger!" after continuing auto assembly = context->globalContext->assembly; vint functionIndex = context->GetCurrentStackFrame().functionIndex; auto functionMetadata = assembly->functions[functionIndex]; @@ -131,14 +132,14 @@ int main() initializeFunction(); // start debugging - auto debugger = MakePtr(); + auto debugger = MakePtr(); SetDebuggerForCurrentThread(debugger); // break at App::Print(...); // it is in file 0 row 9 debugger->AddCodeLineBreakPoint(assembly.Obj(), 0, 9, true); - // call main + // call main, will trap into MyDebugger::OnBlockExecution when hitting the break point auto mainFunction = LoadFunction(globalContext, L"main"); mainFunction();