- 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
- fix: compile error in linux
- fix: can't receive gdb async output for commands

View File

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

View File

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