From: Igor Kulaychuk Date: Wed, 12 Jul 2017 20:07:27 +0000 (+0300) Subject: Add low and high frame arguments to PrintFrames function X-Git-Tag: submit/tizen/20180620.071641~213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9936dd7c99bc05568846e316bdc0b28be0382530;p=sdk%2Ftools%2Fnetcoredbg.git Add low and high frame arguments to PrintFrames function --- diff --git a/src/debug/debugger/main.cpp b/src/debug/debugger/main.cpp index 6e638ad..944fc72 100644 --- a/src/debug/debugger/main.cpp +++ b/src/debug/debugger/main.cpp @@ -316,7 +316,7 @@ HRESULT RunStep(ICorDebugThread *pThread, StepType stepType) return S_OK; } -HRESULT PrintFrames(ICorDebugThread *pThread, std::string &output) +HRESULT PrintFrames(ICorDebugThread *pThread, std::string &output, int lowFrame = 0, int highFrame = INT_MAX) { HRESULT Status; std::stringstream ss; @@ -340,6 +340,11 @@ HRESULT PrintFrames(ICorDebugThread *pThread, std::string &output) IfFailRet(Status); + if (currentFrame < lowFrame) + continue; + if (currentFrame > highFrame) + break; + ToRelease pFrame; IfFailRet(pStackWalk->GetFrame(&pFrame)); if (Status == S_FALSE) @@ -1127,14 +1132,16 @@ int main(int argc, char *argv[]) } else if (command == "stack-list-frames") { - // TODO: Add parsing frame indeces and --thread + // TODO: Add parsing frame lowFrame, highFrame and --thread std::string output; ToRelease pThread; DWORD threadId = GetLastStoppedThreadId(); HRESULT hr = pProcess->GetThread(threadId, &pThread); + int lowFrame = 0; + int highFrame = INT_MAX; if (SUCCEEDED(hr)) { - hr = PrintFrames(pThread, output); + hr = PrintFrames(pThread, output, lowFrame, highFrame); } if (SUCCEEDED(hr)) {