From 26331f771a48f8123d2106b5e3c9ecf95a24a32e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Dec 2016 09:59:49 +0100 Subject: [PATCH] Debugger: Avoid messagesboxes on the same topic at the same time Task-number: QTCREATORBUG-16971 Change-Id: I625f04cbd8f609c66597450dbad22ebc6eadcfe5 Reviewed-by: Eike Ziller --- src/plugins/debugger/debuggerengine.cpp | 10 ++++++++-- src/plugins/debugger/debuggerengine.h | 2 +- src/plugins/debugger/gdb/gdbengine.cpp | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 49c2f0633a7..efa4b9ec3a2 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -383,6 +383,7 @@ public: // Safety net to avoid infinite lookups. QSet m_lookupRequests; // FIXME: Integrate properly. + QPointer m_alertBox; }; @@ -1813,8 +1814,11 @@ QString DebuggerEngine::msgInterrupted() return tr("Interrupted."); } -void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) +bool DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) { + if (d->m_alertBox) + return false; + if (name.isEmpty()) name = ' ' + tr("", "name") + ' '; if (meaning.isEmpty()) @@ -1824,7 +1828,9 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name "" "
Signal name : %1
Signal meaning : %2
") .arg(name, meaning); - AsynchronousMessageBox::information(tr("Signal Received"), msg); + + d->m_alertBox = AsynchronousMessageBox::information(tr("Signal Received"), msg); + return true; } void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 770d079c445..82f372969cd 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -415,7 +415,7 @@ protected: static QString msgStoppedByException(const QString &description, const QString &threadId); static QString msgInterrupted(); - void showStoppedBySignalMessageBox(const QString meaning, QString name); + bool showStoppedBySignalMessageBox(const QString meaning, QString name); void showStoppedByExceptionMessageBox(const QString &description); bool isStateDebugging() const; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2e750e14ff3..c2667984969 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1629,7 +1629,10 @@ void GdbEngine::handleStop2(const GdbMi &data) } else { showMessage("HANDLING SIGNAL " + name); if (boolSetting(UseMessageBoxForSignals) && !isStopperThread) - showStoppedBySignalMessageBox(meaning, name); + if (!showStoppedBySignalMessageBox(meaning, name)) { + showMessage("SIGNAL RECEIVED WHILE SHOWING SIGNAL MESSAGE"); + return; + } if (!name.isEmpty() && !meaning.isEmpty()) reasontr = msgStoppedBySignal(meaning, name); }