forked from qt-creator/qt-creator
debugger: move convienience function to DebuggerEngine base class
This commit is contained in:
@@ -126,7 +126,7 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
|
|||||||
QMetaObject::invokeMethod(editor->widget(), "setLazyData",
|
QMetaObject::invokeMethod(editor->widget(), "setLazyData",
|
||||||
Q_ARG(quint64, addr), Q_ARG(int, DataRange), Q_ARG(int, BinBlockSize));
|
Q_ARG(quint64, addr), Q_ARG(int, DataRange), Q_ARG(int, BinBlockSize));
|
||||||
} else {
|
} else {
|
||||||
DebuggerPlugin::instance()->showMessageBox(QMessageBox::Warning,
|
DebuggerEngine::showMessageBox(QMessageBox::Warning,
|
||||||
tr("No memory viewer available"),
|
tr("No memory viewer available"),
|
||||||
tr("The memory contents cannot be shown as no viewer plugin "
|
tr("The memory contents cannot be shown as no viewer plugin "
|
||||||
"for binary data has been loaded."));
|
"for binary data has been loaded."));
|
||||||
|
|||||||
@@ -1422,7 +1422,7 @@ qint64 DebuggerEngine::inferiorPid() const
|
|||||||
return d->m_inferiorPid;
|
return d->m_inferiorPid;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerPlugin *DebuggerEngine::plugin() const
|
DebuggerPlugin *DebuggerEngine::plugin()
|
||||||
{
|
{
|
||||||
return DebuggerPlugin::instance();
|
return DebuggerPlugin::instance();
|
||||||
}
|
}
|
||||||
@@ -1475,6 +1475,12 @@ void DebuggerEngine::progressPing()
|
|||||||
d->m_progress.setProgressValue(qMin(70, progress + 1));
|
d->m_progress.setProgressValue(qMin(70, progress + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMessageBox *DebuggerEngine::showMessageBox(int icon, const QString &title,
|
||||||
|
const QString &text, int buttons)
|
||||||
|
{
|
||||||
|
return plugin()->showMessageBox(icon, title, text, buttons);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QDebug;
|
class QDebug;
|
||||||
class QPoint;
|
class QPoint;
|
||||||
|
class QMessageBox;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
@@ -161,6 +162,10 @@ public:
|
|||||||
virtual void assignValueInDebugger(const QString &expr, const QString &value)
|
virtual void assignValueInDebugger(const QString &expr, const QString &value)
|
||||||
{ Q_UNUSED(expr); Q_UNUSED(value); }
|
{ Q_UNUSED(expr); Q_UNUSED(value); }
|
||||||
|
|
||||||
|
// Convenience
|
||||||
|
static QMessageBox *showMessageBox
|
||||||
|
(int icon, const QString &title, const QString &text, int buttons = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void detachDebugger() {}
|
virtual void detachDebugger() {}
|
||||||
virtual void executeStep() {}
|
virtual void executeStep() {}
|
||||||
@@ -188,7 +193,7 @@ protected:
|
|||||||
virtual void frameDown();
|
virtual void frameDown();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerPlugin *plugin() const;
|
static DebuggerPlugin *plugin();
|
||||||
const DebuggerStartParameters &startParameters() const;
|
const DebuggerStartParameters &startParameters() const;
|
||||||
DebuggerStartParameters &startParameters();
|
DebuggerStartParameters &startParameters();
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,6 @@ public:
|
|||||||
static void startDebugger(ProjectExplorer::RunControl *runControl);
|
static void startDebugger(ProjectExplorer::RunControl *runControl);
|
||||||
static void displayDebugger(ProjectExplorer::RunControl *runControl);
|
static void displayDebugger(ProjectExplorer::RunControl *runControl);
|
||||||
|
|
||||||
QMessageBox *showMessageBox(int icon, const QString &title,
|
|
||||||
const QString &text, int buttons = 0);
|
|
||||||
|
|
||||||
const CPlusPlus::Snapshot &cppCodeModelSnapshot() const;
|
const CPlusPlus::Snapshot &cppCodeModelSnapshot() const;
|
||||||
|
|
||||||
QIcon locationMarkIcon() const;
|
QIcon locationMarkIcon() const;
|
||||||
@@ -118,6 +115,9 @@ signals:
|
|||||||
void stateChanged(int);
|
void stateChanged(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QMessageBox *showMessageBox(int icon, const QString &title,
|
||||||
|
const QString &text, int buttons = 0);
|
||||||
|
|
||||||
friend class Internal::DebuggerEngine;
|
friend class Internal::DebuggerEngine;
|
||||||
friend class Internal::DebuggerListener;
|
friend class Internal::DebuggerListener;
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,6 @@ protected:
|
|||||||
{ return m_engine->startParameters(); }
|
{ return m_engine->startParameters(); }
|
||||||
void showMessage(const QString &msg, int channel = LogDebug, int timeout = 1)
|
void showMessage(const QString &msg, int channel = LogDebug, int timeout = 1)
|
||||||
{ m_engine->showMessage(msg, channel, timeout); }
|
{ m_engine->showMessage(msg, channel, timeout); }
|
||||||
void showMessageBox(int icon, const QString &title, const QString &text) const
|
|
||||||
{ m_engine->showMessageBox(icon, title, text); }
|
|
||||||
|
|
||||||
GdbEngine * const m_engine;
|
GdbEngine * const m_engine;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4232,12 +4232,6 @@ void GdbEngine::handleAdapterCrashed(const QString &msg)
|
|||||||
showMessageBox(QMessageBox::Critical, tr("Adapter crashed"), msg);
|
showMessageBox(QMessageBox::Critical, tr("Adapter crashed"), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox *GdbEngine::showMessageBox(int icon, const QString &title,
|
|
||||||
const QString &text, int buttons)
|
|
||||||
{
|
|
||||||
return plugin()->showMessageBox(icon, title, text, buttons);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GdbEngine::setUseDebuggingHelpers(const QVariant &on)
|
void GdbEngine::setUseDebuggingHelpers(const QVariant &on)
|
||||||
{
|
{
|
||||||
//qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
|
//qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
|
||||||
|
|||||||
@@ -527,8 +527,6 @@ private: ////////// View & Data Stuff //////////
|
|||||||
// Convenience Functions
|
// Convenience Functions
|
||||||
//
|
//
|
||||||
QString errorMessage(QProcess::ProcessError error);
|
QString errorMessage(QProcess::ProcessError error);
|
||||||
QMessageBox *showMessageBox(int icon, const QString &title, const QString &text,
|
|
||||||
int buttons = 0);
|
|
||||||
QMainWindow *mainWindow() const;
|
QMainWindow *mainWindow() const;
|
||||||
AbstractGdbProcess *gdbProc() const;
|
AbstractGdbProcess *gdbProc() const;
|
||||||
void showExecutionError(const QString &message);
|
void showExecutionError(const QString &message);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void RemoteGdbServerAdapter::uploadProcError(QProcess::ProcessError error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
showMessage(msg, StatusBar);
|
showMessage(msg, StatusBar);
|
||||||
showMessageBox(QMessageBox::Critical, tr("Error"), msg);
|
DebuggerEngine::showMessageBox(QMessageBox::Critical, tr("Error"), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteGdbServerAdapter::readUploadStandardOutput()
|
void RemoteGdbServerAdapter::readUploadStandardOutput()
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ void TermGdbAdapter::interruptInferior()
|
|||||||
|
|
||||||
void TermGdbAdapter::stubMessage(const QString &msg, bool)
|
void TermGdbAdapter::stubMessage(const QString &msg, bool)
|
||||||
{
|
{
|
||||||
showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg);
|
DebuggerEngine::showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TermGdbAdapter::stubExited()
|
void TermGdbAdapter::stubExited()
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ void PdbEngine::handlePdbError(QProcess::ProcessError error)
|
|||||||
default:
|
default:
|
||||||
//setState(EngineShutdownRequested, true);
|
//setState(EngineShutdownRequested, true);
|
||||||
m_pdbProc.kill();
|
m_pdbProc.kill();
|
||||||
plugin()->showMessageBox(QMessageBox::Critical, tr("Pdb I/O Error"),
|
showMessageBox(QMessageBox::Critical, tr("Pdb I/O Error"),
|
||||||
errorMessage(error));
|
errorMessage(error));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user