Commit 2ee9a06f authored by Marco Bubke's avatar Marco Bubke Committed by hjk

Debugger: Use Core::AsynchronousMessageBox

Nested event loops can lead to crashes, so it is better to use a dialog
which does not have have its own event loop.

Change-Id: Icd2390c9026bc1ef88e72a570df5813fe5cbdaa2
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7e8db09c
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QMessageBox>
#include <QMenu> #include <QMenu>
#include <QSpinBox> #include <QSpinBox>
#include <QTextEdit> #include <QTextEdit>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <debugger/shared/hostutils.h> #include <debugger/shared/hostutils.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
...@@ -72,7 +73,6 @@ ...@@ -72,7 +73,6 @@
#include <cpptools/cppworkingcopy.h> #include <cpptools/cppworkingcopy.h>
#include <QDir> #include <QDir>
#include <QMessageBox>
#include <cctype> #include <cctype>
...@@ -534,7 +534,7 @@ void CdbEngine::consoleStubError(const QString &msg) ...@@ -534,7 +534,7 @@ void CdbEngine::consoleStubError(const QString &msg)
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineIll") STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineIll")
notifyEngineIll(); notifyEngineIll();
} }
showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); Core::AsynchronousMessageBox::critical(tr("Debugger Error"), msg);
} }
void CdbEngine::consoleStubProcessStarted() void CdbEngine::consoleStubProcessStarted()
...@@ -552,7 +552,7 @@ void CdbEngine::consoleStubProcessStarted() ...@@ -552,7 +552,7 @@ void CdbEngine::consoleStubProcessStarted()
QString errorMessage; QString errorMessage;
if (!launchCDB(attachParameters, &errorMessage)) { if (!launchCDB(attachParameters, &errorMessage)) {
showMessage(errorMessage, LogError); showMessage(errorMessage, LogError);
showMessageBox(QMessageBox::Critical, tr("Failed to Start the Debugger"), errorMessage); Core::AsynchronousMessageBox::critical(tr("Failed to Start the Debugger"), errorMessage);
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed") STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed")
notifyEngineSetupFailed(); notifyEngineSetupFailed();
} }
...@@ -599,7 +599,7 @@ void CdbEngine::setupEngine() ...@@ -599,7 +599,7 @@ void CdbEngine::setupEngine()
qDebug("<setupEngine ok=%d", ok); qDebug("<setupEngine ok=%d", ok);
if (!ok) { if (!ok) {
showMessage(errorMessage, LogError); showMessage(errorMessage, LogError);
showMessageBox(QMessageBox::Critical, tr("Failed to Start the Debugger"), errorMessage); Core::AsynchronousMessageBox::critical(tr("Failed to Start the Debugger"), errorMessage);
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed") STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed")
notifyEngineSetupFailed(); notifyEngineSetupFailed();
} }
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/futureprogress.h>
...@@ -72,8 +73,6 @@ ...@@ -72,8 +73,6 @@
#include <QFileInfo> #include <QFileInfo>
#include <QDir> #include <QDir>
#include <QMessageBox>
using namespace Core; using namespace Core;
using namespace Debugger::Internal; using namespace Debugger::Internal;
using namespace ProjectExplorer; using namespace ProjectExplorer;
...@@ -1733,7 +1732,7 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name ...@@ -1733,7 +1732,7 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name
"<table><tr><td>Signal name : </td><td>%1</td></tr>" "<table><tr><td>Signal name : </td><td>%1</td></tr>"
"<tr><td>Signal meaning : </td><td>%2</td></tr></table>") "<tr><td>Signal meaning : </td><td>%2</td></tr></table>")
.arg(name, meaning); .arg(name, meaning);
showMessageBox(QMessageBox::Information, tr("Signal received"), msg); Core::AsynchronousMessageBox::information(tr("Signal received"), msg);
} }
void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description) void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description)
...@@ -1741,7 +1740,7 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description ...@@ -1741,7 +1740,7 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description
const QString msg = const QString msg =
tr("<p>The inferior stopped because it triggered an exception.<p>%1"). tr("<p>The inferior stopped because it triggered an exception.<p>%1").
arg(description); arg(description);
showMessageBox(QMessageBox::Information, tr("Exception Triggered"), msg); Core::AsynchronousMessageBox::information(tr("Exception Triggered"), msg);
} }
void DebuggerEngine::openMemoryView(quint64 startAddr, unsigned flags, void DebuggerEngine::openMemoryView(quint64 startAddr, unsigned flags,
...@@ -1897,7 +1896,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp) ...@@ -1897,7 +1896,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
return; return;
} }
if (warnOnRelease) { if (warnOnRelease) {
showMessageBox(QMessageBox::Information, tr("Warning"), Core::AsynchronousMessageBox::information(tr("Warning"),
tr("This does not seem to be a \"Debug\" build.\n" tr("This does not seem to be a \"Debug\" build.\n"
"Setting breakpoints by file name and line number may fail.") "Setting breakpoints by file name and line number may fail.")
+ QLatin1Char('\n') + detailedWarning); + QLatin1Char('\n') + detailedWarning);
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QDebug; class QDebug;
class QPoint; class QPoint;
class QMessageBox;
class QAbstractItemModel; class QAbstractItemModel;
QT_END_NAMESPACE QT_END_NAMESPACE
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
#include <coreplugin/imode.h> #include <coreplugin/imode.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h>
#include <coreplugin/modemanager.h> #include <coreplugin/modemanager.h>
...@@ -1589,8 +1590,8 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, ...@@ -1589,8 +1590,8 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
IDevice::ConstPtr device = DeviceKitInformation::device(kit); IDevice::ConstPtr device = DeviceKitInformation::device(kit);
QTC_ASSERT(device, return 0); QTC_ASSERT(device, return 0);
if (process.pid == 0) { if (process.pid == 0) {
QMessageBox::warning(ICore::dialogParent(), tr("Warning"), Core::AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot attach to process with PID 0")); tr("Cannot attach to process with PID 0"));
return 0; return 0;
} }
...@@ -1598,14 +1599,14 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, ...@@ -1598,14 +1599,14 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit)) if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit))
isWindows = tc->targetAbi().os() == Abi::WindowsOS; isWindows = tc->targetAbi().os() == Abi::WindowsOS;
if (isWindows && isWinProcessBeingDebugged(process.pid)) { if (isWindows && isWinProcessBeingDebugged(process.pid)) {
QMessageBox::warning(ICore::mainWindow(), tr("Process Already Under Debugger Control"), Core::AsynchronousMessageBox::warning(tr("Process Already Under Debugger Control"),
tr("The process %1 is already under the control of a debugger.\n" tr("The process %1 is already under the control of a debugger.\n"
"Qt Creator cannot attach to it.").arg(process.pid)); "Qt Creator cannot attach to it.").arg(process.pid));
return 0; return 0;
} }
if (device->type() != PE::DESKTOP_DEVICE_TYPE) { if (device->type() != PE::DESKTOP_DEVICE_TYPE) {
QMessageBox::warning(ICore::mainWindow(), tr("Not a Desktop Device Type"), Core::AsynchronousMessageBox::warning(tr("Not a Desktop Device Type"),
tr("It is only possible to attach to a locally running process.")); tr("It is only possible to attach to a locally running process."));
return 0; return 0;
} }
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "coregdbadapter.h" #include "coregdbadapter.h"
#include <coreplugin/messagebox.h>
#include <debugger/debuggercore.h> #include <debugger/debuggercore.h>
#include <debugger/debuggerprotocol.h> #include <debugger/debuggerprotocol.h>
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
...@@ -39,7 +41,6 @@ ...@@ -39,7 +41,6 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDir> #include <QDir>
#include <QMessageBox>
#include <QTemporaryFile> #include <QTemporaryFile>
using namespace Utils; using namespace Utils;
...@@ -185,7 +186,7 @@ void GdbCoreEngine::continueSetupEngine() ...@@ -185,7 +186,7 @@ void GdbCoreEngine::continueSetupEngine()
if (cinfo.isCore) { if (cinfo.isCore) {
m_executable = cinfo.foundExecutableName; m_executable = cinfo.foundExecutableName;
if (m_executable.isEmpty()) { if (m_executable.isEmpty()) {
showMessageBox(QMessageBox::Warning, Core::AsynchronousMessageBox::warning(
tr("Error Loading Symbols"), tr("Error Loading Symbols"),
tr("No executable to load symbols from specified core.")); tr("No executable to load symbols from specified core."));
notifyEngineSetupFailed(); notifyEngineSetupFailed();
...@@ -196,7 +197,7 @@ void GdbCoreEngine::continueSetupEngine() ...@@ -196,7 +197,7 @@ void GdbCoreEngine::continueSetupEngine()
if (isCore) { if (isCore) {
startGdb(); startGdb();
} else { } else {
showMessageBox(QMessageBox::Warning, Core::AsynchronousMessageBox::warning(
tr("Error Loading Core File"), tr("Error Loading Core File"),
tr("The specified file does not appear to be a core file.")); tr("The specified file does not appear to be a core file."));
notifyEngineSetupFailed(); notifyEngineSetupFailed();
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <debugger/shared/hostutils.h> #include <debugger/shared/hostutils.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <projectexplorer/devicesupport/deviceprocess.h> #include <projectexplorer/devicesupport/deviceprocess.h>
#include <projectexplorer/itaskhandler.h> #include <projectexplorer/itaskhandler.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
...@@ -1072,7 +1073,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) ...@@ -1072,7 +1073,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
// with helpers enabled. In this case we get a second response with // with helpers enabled. In this case we get a second response with
// msg="Cannot find new threads: generic error" // msg="Cannot find new threads: generic error"
showMessage(_("APPLYING WORKAROUND #1")); showMessage(_("APPLYING WORKAROUND #1"));
showMessageBox(QMessageBox::Critical, Core::AsynchronousMessageBox::critical(
tr("Executable failed"), QString::fromLocal8Bit(msg)); tr("Executable failed"), QString::fromLocal8Bit(msg));
showStatusMessage(tr("Process failed to start")); showStatusMessage(tr("Process failed to start"));
//shutdown(); //shutdown();
...@@ -1098,7 +1099,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) ...@@ -1098,7 +1099,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
//showStatusMessage(tr("Executable failed: %1") //showStatusMessage(tr("Executable failed: %1")
// .arg(QString::fromLocal8Bit(msg))); // .arg(QString::fromLocal8Bit(msg)));
//shutdown(); //shutdown();
//showMessageBox(QMessageBox::Critical, //Core::AsynchronousMessageBox::critical(
// tr("Executable failed"), QString::fromLocal8Bit(msg)); // tr("Executable failed"), QString::fromLocal8Bit(msg));
} else if (msg.contains("Cannot insert breakpoint")) { } else if (msg.contains("Cannot insert breakpoint")) {
// For breakpoints set by address to non-existent addresses we // For breakpoints set by address to non-existent addresses we
...@@ -1112,7 +1113,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) ...@@ -1112,7 +1113,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
// long as the breakpoints are enabled. // long as the breakpoints are enabled.
// FIXME: Should we silently disable the offending breakpoints? // FIXME: Should we silently disable the offending breakpoints?
showMessage(_("APPLYING WORKAROUND #5")); showMessage(_("APPLYING WORKAROUND #5"));
showMessageBox(QMessageBox::Critical, Core::AsynchronousMessageBox::critical(
tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg)); tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg));
QTC_CHECK(state() == InferiorRunOk); QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
...@@ -1128,7 +1129,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) ...@@ -1128,7 +1129,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
if (!m_lastWinException.isEmpty()) if (!m_lastWinException.isEmpty())
logMsg = m_lastWinException + QLatin1Char('\n'); logMsg = m_lastWinException + QLatin1Char('\n');
logMsg += QString::fromLocal8Bit(msg); logMsg += QString::fromLocal8Bit(msg);
showMessageBox(QMessageBox::Critical, tr("Executable Failed"), logMsg); Core::AsynchronousMessageBox::critical(tr("Executable Failed"), logMsg);
showStatusMessage(tr("Executable failed: %1").arg(logMsg)); showStatusMessage(tr("Executable failed: %1").arg(logMsg));
} }
} }
...@@ -1793,7 +1794,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response) ...@@ -1793,7 +1794,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
QString out1 = _("The selected build of GDB does not support Python scripting."); QString out1 = _("The selected build of GDB does not support Python scripting.");
QString out2 = _("It cannot be used in Qt Creator."); QString out2 = _("It cannot be used in Qt Creator.");
showStatusMessage(out1 + QLatin1Char(' ') + out2); showStatusMessage(out1 + QLatin1Char(' ') + out2);
showMessageBox(QMessageBox::Critical, tr("Execution Error"), out1 + _("<br>") + out2); Core::AsynchronousMessageBox::critical(tr("Execution Error"), out1 + _("<br>") + out2);
} }
notifyEngineSetupFailed(); notifyEngineSetupFailed();
} }
...@@ -1801,7 +1802,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response) ...@@ -1801,7 +1802,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
void GdbEngine::showExecutionError(const QString &message) void GdbEngine::showExecutionError(const QString &message)
{ {
showMessageBox(QMessageBox::Critical, tr("Execution Error"), Core::AsynchronousMessageBox::critical(tr("Execution Error"),
tr("Cannot continue debugged process:") + QLatin1Char('\n') + message); tr("Cannot continue debugged process:") + QLatin1Char('\n') + message);
} }
...@@ -1933,7 +1934,7 @@ void GdbEngine::handleInferiorShutdown(const GdbResponse &response) ...@@ -1933,7 +1934,7 @@ void GdbEngine::handleInferiorShutdown(const GdbResponse &response)
notifyInferiorShutdownOk(); notifyInferiorShutdownOk();
return; return;
} }
showMessageBox(QMessageBox::Critical, Core::AsynchronousMessageBox::critical(
tr("Failed to shut down application"), tr("Failed to shut down application"),
msgInferiorStopFailed(QString::fromLocal8Bit(ba))); msgInferiorStopFailed(QString::fromLocal8Bit(ba)));
notifyInferiorShutdownFailed(); notifyInferiorShutdownFailed();
...@@ -2206,7 +2207,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response) ...@@ -2206,7 +2207,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response)
showExecutionError(QString::fromLocal8Bit(msg)); showExecutionError(QString::fromLocal8Bit(msg));
notifyInferiorRunFailed(); notifyInferiorRunFailed();
} else { } else {
showMessageBox(QMessageBox::Critical, tr("Execution Error"), Core::AsynchronousMessageBox::critical(tr("Execution Error"),
tr("Cannot continue debugged process:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg)); tr("Cannot continue debugged process:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg));
notifyInferiorIll(); notifyInferiorIll();
} }
...@@ -3061,7 +3062,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response) ...@@ -3061,7 +3062,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
file.remove(); file.remove();
Internal::showModuleSymbols(modulePath, symbols); Internal::showModuleSymbols(modulePath, symbols);
} else { } else {
showMessageBox(QMessageBox::Critical, tr("Cannot Read Symbols"), Core::AsynchronousMessageBox::critical(tr("Cannot Read Symbols"),
tr("Cannot read symbols for module \"%1\".").arg(fileName)); tr("Cannot read symbols for module \"%1\".").arg(fileName));
} }
} }
...@@ -3528,7 +3529,7 @@ void GdbEngine::createSnapshot() ...@@ -3528,7 +3529,7 @@ void GdbEngine::createSnapshot()
postCommand("gcore " + fileName.toLocal8Bit(), postCommand("gcore " + fileName.toLocal8Bit(),
NeedsStop|ConsoleCommand, CB(handleMakeSnapshot), fileName); NeedsStop|ConsoleCommand, CB(handleMakeSnapshot), fileName);
} else { } else {
showMessageBox(QMessageBox::Critical, tr("Snapshot Creation Error"), Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
tr("Cannot create snapshot file.")); tr("Cannot create snapshot file."));
} }
} }
...@@ -3551,7 +3552,7 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response) ...@@ -3551,7 +3552,7 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response)
DebuggerRunControlFactory::createAndScheduleRun(sp); DebuggerRunControlFactory::createAndScheduleRun(sp);
} else { } else {
QByteArray msg = response.data["msg"].data(); QByteArray msg = response.data["msg"].data();
showMessageBox(QMessageBox::Critical, tr("Snapshot Creation Error"), Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
tr("Cannot create snapshot:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg)); tr("Cannot create snapshot:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg));
} }
} }
...@@ -4299,7 +4300,7 @@ void GdbEngine::loadInitScript() ...@@ -4299,7 +4300,7 @@ void GdbEngine::loadInitScript()
if (QFileInfo(script).isReadable()) { if (QFileInfo(script).isReadable()) {
postCommand("source " + script.toLocal8Bit()); postCommand("source " + script.toLocal8Bit());
} else { } else {
showMessageBox(QMessageBox::Warning, Core::AsynchronousMessageBox::warning(
tr("Cannot find debugger initialization script"), tr("Cannot find debugger initialization script"),
tr("The debugger settings point to a script file at \"%1\" " tr("The debugger settings point to a script file at \"%1\" "
"which is not accessible. If a script file is not needed, " "which is not accessible. If a script file is not needed, "
...@@ -4336,7 +4337,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error) ...@@ -4336,7 +4337,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error)
default: default:
//m_gdbProc->kill(); //m_gdbProc->kill();
//notifyEngineIll(); //notifyEngineIll();
showMessageBox(QMessageBox::Critical, tr("GDB I/O Error"), msg); Core::AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
break; break;
} }
} }
...@@ -4364,7 +4365,7 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type) ...@@ -4364,7 +4365,7 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
const QString msg = type == QProcess::CrashExit ? const QString msg = type == QProcess::CrashExit ?
tr("The gdb process terminated.") : tr("The gdb process terminated.") :
tr("The gdb process terminated unexpectedly (code %1)").arg(code); tr("The gdb process terminated unexpectedly (code %1)").arg(code);
showMessageBox(QMessageBox::Critical, tr("Unexpected GDB Exit"), msg); Core::AsynchronousMessageBox::critical(tr("Unexpected GDB Exit"), msg);
break; break;
} }
} }
...@@ -4531,7 +4532,7 @@ void GdbEngine::notifyInferiorSetupFailed(const QString &msg) ...@@ -4531,7 +4532,7 @@ void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
return; // Adapter crashed meanwhile, so this notification is meaningless. return; // Adapter crashed meanwhile, so this notification is meaningless.
} }
showMessage(_("INFERIOR START FAILED")); showMessage(_("INFERIOR START FAILED"));
showMessageBox(QMessageBox::Critical, tr("Failed to start application"), msg); Core::AsynchronousMessageBox::critical(tr("Failed to start application"), msg);
DebuggerEngine::notifyInferiorSetupFailed(); DebuggerEngine::notifyInferiorSetupFailed();
} }
...@@ -4553,7 +4554,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg) ...@@ -4553,7 +4554,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg)
m_gdbProc->kill(); m_gdbProc->kill();
if (!msg.isEmpty()) if (!msg.isEmpty())
showMessageBox(QMessageBox::Critical, tr("Adapter crashed"), msg); Core::AsynchronousMessageBox::critical(tr("Adapter crashed"), msg);
} }
void GdbEngine::createFullBacktrace() void GdbEngine::createFullBacktrace()
......
...@@ -38,12 +38,13 @@ ...@@ -38,12 +38,13 @@
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerstringutils.h> #include <debugger/debuggerstringutils.h>
#include <coreplugin/messagebox.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QFileInfo> #include <QFileInfo>
#include <QMessageBox>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
...@@ -130,7 +131,7 @@ void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error) ...@@ -130,7 +131,7 @@ void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error)
} }
showMessage(msg, StatusBar); showMessage(msg, StatusBar);
showMessageBox(QMessageBox::Critical, tr("Error"), msg); Core::AsynchronousMessageBox::critical(tr("Error"), msg);
} }
void GdbRemoteServerEngine::readUploadStandardOutput() void GdbRemoteServerEngine::readUploadStandardOutput()
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <projectexplorer/kitchooser.h> #include <projectexplorer/kitchooser.h>
#include <projectexplorer/devicesupport/deviceprocesslist.h> #include <projectexplorer/devicesupport/deviceprocesslist.h>
#include <projectexplorer/devicesupport/deviceprocessesdialog.h> #include <projectexplorer/devicesupport/deviceprocessesdialog.h>
...@@ -45,7 +46,6 @@ ...@@ -45,7 +46,6 @@
#include <utils/portlist.h> #include <utils/portlist.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QMessageBox>
#include <QFileInfo> #include <QFileInfo>
using namespace Core; using namespace Core;
...@@ -90,7 +90,7 @@ GdbServerStarter::~GdbServerStarter() ...@@ -90,7 +90,7 @@ GdbServerStarter::~GdbServerStarter()
void GdbServerStarter::handleRemoteError(const QString &errorMsg) void GdbServerStarter::handleRemoteError(const QString &errorMsg)
{ {
QMessageBox::critical(0, tr("Remote Error"), errorMsg); Core::AsynchronousMessageBox::critical(tr("Remote Error"), errorMsg);
} }
void GdbServerStarter::portGathererError(const QString &text) void GdbServerStarter::portGathererError(const QString &text)
...@@ -191,7 +191,7 @@ void GdbServerStarter::attach(int port) ...@@ -191,7 +191,7 @@ void GdbServerStarter::attach(int port)
localExecutable = candidate; localExecutable = candidate;
} }
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
QMessageBox::warning(ICore::mainWindow(), tr("Warning"), Core::AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot find local executable for remote process \"%1\".") tr("Cannot find local executable for remote process \"%1\".")
.arg(d->process.exe)); .arg(d->process.exe));
return; return;
...@@ -199,7 +199,7 @@ void GdbServerStarter::attach(int port) ...@@ -199,7 +199,7 @@ void GdbServerStarter::attach(int port)
QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(localExecutable)); QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(localExecutable));
if (abis.isEmpty()) { if (abis.isEmpty()) {
QMessageBox::warning(ICore::mainWindow(), tr("Warning"), Core::AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot find ABI for remote process \"%1\".") tr("Cannot find ABI for remote process \"%1\".")
.arg(d->process.exe)); .arg(d->process.exe));
return; return;
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <QMessageBox>
using namespace Utils; using namespace Utils;
...@@ -188,7 +187,7 @@ void GdbTermEngine::interruptInferior2() ...@@ -188,7 +187,7 @@ void GdbTermEngine::interruptInferior2()
void GdbTermEngine::stubError(const QString &msg) void GdbTermEngine::stubError(const QString &msg)
{ {
showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); Core::AsynchronousMessageBox::critical(tr("Debugger Error"), msg);
} }