From 41090dfa2c589fc49c9524e937c62fec3edf03d7 Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Mon, 17 Jul 2017 06:26:00 +0300 Subject: [PATCH] Enable printing ^running for step commands --- src/debug/netcoredbg/commands.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/debug/netcoredbg/commands.cpp b/src/debug/netcoredbg/commands.cpp index 9545454..303a2b6 100644 --- a/src/debug/netcoredbg/commands.cpp +++ b/src/debug/netcoredbg/commands.cpp @@ -201,7 +201,7 @@ static HRESULT RunStep(ICorDebugThread *pThread, StepType stepType) return S_OK; } -static HRESULT StepCommand(ICorDebugProcess *pProcess, const std::vector &args, std::string &, StepType stepType) +static HRESULT StepCommand(ICorDebugProcess *pProcess, const std::vector &args, std::string &output, StepType stepType) { HRESULT Status; ToRelease pThread; @@ -209,6 +209,7 @@ static HRESULT StepCommand(ICorDebugProcess *pProcess, const std::vectorGetThread(threadId, &pThread)); IfFailRet(RunStep(pThread, stepType)); IfFailRet(pProcess->Continue(0)); + output = "^running"; return S_OK; } @@ -526,8 +527,15 @@ void Debugger::CommandLoop() if (SUCCEEDED(hr)) { - const char *sep = output.empty() ? "" : ","; - out_printf("%s^done%s%s\n", token.c_str(), sep, output.c_str()); + const char *resultClass; + if (output.empty()) + resultClass = "^done"; + else if (output.at(0) == '^') + resultClass = ""; + else + resultClass = "^done,"; + + out_printf("%s%s%s\n", token.c_str(), resultClass, output.c_str()); } else { -- 2.7.4