[CLI] Fixed wrong command prompt location after the commands run, next, step and...
authorOleg Lekarev <o.lekarev@samsung.com>
Wed, 1 Dec 2021 14:42:18 +0000 (17:42 +0300)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Thu, 2 Dec 2021 17:00:22 +0000 (20:00 +0300)
src/protocols/cliprotocol.cpp
src/windows/iosystem_win32.cpp

index 9a0b6358526f94dc83c6d9c247cfcdb08f03664e..b6cea47586d916c1faf81eb25924e782687b84db 100644 (file)
@@ -688,6 +688,11 @@ HRESULT CLIProtocol::StepCommand(const std::vector<std::string> &args,
             HRESULT Status;
             IfFailRet(m_sharedDebugger->StepCommand(threadId, stepType));
             output = "^running";
+            {
+                lock_guard lock(m_mutex);
+                m_processStatus = Running;
+                m_state_cv.notify_all();
+            }
             return Status;
         }
 
index 4e1bdc272132fcb303cb397697cf457954f746c5..25bf7756aa319bae0fa0b12790f51d8ae51b541f 100644 (file)
@@ -359,7 +359,7 @@ Class::AsyncHandle Class::async_read(const FileHandle& fh, void *buf, size_t cou
         if (!val)
         {
             // nothing to read from the console -- defer call to ReadFile
-            result.buf = nullptr, result.count = 0;
+            result.buf = buf, result.count = count;
             return result;
         }
     }
@@ -423,8 +423,10 @@ bool Class::async_wait(IOSystem::AsyncHandleIterator begin, IOSystem::AsyncHandl
     }
 
     assert(n == count);
-    DWORD result = WaitForMultipleObjects(count, events, FALSE, DWORD(timeout.count()));
-    return result != WAIT_FAILED && result != WAIT_TIMEOUT;
+    DWORD result;
+    do result = WaitForMultipleObjects(count, events, FALSE, DWORD(timeout.count()));
+    while (result == WAIT_TIMEOUT);
+    return result != WAIT_FAILED;
 }
 
 Class::IOResult Class::async_cancel(AsyncHandle& h)