From: Igor Kulaychuk Date: Tue, 18 Jul 2017 11:35:55 +0000 (+0300) Subject: Fix steppers duplication when a breakpoint was hit during the step X-Git-Tag: submit/tizen/20180620.071641~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b9e555de3e8d6611aa2d50ddbb91ebe77380022;p=sdk%2Ftools%2Fnetcoredbg.git Fix steppers duplication when a breakpoint was hit during the step --- diff --git a/src/debug/netcoredbg/commands.cpp b/src/debug/netcoredbg/commands.cpp index 1d36e5f..20e4226 100644 --- a/src/debug/netcoredbg/commands.cpp +++ b/src/debug/netcoredbg/commands.cpp @@ -51,7 +51,6 @@ HRESULT PrintBreakpoint(ULONG32 id, std::string &output); // Debug events int GetLastStoppedThreadId(); void WaitProcessExited(); -HRESULT DisableAllBreakpointsAndSteppers(ICorDebugProcess *pProcess); static int ParseInt(const std::string &s, bool &ok) { diff --git a/src/debug/netcoredbg/main.cpp b/src/debug/netcoredbg/main.cpp index 196d80a..20513f1 100644 --- a/src/debug/netcoredbg/main.cpp +++ b/src/debug/netcoredbg/main.cpp @@ -164,6 +164,23 @@ std::string EscapeMIValue(const std::string &str) return s; } +static HRESULT DisableAllSteppersInAppDomain(ICorDebugAppDomain *pAppDomain) +{ + HRESULT Status; + ToRelease steppers; + IfFailRet(pAppDomain->EnumerateSteppers(&steppers)); + + ICorDebugStepper *curStepper; + ULONG steppersFetched; + while (SUCCEEDED(steppers->Next(1, &curStepper, &steppersFetched)) && steppersFetched == 1) + { + ToRelease pStepper(curStepper); + pStepper->Deactivate(); + } + + return S_OK; +} + static HRESULT DisableAllBreakpointsAndSteppersInAppDomain(ICorDebugAppDomain *pAppDomain) { HRESULT Status; @@ -183,17 +200,7 @@ static HRESULT DisableAllBreakpointsAndSteppersInAppDomain(ICorDebugAppDomain *p // FIXME: Delete all or Release all? DeleteAllBreakpoints(); - ToRelease steppers; - if (SUCCEEDED(pAppDomain->EnumerateSteppers(&steppers))) - { - ICorDebugStepper *curStepper; - ULONG steppersFetched; - while (SUCCEEDED(steppers->Next(1, &curStepper, &steppersFetched)) && steppersFetched == 1) - { - ToRelease pStepper(curStepper); - pStepper->Deactivate(); - } - } + DisableAllSteppersInAppDomain(pAppDomain); return S_OK; } @@ -345,6 +352,9 @@ public: SetLastStoppedThread(pThread); + // If we do not ignore the breakpoint then remove any active steppers - we'll create a new one when needed + DisableAllSteppersInAppDomain(pAppDomain); + return S_OK; }