From 139a6d14c01de31e065071938bc7bb34fc0c8071 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 8 Mar 2023 18:31:47 +0800 Subject: [PATCH] - fix: Cpu info window is auto openned, when debug using gdb-server. --- RedPandaIDE/debugger.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index c2b56c13..afed0b89 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -1198,9 +1198,13 @@ void DebugReader::processExecAsyncRecord(const QByteArray &line) } } runInferiorStoppedHook(); - if (reason.isEmpty() && mCurrentFunc == "_start" && mCurrentFile.isEmpty()) { - //gdb-server connected, just ignore it - return; + if (reason.isEmpty()) { + QMutexLocker locker(&mCmdQueueMutex); + foreach (const PDebugCommand& cmd, mCmdQueue) { + //gdb-server connected, just ignore it + if (cmd->command=="-exec-continue") + return; + } } if (mCurrentCmd && mCurrentCmd->source == DebugCommandSource::Console) emit inferiorStopped(mCurrentFile, mCurrentLine, false); @@ -1303,6 +1307,7 @@ void DebugReader::processDebugOutput(const QByteArray& debugOutput) void DebugReader::runInferiorStoppedHook() { + QMutexLocker locker(&mCmdQueueMutex); foreach (const PDebugCommand& cmd, mInferiorStoppedHookCommands) { mCmdQueue.push_front(cmd); }