From 7cc4e27184ed9b185c9a4a7155d5184cb3353e2b Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 8 Sep 2021 09:49:30 +0200 Subject: [PATCH] Debugger: Don't wait for responses for flushing dummy commands As this is also used after -exec-continue we won't see a result before the next stop and consequently run into the watchdog timeout regularly. Change-Id: Ibb7e42ae1810d4d9f536cf755219fba6d8aa0f96 Reviewed-by: Orgad Shaneh --- src/plugins/debugger/gdb/gdbengine.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8ce13d52f9f..84015bad81b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -784,8 +784,11 @@ void GdbEngine::runCommand(const DebuggerCommand &command) QMetaObject::invokeMethod(this, [this, buffer] { handleResponse(buffer); }); } else { m_gdbProc.write(cmd.function.toUtf8() + "\r\n"); - if (command.flags & NeedsFlush) - runCommand({"p 0"}); + if (command.flags & NeedsFlush) { + // We don't need the response or result here, just want to flush + // anything that's still on the gdb side. + m_gdbProc.write({"p 0\n"}); + } // Start Watchdog. if (m_commandTimer.interval() <= 20000) @@ -857,7 +860,7 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response) //qDebug() << "\nRESULT" << response->token << response->toString(); int token = response->token; - if (token == -1) + if (token <= 0) return; if (!m_commandForToken.contains(token)) {