- fix: heartbeat for gdb server async command shouldn't disable actions

This commit is contained in:
Roy Qu 2022-01-01 09:17:12 +08:00
parent f4db7fcad0
commit 2319034be4
3 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,6 @@
Red Panda C++ Version 0.12.6
- fix: heartbeat for gdb server async command shouldn't disable actions
Red Panda C++ Version 0.12.5 Red Panda C++ Version 0.12.5
- fix: compile error in linux - fix: compile error in linux
- fix: can't receive gdb async output for commands - fix: can't receive gdb async output for commands

View File

@ -930,23 +930,25 @@ void DebugReader::runNextCmd()
{ {
QMutexLocker locker(&mCmdQueueMutex); QMutexLocker locker(&mCmdQueueMutex);
PDebugCommand lastCmd = mCurrentCmd;
if (mCurrentCmd) { if (mCurrentCmd) {
DebugCommandSource commandSource = mCurrentCmd->source;
mCurrentCmd=nullptr; mCurrentCmd=nullptr;
emit cmdFinished(); if (commandSource!=DebugCommandSource::HeartBeat)
emit cmdFinished();
} }
if (mCmdQueue.isEmpty()) { if (mCmdQueue.isEmpty()) {
if (pSettings->debugger().useGDBServer() && mInferiorRunning && !mAsyncUpdated) { if (pSettings->debugger().useGDBServer() && mInferiorRunning && !mAsyncUpdated) {
mAsyncUpdated = true; mAsyncUpdated = true;
QTimer::singleShot(1000,this,&DebugReader::asyncUpdate); QTimer::singleShot(50,this,&DebugReader::asyncUpdate);
} }
return; return;
} }
PDebugCommand pCmd = mCmdQueue.dequeue(); PDebugCommand pCmd = mCmdQueue.dequeue();
mCmdRunning = true; mCmdRunning = true;
mCurrentCmd = pCmd; mCurrentCmd = pCmd;
emit cmdStarted(); if (pCmd->source!=DebugCommandSource::HeartBeat)
emit cmdStarted();
QByteArray s; QByteArray s;
QByteArray params; QByteArray params;
@ -1241,7 +1243,7 @@ void DebugReader::asyncUpdate()
{ {
QMutexLocker locker(&mCmdQueueMutex); QMutexLocker locker(&mCmdQueueMutex);
if (mCmdQueue.isEmpty()) if (mCmdQueue.isEmpty())
postCommand("-var-update"," --all-values *",DebugCommandSource::Other); postCommand("-var-update"," --all-values *",DebugCommandSource::HeartBeat);
mAsyncUpdated = false; mAsyncUpdated = false;
} }

View File

@ -34,6 +34,7 @@
enum class DebugCommandSource { enum class DebugCommandSource {
Console, Console,
HeartBeat,
Other Other
}; };