Fix stack-list-frames output when frame 0 is not printed
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Sun, 16 Jul 2017 22:23:40 +0000 (01:23 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 13 Nov 2017 19:22:40 +0000 (22:22 +0300)
src/debug/netcoredbg/frames.cpp

index f9bc4cb..077f7b7 100644 (file)
@@ -194,6 +194,7 @@ HRESULT PrintFrames(ICorDebugThread *pThread, std::string &output, int lowFrame
     int currentFrame = -1;
 
     ss << "stack=[";
+    const char *sep = "";
 
     IfFailRet(WalkFrames(pThread, [&](
         FrameType frameType,
@@ -208,7 +209,8 @@ HRESULT PrintFrames(ICorDebugThread *pThread, std::string &output, int lowFrame
         if (currentFrame > highFrame)
             return S_OK; // Todo implement fast break mechanism
 
-        ss << (currentFrame != 0 ? "," : "");
+        ss << sep;
+        sep = ",";
 
         switch(frameType)
         {