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;
IfFailRet(Status);
+ if (currentFrame < lowFrame)
+ continue;
+ if (currentFrame > highFrame)
+ break;
+
ToRelease<ICorDebugFrame> pFrame;
IfFailRet(pStackWalk->GetFrame(&pFrame));
if (Status == S_FALSE)
}
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<ICorDebugThread> 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))
{