Debugger: Cosmetics

Qt 5 connects, unused declaration, QLatin1Strings, ...

Change-Id: If09929993d750907ee3f4e2fa9f18acfcc28d9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-04-19 22:49:23 +02:00
parent 3b83b8b989
commit 60f092f6bb
23 changed files with 133 additions and 171 deletions

View File

@@ -33,12 +33,6 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QPointer> #include <QPointer>
//////////////////////////////////////////////////////////////////
//
// BreakHandler
//
//////////////////////////////////////////////////////////////////
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {

View File

@@ -36,7 +36,6 @@ QT_BEGIN_NAMESPACE
class QIcon; class QIcon;
class QMessageBox; class QMessageBox;
class QWidget; class QWidget;
class QTreeView;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace CPlusPlus { class Snapshot; } namespace CPlusPlus { class Snapshot; }
@@ -51,6 +50,7 @@ class DebuggerEngine;
class Symbol; class Symbol;
class Section; class Section;
class GlobalDebuggerOptions; class GlobalDebuggerOptions;
class WatchTreeView;
enum TestCases enum TestCases
{ {
@@ -87,7 +87,7 @@ void setThreadBoxContents(const QStringList &list, int index);
QSharedPointer<Internal::GlobalDebuggerOptions> globalDebuggerOptions(); QSharedPointer<Internal::GlobalDebuggerOptions> globalDebuggerOptions();
QTreeView *inspectorView(); WatchTreeView *inspectorView();
QVariant sessionValue(const QByteArray &name); QVariant sessionValue(const QByteArray &name);
void setSessionValue(const QByteArray &name, const QVariant &value); void setSessionValue(const QByteArray &name, const QVariant &value);
QVariant configValue(const QByteArray &name); QVariant configValue(const QByteArray &name);

View File

@@ -865,8 +865,8 @@ TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
m_ui->addPage(tr("Standard Types")); m_ui->addPage(tr("Standard Types"));
m_ui->addPage(tr("Misc Types")); m_ui->addPage(tr("Misc Types"));
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject())); connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
} }
TypeFormatsDialog::~TypeFormatsDialog() TypeFormatsDialog::~TypeFormatsDialog()

View File

@@ -33,20 +33,14 @@
#include <QDialog> #include <QDialog>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QModelIndex;
class QPushButton; class QPushButton;
class QLineEdit; class QLineEdit;
class QDialogButtonBox; class QDialogButtonBox;
class QSettings;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { class Id; }
namespace ProjectExplorer { class Kit; }
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class AttachCoreDialogPrivate;
class AttachToQmlPortDialogPrivate; class AttachToQmlPortDialogPrivate;
class DebuggerRunParameters; class DebuggerRunParameters;
class StartApplicationParameters; class StartApplicationParameters;
@@ -80,11 +74,9 @@ public:
static bool run(QWidget *parent, DebuggerRunParameters *rp, ProjectExplorer::Kit **kit); static bool run(QWidget *parent, DebuggerRunParameters *rp, ProjectExplorer::Kit **kit);
private slots: private:
void historyIndexChanged(int); void historyIndexChanged(int);
void updateState(); void updateState();
private:
StartApplicationParameters parameters() const; StartApplicationParameters parameters() const;
void setParameters(const StartApplicationParameters &p); void setParameters(const StartApplicationParameters &p);
void setHistory(const QList<StartApplicationParameters> &l); void setHistory(const QList<StartApplicationParameters> &l);
@@ -121,10 +113,8 @@ public:
QString connection() const; QString connection() const;
void setConnection(const QString &); void setConnection(const QString &);
private slots:
void textChanged(const QString &);
private: private:
void textChanged(const QString &);
void accept(); void accept();
QPushButton *m_okButton; QPushButton *m_okButton;
@@ -140,10 +130,8 @@ public:
void setAddress(quint64 a); void setAddress(quint64 a);
quint64 address() const; quint64 address() const;
private slots:
void textChanged();
private: private:
void textChanged();
void accept(); void accept();
void setOkButtonEnabled(bool v); void setOkButtonEnabled(bool v);

View File

@@ -200,10 +200,9 @@ public:
Utils::globalMacroExpander()->registerFileVariables(PrefixDebugExecutable, Utils::globalMacroExpander()->registerFileVariables(PrefixDebugExecutable,
tr("Debugged executable"), tr("Debugged executable"),
[this]() { return m_runParameters.inferior.executable; }); [this] { return m_runParameters.inferior.executable; });
} }
public slots:
void doSetupEngine(); void doSetupEngine();
void doSetupInferior(); void doSetupInferior();
void doRunEngine(); void doRunEngine();
@@ -220,36 +219,36 @@ public slots:
void queueSetupEngine() void queueSetupEngine()
{ {
m_engine->setState(EngineSetupRequested); m_engine->setState(EngineSetupRequested);
m_engine->showMessage(_("QUEUE: SETUP ENGINE")); m_engine->showMessage("QUEUE: SETUP ENGINE");
QTimer::singleShot(0, this, SLOT(doSetupEngine())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doSetupEngine);
} }
void queueSetupInferior() void queueSetupInferior()
{ {
m_engine->setState(InferiorSetupRequested); m_engine->setState(InferiorSetupRequested);
m_engine->showMessage(_("QUEUE: SETUP INFERIOR")); m_engine->showMessage("QUEUE: SETUP INFERIOR");
QTimer::singleShot(0, this, SLOT(doSetupInferior())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doSetupInferior);
} }
void queueRunEngine() void queueRunEngine()
{ {
m_engine->setState(EngineRunRequested); m_engine->setState(EngineRunRequested);
m_engine->showMessage(_("QUEUE: RUN ENGINE")); m_engine->showMessage("QUEUE: RUN ENGINE");
QTimer::singleShot(0, this, SLOT(doRunEngine())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doRunEngine);
} }
void queueShutdownEngine() void queueShutdownEngine()
{ {
m_engine->setState(EngineShutdownRequested); m_engine->setState(EngineShutdownRequested);
m_engine->showMessage(_("QUEUE: SHUTDOWN ENGINE")); m_engine->showMessage("QUEUE: SHUTDOWN ENGINE");
QTimer::singleShot(0, this, SLOT(doShutdownEngine())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doShutdownEngine);
} }
void queueShutdownInferior() void queueShutdownInferior()
{ {
m_engine->setState(InferiorShutdownRequested); m_engine->setState(InferiorShutdownRequested);
m_engine->showMessage(_("QUEUE: SHUTDOWN INFERIOR")); m_engine->showMessage("QUEUE: SHUTDOWN INFERIOR");
QTimer::singleShot(0, this, SLOT(doShutdownInferior())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doShutdownInferior);
} }
void queueFinishDebugger() void queueFinishDebugger()
@@ -259,8 +258,8 @@ public slots:
m_engine->setState(DebuggerFinished); m_engine->setState(DebuggerFinished);
resetLocation(); resetLocation();
if (isMasterEngine()) { if (isMasterEngine()) {
m_engine->showMessage(_("QUEUE: FINISH DEBUGGER")); m_engine->showMessage("QUEUE: FINISH DEBUGGER");
QTimer::singleShot(0, this, SLOT(doFinishDebugger())); QTimer::singleShot(0, this, &DebuggerEnginePrivate::doFinishDebugger);
} }
} }
@@ -861,7 +860,7 @@ void DebuggerEngine::notifyEngineRunOkAndInferiorUnrunnable()
void DebuggerEngine::notifyEngineRunFailed() void DebuggerEngine::notifyEngineRunFailed()
{ {
showMessage(_("NOTE: ENGINE RUN FAILED")); showMessage("NOTE: ENGINE RUN FAILED");
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
d->m_progress.setProgressValue(900); d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled(); d->m_progress.reportCanceled();
@@ -874,7 +873,7 @@ void DebuggerEngine::notifyEngineRunFailed()
void DebuggerEngine::notifyEngineRequestRemoteSetup() void DebuggerEngine::notifyEngineRequestRemoteSetup()
{ {
showMessage(_("NOTE: REQUEST REMOTE SETUP")); showMessage("NOTE: REQUEST REMOTE SETUP");
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
QTC_ASSERT(d->remoteSetupState() == RemoteSetupNone, qDebug() << this QTC_ASSERT(d->remoteSetupState() == RemoteSetupNone, qDebug() << this
<< "remoteSetupState" << d->remoteSetupState()); << "remoteSetupState" << d->remoteSetupState());
@@ -885,7 +884,7 @@ void DebuggerEngine::notifyEngineRequestRemoteSetup()
void DebuggerEngine::notifyEngineRemoteServerRunning(const QByteArray &, int /*pid*/) void DebuggerEngine::notifyEngineRemoteServerRunning(const QByteArray &, int /*pid*/)
{ {
showMessage(_("NOTE: REMOTE SERVER RUNNING IN MULTIMODE")); showMessage("NOTE: REMOTE SERVER RUNNING IN MULTIMODE");
} }
void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
@@ -899,7 +898,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
qDebug() << this << "remoteSetupState" << d->remoteSetupState()); qDebug() << this << "remoteSetupState" << d->remoteSetupState());
if (result.success) { if (result.success) {
showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2") showMessage(QString("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
.arg(result.gdbServerPort.number()).arg(result.qmlServerPort.number())); .arg(result.gdbServerPort.number()).arg(result.qmlServerPort.number()));
if (d->remoteSetupState() != RemoteSetupCancelled) if (d->remoteSetupState() != RemoteSetupCancelled)
@@ -919,19 +918,19 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
if (result.qmlServerPort.isValid()) { if (result.qmlServerPort.isValid()) {
d->m_runParameters.qmlServerPort = result.qmlServerPort; d->m_runParameters.qmlServerPort = result.qmlServerPort;
d->m_runParameters.inferior.commandLineArguments.replace( d->m_runParameters.inferior.commandLineArguments.replace("%qml_port%",
_("%qml_port%"), QString::number(result.qmlServerPort.number())); QString::number(result.qmlServerPort.number()));
} }
} else { } else {
d->setRemoteSetupState(RemoteSetupFailed); d->setRemoteSetupState(RemoteSetupFailed);
showMessage(_("NOTE: REMOTE SETUP FAILED: ") + result.reason); showMessage("NOTE: REMOTE SETUP FAILED: " + result.reason);
} }
} }
void DebuggerEngine::notifyEngineRunAndInferiorRunOk() void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
{ {
showMessage(_("NOTE: ENGINE RUN AND INFERIOR RUN OK")); showMessage("NOTE: ENGINE RUN AND INFERIOR RUN OK");
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
@@ -941,7 +940,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
void DebuggerEngine::notifyEngineRunAndInferiorStopOk() void DebuggerEngine::notifyEngineRunAndInferiorStopOk()
{ {
showMessage(_("NOTE: ENGINE RUN AND INFERIOR STOP OK")); showMessage("NOTE: ENGINE RUN AND INFERIOR STOP OK");
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
@@ -951,7 +950,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorStopOk()
void DebuggerEngine::notifyInferiorRunRequested() void DebuggerEngine::notifyInferiorRunRequested()
{ {
showMessage(_("NOTE: INFERIOR RUN REQUESTED")); showMessage("NOTE: INFERIOR RUN REQUESTED");
QTC_ASSERT(state() == InferiorStopOk, qDebug() << this << state()); QTC_ASSERT(state() == InferiorStopOk, qDebug() << this << state());
showStatusMessage(tr("Run requested...")); showStatusMessage(tr("Run requested..."));
setState(InferiorRunRequested); setState(InferiorRunRequested);
@@ -960,10 +959,10 @@ void DebuggerEngine::notifyInferiorRunRequested()
void DebuggerEngine::notifyInferiorRunOk() void DebuggerEngine::notifyInferiorRunOk()
{ {
if (state() == InferiorRunOk) { if (state() == InferiorRunOk) {
showMessage(_("NOTE: INFERIOR RUN OK - REPEATED.")); showMessage("NOTE: INFERIOR RUN OK - REPEATED.");
return; return;
} }
showMessage(_("NOTE: INFERIOR RUN OK")); showMessage("NOTE: INFERIOR RUN OK");
showStatusMessage(tr("Running.")); showStatusMessage(tr("Running."));
// Transition from StopRequested can happen in remotegdbadapter. // Transition from StopRequested can happen in remotegdbadapter.
QTC_ASSERT(state() == InferiorRunRequested QTC_ASSERT(state() == InferiorRunRequested
@@ -974,7 +973,7 @@ void DebuggerEngine::notifyInferiorRunOk()
void DebuggerEngine::notifyInferiorRunFailed() void DebuggerEngine::notifyInferiorRunFailed()
{ {
showMessage(_("NOTE: INFERIOR RUN FAILED")); showMessage("NOTE: INFERIOR RUN FAILED");
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorRunRequested, qDebug() << this << state());
setState(InferiorRunFailed); setState(InferiorRunFailed);
setState(InferiorStopOk); setState(InferiorStopOk);
@@ -984,20 +983,20 @@ void DebuggerEngine::notifyInferiorRunFailed()
void DebuggerEngine::notifyInferiorStopOk() void DebuggerEngine::notifyInferiorStopOk()
{ {
showMessage(_("NOTE: INFERIOR STOP OK")); showMessage("NOTE: INFERIOR STOP OK");
// Ignore spurious notifications after we are set to die. // Ignore spurious notifications after we are set to die.
if (isDying()) { if (isDying()) {
showMessage(_("NOTE: ... WHILE DYING. ")); showMessage("NOTE: ... WHILE DYING. ");
// Forward state to "StopOk" if needed. // Forward state to "StopOk" if needed.
if (state() == InferiorStopRequested if (state() == InferiorStopRequested
|| state() == InferiorRunRequested || state() == InferiorRunRequested
|| state() == InferiorRunOk) { || state() == InferiorRunOk) {
showMessage(_("NOTE: ... FORWARDING TO 'STOP OK'. ")); showMessage("NOTE: ... FORWARDING TO 'STOP OK'. ");
setState(InferiorStopOk); setState(InferiorStopOk);
} }
if (state() == InferiorStopOk || state() == InferiorStopFailed) if (state() == InferiorStopOk || state() == InferiorStopFailed)
d->queueShutdownInferior(); d->queueShutdownInferior();
showMessage(_("NOTE: ... IGNORING STOP MESSAGE")); showMessage("NOTE: ... IGNORING STOP MESSAGE");
return; return;
} }
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state());
@@ -1007,7 +1006,7 @@ void DebuggerEngine::notifyInferiorStopOk()
void DebuggerEngine::notifyInferiorSpontaneousStop() void DebuggerEngine::notifyInferiorSpontaneousStop()
{ {
showMessage(_("NOTE: INFERIOR SPONTANEOUS STOP")); showMessage("NOTE: INFERIOR SPONTANEOUS STOP");
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state()); QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
showStatusMessage(tr("Stopped.")); showStatusMessage(tr("Stopped."));
setState(InferiorStopOk); setState(InferiorStopOk);
@@ -1017,7 +1016,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop()
void DebuggerEngine::notifyInferiorStopFailed() void DebuggerEngine::notifyInferiorStopFailed()
{ {
showMessage(_("NOTE: INFERIOR STOP FAILED")); showMessage("NOTE: INFERIOR STOP FAILED");
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state());
setState(InferiorStopFailed); setState(InferiorStopFailed);
if (isMasterEngine()) if (isMasterEngine())
@@ -1029,7 +1028,7 @@ void DebuggerEnginePrivate::doInterruptInferior()
//QTC_ASSERT(isMasterEngine(), return); //QTC_ASSERT(isMasterEngine(), return);
QTC_ASSERT(state() == InferiorRunOk, qDebug() << m_engine << state()); QTC_ASSERT(state() == InferiorRunOk, qDebug() << m_engine << state());
m_engine->setState(InferiorStopRequested); m_engine->setState(InferiorStopRequested);
m_engine->showMessage(_("CALL: INTERRUPT INFERIOR")); m_engine->showMessage("CALL: INTERRUPT INFERIOR");
m_engine->showStatusMessage(tr("Attempting to interrupt.")); m_engine->showStatusMessage(tr("Attempting to interrupt."));
m_engine->interruptInferior(); m_engine->interruptInferior();
} }
@@ -1040,13 +1039,13 @@ void DebuggerEnginePrivate::doShutdownInferior()
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << m_engine << state()); QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << m_engine << state());
resetLocation(); resetLocation();
m_targetState = DebuggerFinished; m_targetState = DebuggerFinished;
m_engine->showMessage(_("CALL: SHUTDOWN INFERIOR")); m_engine->showMessage("CALL: SHUTDOWN INFERIOR");
m_engine->shutdownInferior(); m_engine->shutdownInferior();
} }
void DebuggerEngine::notifyInferiorShutdownOk() void DebuggerEngine::notifyInferiorShutdownOk()
{ {
showMessage(_("INFERIOR SUCCESSFULLY SHUT DOWN")); showMessage("INFERIOR SUCCESSFULLY SHUT DOWN");
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state());
d->m_lastGoodState = DebuggerNotReady; // A "neutral" value. d->m_lastGoodState = DebuggerNotReady; // A "neutral" value.
setState(InferiorShutdownOk); setState(InferiorShutdownOk);
@@ -1056,7 +1055,7 @@ void DebuggerEngine::notifyInferiorShutdownOk()
void DebuggerEngine::notifyInferiorShutdownFailed() void DebuggerEngine::notifyInferiorShutdownFailed()
{ {
showMessage(_("INFERIOR SHUTDOWN FAILED")); showMessage("INFERIOR SHUTDOWN FAILED");
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state());
setState(InferiorShutdownFailed); setState(InferiorShutdownFailed);
if (isMasterEngine()) if (isMasterEngine())
@@ -1065,7 +1064,7 @@ void DebuggerEngine::notifyInferiorShutdownFailed()
void DebuggerEngine::notifyInferiorIll() void DebuggerEngine::notifyInferiorIll()
{ {
showMessage(_("NOTE: INFERIOR ILL")); showMessage("NOTE: INFERIOR ILL");
// This can be issued in almost any state. The inferior could still be // This can be issued in almost any state. The inferior could still be
// alive as some previous notifications might have been bogus. // alive as some previous notifications might have been bogus.
d->m_targetState = DebuggerFinished; d->m_targetState = DebuggerFinished;
@@ -1092,13 +1091,13 @@ void DebuggerEnginePrivate::doShutdownEngine()
QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return); QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return);
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << m_engine << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << m_engine << state());
m_targetState = DebuggerFinished; m_targetState = DebuggerFinished;
m_engine->showMessage(_("CALL: SHUTDOWN ENGINE")); m_engine->showMessage("CALL: SHUTDOWN ENGINE");
m_engine->shutdownEngine(); m_engine->shutdownEngine();
} }
void DebuggerEngine::notifyEngineShutdownOk() void DebuggerEngine::notifyEngineShutdownOk()
{ {
showMessage(_("NOTE: ENGINE SHUTDOWN OK")); showMessage("NOTE: ENGINE SHUTDOWN OK");
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state());
setState(EngineShutdownOk); setState(EngineShutdownOk);
d->queueFinishDebugger(); d->queueFinishDebugger();
@@ -1106,7 +1105,7 @@ void DebuggerEngine::notifyEngineShutdownOk()
void DebuggerEngine::notifyEngineShutdownFailed() void DebuggerEngine::notifyEngineShutdownFailed()
{ {
showMessage(_("NOTE: ENGINE SHUTDOWN FAILED")); showMessage("NOTE: ENGINE SHUTDOWN FAILED");
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state());
setState(EngineShutdownFailed); setState(EngineShutdownFailed);
d->queueFinishDebugger(); d->queueFinishDebugger();
@@ -1114,7 +1113,7 @@ void DebuggerEngine::notifyEngineShutdownFailed()
void DebuggerEnginePrivate::doFinishDebugger() void DebuggerEnginePrivate::doFinishDebugger()
{ {
m_engine->showMessage(_("NOTE: FINISH DEBUGGER")); m_engine->showMessage("NOTE: FINISH DEBUGGER");
QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state()); QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state());
if (isMasterEngine() && m_runControl) if (isMasterEngine() && m_runControl)
m_runControl->debuggingFinished(); m_runControl->debuggingFinished();
@@ -1147,7 +1146,7 @@ void DebuggerEngine::notifyEngineIll()
CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS; CALLGRIND_DUMP_STATS;
#endif #endif
showMessage(_("NOTE: ENGINE ILL ******")); showMessage("NOTE: ENGINE ILL ******");
d->m_targetState = DebuggerFinished; d->m_targetState = DebuggerFinished;
d->m_lastGoodState = d->m_state; d->m_lastGoodState = d->m_state;
switch (state()) { switch (state()) {
@@ -1157,14 +1156,14 @@ void DebuggerEngine::notifyEngineIll()
// properly interrupt at least once. If that fails, we are on the // properly interrupt at least once. If that fails, we are on the
// shutdown path due to d->m_targetState anyways. // shutdown path due to d->m_targetState anyways.
setState(InferiorStopRequested, true); setState(InferiorStopRequested, true);
showMessage(_("ATTEMPT TO INTERRUPT INFERIOR")); showMessage("ATTEMPT TO INTERRUPT INFERIOR");
interruptInferior(); interruptInferior();
break; break;
case InferiorStopRequested: case InferiorStopRequested:
notifyInferiorStopFailed(); notifyInferiorStopFailed();
break; break;
case InferiorStopOk: case InferiorStopOk:
showMessage(_("FORWARDING STATE TO InferiorShutdownFailed")); showMessage("FORWARDING STATE TO InferiorShutdownFailed");
setState(InferiorShutdownFailed, true); setState(InferiorShutdownFailed, true);
if (isMasterEngine()) if (isMasterEngine())
d->queueShutdownEngine(); d->queueShutdownEngine();
@@ -1182,7 +1181,7 @@ void DebuggerEngine::notifyEngineSpontaneousShutdown()
CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS; CALLGRIND_DUMP_STATS;
#endif #endif
showMessage(_("NOTE: ENGINE SPONTANEOUS SHUTDOWN")); showMessage("NOTE: ENGINE SPONTANEOUS SHUTDOWN");
setState(EngineShutdownOk, true); setState(EngineShutdownOk, true);
if (isMasterEngine()) if (isMasterEngine())
d->queueFinishDebugger(); d->queueFinishDebugger();
@@ -1194,7 +1193,7 @@ void DebuggerEngine::notifyInferiorExited()
CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS; CALLGRIND_DUMP_STATS;
#endif #endif
showMessage(_("NOTE: INFERIOR EXITED")); showMessage("NOTE: INFERIOR EXITED");
d->resetLocation(); d->resetLocation();
setState(InferiorShutdownOk); setState(InferiorShutdownOk);
if (isMasterEngine()) if (isMasterEngine())
@@ -1204,7 +1203,7 @@ void DebuggerEngine::notifyInferiorExited()
void DebuggerEngine::notifyDebuggerProcessFinished(int exitCode, void DebuggerEngine::notifyDebuggerProcessFinished(int exitCode,
QProcess::ExitStatus exitStatus, const QString &backendName) QProcess::ExitStatus exitStatus, const QString &backendName)
{ {
showMessage(_("%1 PROCESS FINISHED, status %2, exit code %3") showMessage(QString("%1 PROCESS FINISHED, status %2, exit code %3")
.arg(backendName).arg(exitStatus).arg(exitCode)); .arg(backendName).arg(exitStatus).arg(exitCode));
switch (state()) { switch (state()) {
@@ -1218,7 +1217,7 @@ void DebuggerEngine::notifyDebuggerProcessFinished(int exitCode,
// This could either be a real gdb/lldb crash or a quickly exited inferior // This could either be a real gdb/lldb crash or a quickly exited inferior
// in the terminal adapter. In this case the stub proc will die soon, // in the terminal adapter. In this case the stub proc will die soon,
// too, so there's no need to act here. // too, so there's no need to act here.
showMessage(_("The %1 process exited somewhat unexpectedly.").arg(backendName)); showMessage(QString("The %1 process exited somewhat unexpectedly.").arg(backendName));
notifyEngineSpontaneousShutdown(); notifyEngineSpontaneousShutdown();
break; break;
default: { default: {
@@ -1400,7 +1399,7 @@ void DebuggerEngine::notifyInferiorPid(qint64 pid)
if (d->m_runParameters.startMode == StartInternal if (d->m_runParameters.startMode == StartInternal
|| d->m_runParameters.startMode == StartExternal || d->m_runParameters.startMode == StartExternal
|| d->m_runParameters.startMode == AttachExternal) || d->m_runParameters.startMode == AttachExternal)
QTimer::singleShot(0, d, SLOT(raiseApplication())); QTimer::singleShot(0, d, &DebuggerEnginePrivate::raiseApplication);
} }
} }
@@ -1417,7 +1416,7 @@ bool DebuggerEngine::isReverseDebugging() const
// Called by DebuggerRunControl. // Called by DebuggerRunControl.
void DebuggerEngine::quitDebugger() void DebuggerEngine::quitDebugger()
{ {
showMessage(_("QUIT DEBUGGER REQUESTED IN STATE %1").arg(state())); showMessage(QString("QUIT DEBUGGER REQUESTED IN STATE %1").arg(state()));
d->m_targetState = DebuggerFinished; d->m_targetState = DebuggerFinished;
switch (state()) { switch (state()) {
case InferiorStopOk: case InferiorStopOk:
@@ -1594,9 +1593,9 @@ void DebuggerEngine::updateAll()
void DebuggerEngine::attemptBreakpointSynchronization() void DebuggerEngine::attemptBreakpointSynchronization()
{ {
showMessage(_("ATTEMPT BREAKPOINT SYNCHRONIZATION")); showMessage("ATTEMPT BREAKPOINT SYNCHRONIZATION");
if (!stateAcceptsBreakpointChanges()) { if (!stateAcceptsBreakpointChanges()) {
showMessage(_("BREAKPOINT SYNCHRONIZATION NOT POSSIBLE IN CURRENT STATE")); showMessage("BREAKPOINT SYNCHRONIZATION NOT POSSIBLE IN CURRENT STATE");
return; return;
} }
@@ -1605,11 +1604,11 @@ void DebuggerEngine::attemptBreakpointSynchronization()
foreach (Breakpoint bp, handler->unclaimedBreakpoints()) { foreach (Breakpoint bp, handler->unclaimedBreakpoints()) {
// Take ownership of the breakpoint. Requests insertion. // Take ownership of the breakpoint. Requests insertion.
if (acceptsBreakpoint(bp)) { if (acceptsBreakpoint(bp)) {
showMessage(_("TAKING OWNERSHIP OF BREAKPOINT %1 IN STATE %2") showMessage(QString("TAKING OWNERSHIP OF BREAKPOINT %1 IN STATE %2")
.arg(bp.id().toString()).arg(bp.state())); .arg(bp.id().toString()).arg(bp.state()));
bp.setEngine(this); bp.setEngine(this);
} else { } else {
showMessage(_("BREAKPOINT %1 IN STATE %2 IS NOT ACCEPTABLE") showMessage(QString("BREAKPOINT %1 IN STATE %2 IS NOT ACCEPTABLE")
.arg(bp.id().toString()).arg(bp.state())); .arg(bp.id().toString()).arg(bp.state()));
} }
} }
@@ -1651,11 +1650,10 @@ void DebuggerEngine::attemptBreakpointSynchronization()
} }
} }
if (done) { if (done)
showMessage(_("BREAKPOINTS ARE SYNCHRONIZED")); showMessage("BREAKPOINTS ARE SYNCHRONIZED");
} else { else
showMessage(_("BREAKPOINTS ARE NOT FULLY SYNCHRONIZED")); showMessage("BREAKPOINTS ARE NOT FULLY SYNCHRONIZED");
}
} }
bool DebuggerEngine::acceptsBreakpoint(Breakpoint bp) const bool DebuggerEngine::acceptsBreakpoint(Breakpoint bp) const
@@ -1891,19 +1889,18 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
Internal::showMessage(_("EXAMINING ") + symbolFile, LogDebug); Internal::showMessage(_("EXAMINING ") + symbolFile, LogDebug);
QByteArray msg = "ELF SECTIONS: "; QByteArray msg = "ELF SECTIONS: ";
static QList<QByteArray> interesting; static const QList<QByteArray> interesting = {
if (interesting.isEmpty()) { ".debug_info",
interesting.append(".debug_info"); ".debug_abbrev",
interesting.append(".debug_abbrev"); ".debug_line",
interesting.append(".debug_line"); ".debug_str",
interesting.append(".debug_str"); ".debug_loc",
interesting.append(".debug_loc"); ".debug_range",
interesting.append(".debug_range"); ".gdb_index",
interesting.append(".gdb_index"); ".note.gnu.build-id",
interesting.append(".note.gnu.build-id"); ".gnu.hash",
interesting.append(".gnu.hash"); ".gnu_debuglink"
interesting.append(".gnu_debuglink"); };
}
QSet<QByteArray> seen; QSet<QByteArray> seen;
foreach (const Utils::ElfSectionHeader &header, elfData.sectionHeaders) { foreach (const Utils::ElfSectionHeader &header, elfData.sectionHeaders) {

View File

@@ -1007,7 +1007,7 @@ public:
BaseTreeView *m_returnView = 0; BaseTreeView *m_returnView = 0;
BaseTreeView *m_localsView = 0; BaseTreeView *m_localsView = 0;
BaseTreeView *m_watchersView = 0; BaseTreeView *m_watchersView = 0;
BaseTreeView *m_inspectorView = 0; WatchTreeView *m_inspectorView = 0;
BaseTreeView *m_registerView = 0; BaseTreeView *m_registerView = 0;
BaseTreeView *m_modulesView = 0; BaseTreeView *m_modulesView = 0;
BaseTreeView *m_snapshotView = 0; BaseTreeView *m_snapshotView = 0;
@@ -2809,7 +2809,7 @@ QVariant sessionValue(const QByteArray &key)
return SessionManager::value(QString::fromUtf8(key)); return SessionManager::value(QString::fromUtf8(key));
} }
QTreeView *inspectorView() WatchTreeView *inspectorView()
{ {
return dd->m_inspectorView; return dd->m_inspectorView;
} }

View File

@@ -968,7 +968,7 @@ DebuggerToolTipManager::~DebuggerToolTipManager()
m_instance = 0; m_instance = 0;
} }
void DebuggerToolTipManager::slotUpdateVisibleToolTips() void DebuggerToolTipManager::updateVisibleToolTips()
{ {
purgeClosedToolTips(); purgeClosedToolTips();
if (m_tooltips.isEmpty()) if (m_tooltips.isEmpty())
@@ -1010,7 +1010,7 @@ void DebuggerToolTipManager::updateEngine(DebuggerEngine *engine)
// all others release (arguable, this could be more precise?) // all others release (arguable, this could be more precise?)
foreach (DebuggerToolTipHolder *tooltip, m_tooltips) foreach (DebuggerToolTipHolder *tooltip, m_tooltips)
tooltip->updateTooltip(engine); tooltip->updateTooltip(engine);
slotUpdateVisibleToolTips(); // Move tooltip when stepping in same file. updateVisibleToolTips(); // Move tooltip when stepping in same file.
} }
void DebuggerToolTipManager::registerEngine(DebuggerEngine *engine) void DebuggerToolTipManager::registerEngine(DebuggerEngine *engine)
@@ -1237,7 +1237,7 @@ static void slotEditorOpened(IEditor *e)
if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(e)) { if (BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(e)) {
TextEditorWidget *widget = textEditor->editorWidget(); TextEditorWidget *widget = textEditor->editorWidget();
QObject::connect(widget->verticalScrollBar(), &QScrollBar::valueChanged, QObject::connect(widget->verticalScrollBar(), &QScrollBar::valueChanged,
&DebuggerToolTipManager::slotUpdateVisibleToolTips); &DebuggerToolTipManager::updateVisibleToolTips);
QObject::connect(widget, &TextEditorWidget::tooltipOverrideRequested, QObject::connect(widget, &TextEditorWidget::tooltipOverrideRequested,
slotTooltipOverrideRequested); slotTooltipOverrideRequested);
} }
@@ -1252,14 +1252,14 @@ void DebuggerToolTipManager::debugModeEntered()
topLevel->installEventFilter(this); topLevel->installEventFilter(this);
EditorManager *em = EditorManager::instance(); EditorManager *em = EditorManager::instance();
connect(em, &EditorManager::currentEditorChanged, connect(em, &EditorManager::currentEditorChanged,
&DebuggerToolTipManager::slotUpdateVisibleToolTips); &DebuggerToolTipManager::updateVisibleToolTips);
connect(em, &EditorManager::editorOpened, slotEditorOpened); connect(em, &EditorManager::editorOpened, slotEditorOpened);
foreach (IEditor *e, DocumentModel::editorsForOpenedDocuments()) foreach (IEditor *e, DocumentModel::editorsForOpenedDocuments())
slotEditorOpened(e); slotEditorOpened(e);
// Position tooltips delayed once all the editor placeholder layouting is done. // Position tooltips delayed once all the editor placeholder layouting is done.
if (!m_tooltips.isEmpty()) if (!m_tooltips.isEmpty())
QTimer::singleShot(0, this, SLOT(slotUpdateVisibleToolTips())); QTimer::singleShot(0, this, &DebuggerToolTipManager::updateVisibleToolTips);
} }
} }

View File

@@ -94,9 +94,7 @@ public:
static void saveSessionData(); static void saveSessionData();
static void closeAllToolTips(); static void closeAllToolTips();
static void resetLocation(); static void resetLocation();
static void updateVisibleToolTips();
public slots:
static void slotUpdateVisibleToolTips();
}; };
} // namespace Internal } // namespace Internal

View File

@@ -262,8 +262,8 @@ void GdbCoreEngine::handleRoundTrip(const DebuggerResponse &response)
CHECK_STATE(InferiorUnrunnable); CHECK_STATE(InferiorUnrunnable);
Q_UNUSED(response); Q_UNUSED(response);
loadSymbolsForStack(); loadSymbolsForStack();
handleStop2(); handleStop3();
QTimer::singleShot(1000, this, SLOT(loadAllSymbols())); QTimer::singleShot(1000, this, &GdbEngine::loadAllSymbols);
} }
void GdbCoreEngine::interruptInferior() void GdbCoreEngine::interruptInferior()

View File

@@ -856,8 +856,8 @@ void GdbEngine::interruptInferior()
QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed()); QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed());
m_signalOperation = runParameters().device->signalOperation(); m_signalOperation = runParameters().device->signalOperation();
QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed()); QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed());
connect(m_signalOperation.data(), SIGNAL(finished(QString)), connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished,
SLOT(handleInterruptDeviceInferior(QString))); this, &GdbEngine::handleInterruptDeviceInferior);
m_signalOperation->setDebuggerCommand(runParameters().debuggerCommand); m_signalOperation->setDebuggerCommand(runParameters().debuggerCommand);
m_signalOperation->interruptProcess(inferiorPid()); m_signalOperation->interruptProcess(inferiorPid());
@@ -1637,10 +1637,10 @@ void GdbEngine::handleStop2(const GdbMi &data)
// Let the event loop run before deciding whether to update the stack. // Let the event loop run before deciding whether to update the stack.
m_stackNeeded = true; // setTokenBarrier() might reset this. m_stackNeeded = true; // setTokenBarrier() might reset this.
QTimer::singleShot(0, this, SLOT(handleStop2())); QTimer::singleShot(0, this, &GdbEngine::handleStop3);
} }
void GdbEngine::handleStop2() void GdbEngine::handleStop3()
{ {
DebuggerCommand cmd("-thread-info", Discardable); DebuggerCommand cmd("-thread-info", Discardable);
cmd.callback = CB(handleThreadInfo); cmd.callback = CB(handleThreadInfo);

View File

@@ -123,6 +123,7 @@ protected: ////////// Gdb Process Management //////////
private slots: private slots:
friend class GdbPlainEngine; friend class GdbPlainEngine;
friend class GdbCoreEngine;
void handleInterruptDeviceInferior(const QString &error); void handleInterruptDeviceInferior(const QString &error);
void handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus); void handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus);
void handleGdbError(QProcess::ProcessError error); void handleGdbError(QProcess::ProcessError error);
@@ -170,7 +171,7 @@ private: ////////// Gdb Command Management //////////
void runCommand(const DebuggerCommand &command) override; void runCommand(const DebuggerCommand &command) override;
private: private:
Q_SLOT void commandTimeout(); void commandTimeout();
void setTokenBarrier(); void setTokenBarrier();
// Sets up an "unexpected result" for the following commeand. // Sets up an "unexpected result" for the following commeand.
@@ -200,13 +201,13 @@ private:
private: ////////// Gdb Output, State & Capability Handling ////////// private: ////////// Gdb Output, State & Capability Handling //////////
protected: protected:
Q_SLOT void handleResponse(const QByteArray &buff); void handleResponse(const QByteArray &buff);
void handleAsyncOutput(const QByteArray &asyncClass, const GdbMi &result); void handleAsyncOutput(const QByteArray &asyncClass, const GdbMi &result);
void handleStopResponse(const GdbMi &data); void handleStopResponse(const GdbMi &data);
void handleResultRecord(DebuggerResponse *response); void handleResultRecord(DebuggerResponse *response);
void handleStop1(const GdbMi &data); void handleStop1(const GdbMi &data);
void handleStop2(const GdbMi &data); void handleStop2(const GdbMi &data);
Q_SLOT void handleStop2(); void handleStop3();
void resetCommandQueue(); void resetCommandQueue();
bool isSynchronous() const override { return true; } bool isSynchronous() const override { return true; }
@@ -289,7 +290,7 @@ private: ////////// View & Data Stuff //////////
// //
protected: protected:
void loadSymbols(const QString &moduleName) override; void loadSymbols(const QString &moduleName) override;
Q_SLOT void loadAllSymbols() override; void loadAllSymbols() override;
void loadSymbolsForStack() override; void loadSymbolsForStack() override;
void requestModuleSymbols(const QString &moduleName) override; void requestModuleSymbols(const QString &moduleName) override;
void requestModuleSections(const QString &moduleName) override; void requestModuleSections(const QString &moduleName) override;
@@ -309,7 +310,7 @@ private: ////////// View & Data Stuff //////////
// //
// Register specific stuff // Register specific stuff
// //
Q_SLOT void reloadRegisters() override; void reloadRegisters() override;
void setRegisterValue(const QByteArray &name, const QString &value) override; void setRegisterValue(const QByteArray &name, const QString &value) override;
void handleRegisterListNames(const DebuggerResponse &response); void handleRegisterListNames(const DebuggerResponse &response);
void handleRegisterListing(const DebuggerResponse &response); void handleRegisterListing(const DebuggerResponse &response);
@@ -355,8 +356,8 @@ protected:
void handleThreadInfo(const DebuggerResponse &response); void handleThreadInfo(const DebuggerResponse &response);
void handleThreadNames(const DebuggerResponse &response); void handleThreadNames(const DebuggerResponse &response);
DebuggerCommand stackCommand(int depth); DebuggerCommand stackCommand(int depth);
Q_SLOT void reloadStack(); void reloadStack();
Q_SLOT virtual void reloadFullStack() override; virtual void reloadFullStack() override;
virtual void loadAdditionalQmlStack() override; virtual void loadAdditionalQmlStack() override;
void handleQmlStackTrace(const DebuggerResponse &response); void handleQmlStackTrace(const DebuggerResponse &response);
int currentFrame() const; int currentFrame() const;
@@ -386,7 +387,7 @@ protected:
void handleThreadGroupCreated(const GdbMi &result); void handleThreadGroupCreated(const GdbMi &result);
void handleThreadGroupExited(const GdbMi &result); void handleThreadGroupExited(const GdbMi &result);
Q_SLOT void createFullBacktrace(); void createFullBacktrace();
void doUpdateLocals(const UpdateParameters &parameters) override; void doUpdateLocals(const UpdateParameters &parameters) override;
void handleFetchVariables(const DebuggerResponse &response); void handleFetchVariables(const DebuggerResponse &response);

View File

@@ -292,8 +292,8 @@ GdbOptionsPageWidget::GdbOptionsPageWidget()
//lineEditSelectedPluginBreakpointsPattern-> //lineEditSelectedPluginBreakpointsPattern->
// setEnabled(action(SelectedPluginBreakpoints)->value().toBool()); // setEnabled(action(SelectedPluginBreakpoints)->value().toBool());
//connect(radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)), //connect(radioButtonSelectedPluginBreakpoints, &QRadioButton::toggled,
// lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool))); // lineEditSelectedPluginBreakpointsPattern, &QLineEdit::setEnabled);
} }
GdbOptionsPage::GdbOptionsPage() GdbOptionsPage::GdbOptionsPage()

View File

@@ -162,9 +162,9 @@ private:
QHash<int, DebuggerCommand> m_commandForToken; QHash<int, DebuggerCommand> m_commandForToken;
// Console handling. // Console handling.
Q_SLOT void stubError(const QString &msg); void stubError(const QString &msg);
Q_SLOT void stubExited(); void stubExited();
Q_SLOT void stubStarted(); void stubStarted();
bool prepareCommand(); bool prepareCommand();
Utils::ConsoleProcess m_stubProc; Utils::ConsoleProcess m_stubProc;
}; };

View File

@@ -414,14 +414,14 @@ LogWindow::LogWindow(QWidget *parent)
aggregate->add(m_inputText); aggregate->add(m_inputText);
aggregate->add(new Core::BaseTextFind(m_inputText)); aggregate->add(new Core::BaseTextFind(m_inputText));
connect(m_inputText, SIGNAL(statusMessageRequested(QString,int)), connect(m_inputText, &InputPane::statusMessageRequested,
SIGNAL(statusMessageRequested(QString,int))); this, &LogWindow::statusMessageRequested);
connect(m_inputText, SIGNAL(commandSelected(int)), connect(m_inputText, &InputPane::commandSelected,
m_combinedText, SLOT(gotoResult(int))); m_combinedText, &CombinedPane::gotoResult);
connect(m_commandEdit, &QLineEdit::returnPressed, connect(m_commandEdit, &QLineEdit::returnPressed,
this, &LogWindow::sendCommand); this, &LogWindow::sendCommand);
connect(m_inputText, SIGNAL(executeLineRequested()), connect(m_inputText, &InputPane::executeLineRequested,
SLOT(executeLine())); this, &LogWindow::executeLine);
connect(repeatButton, &QAbstractButton::clicked, connect(repeatButton, &QAbstractButton::clicked,
this, &LogWindow::repeatLastCommand); this, &LogWindow::repeatLastCommand);

View File

@@ -32,8 +32,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCursor; class QCursor;
class QLabel;
class QLineEdit;
class QPlainTextEdit; class QPlainTextEdit;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -42,7 +40,8 @@ namespace Utils { class FancyLineEdit; }
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class DebuggerPane; class CombinedPane;
class InputPane;
class LogWindow : public QWidget class LogWindow : public QWidget
{ {
@@ -79,8 +78,8 @@ signals:
void statusMessageRequested(const QString &msg, int); void statusMessageRequested(const QString &msg, int);
private: private:
DebuggerPane *m_combinedText; // combined input/output CombinedPane *m_combinedText; // combined input/output
DebuggerPane *m_inputText; // scriptable input alone InputPane *m_inputText; // scriptable input alone
QTimer m_outputTimer; QTimer m_outputTimer;
QString m_queuedOutput; QString m_queuedOutput;
Utils::FancyLineEdit *m_commandEdit; Utils::FancyLineEdit *m_commandEdit;

View File

@@ -75,7 +75,7 @@ bool OutputCollector::listen()
if (m_server) if (m_server)
return m_server->isListening(); return m_server->isListening();
m_server = new QLocalServer(this); m_server = new QLocalServer(this);
connect(m_server, SIGNAL(newConnection()), SLOT(newConnectionAvailable())); connect(m_server, &QLocalServer::newConnection, this, &OutputCollector::newConnectionAvailable);
return m_server->listen(QString::fromLatin1("creator-%1-%2") return m_server->listen(QString::fromLatin1("creator-%1-%2")
.arg(QCoreApplication::applicationPid()) .arg(QCoreApplication::applicationPid())
.arg(rand())); .arg(rand()));
@@ -111,7 +111,7 @@ bool OutputCollector::listen()
return false; return false;
} }
m_serverNotifier = new QSocketNotifier(m_serverFd, QSocketNotifier::Read, this); m_serverNotifier = new QSocketNotifier(m_serverFd, QSocketNotifier::Read, this);
connect(m_serverNotifier, SIGNAL(activated(int)), SLOT(bytesAvailable())); connect(m_serverNotifier, &QSocketNotifier::activated, this, &OutputCollector::bytesAvailable);
return true; return true;
#endif #endif
} }
@@ -156,7 +156,7 @@ void OutputCollector::newConnectionAvailable()
if (m_socket) if (m_socket)
return; return;
m_socket = m_server->nextPendingConnection(); m_socket = m_server->nextPendingConnection();
connect(m_socket, SIGNAL(readyRead()), SLOT(bytesAvailable())); connect(m_socket, &QIODevice::readyRead, this, &OutputCollector::bytesAvailable);
} }
#endif #endif

View File

@@ -49,7 +49,7 @@ class OutputCollector : public QObject
public: public:
OutputCollector(QObject *parent = 0); OutputCollector(QObject *parent = 0);
~OutputCollector(); ~OutputCollector() override;
bool listen(); bool listen();
void shutdown(); void shutdown();
QString serverName() const; QString serverName() const;
@@ -58,14 +58,10 @@ public:
signals: signals:
void byteDelivery(const QByteArray &data); void byteDelivery(const QByteArray &data);
private slots: private:
void bytesAvailable(); void bytesAvailable();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
void newConnectionAvailable(); void newConnectionAvailable();
#endif
private:
#ifdef Q_OS_WIN
QLocalServer *m_server; QLocalServer *m_server;
QLocalSocket *m_socket; QLocalSocket *m_socket;
#else #else

View File

@@ -59,6 +59,7 @@
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
#include <utils/treemodel.h> #include <utils/treemodel.h>
#include <utils/basetreeview.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDebug> #include <QDebug>
@@ -248,8 +249,8 @@ QmlEngine::QmlEngine(const DebuggerRunParameters &startParameters, DebuggerEngin
this, &QmlEngine::updateCurrentContext); this, &QmlEngine::updateCurrentContext);
connect(stackHandler(), &StackHandler::currentIndexChanged, connect(stackHandler(), &StackHandler::currentIndexChanged,
this, &QmlEngine::updateCurrentContext); this, &QmlEngine::updateCurrentContext);
connect(inspectorView(), SIGNAL(currentIndexChanged(QModelIndex)), connect(inspectorView(), &WatchTreeView::currentIndexChanged,
SLOT(updateCurrentContext())); this, &QmlEngine::updateCurrentContext);
connect(&d->applicationLauncher, &ApplicationLauncher::processExited, connect(&d->applicationLauncher, &ApplicationLauncher::processExited,
this, &QmlEngine::disconnected); this, &QmlEngine::disconnected);
@@ -270,7 +271,8 @@ QmlEngine::QmlEngine(const DebuggerRunParameters &startParameters, DebuggerEngin
// then just try to connect (application output might be redirected / blocked) // then just try to connect (application output might be redirected / blocked)
d->noDebugOutputTimer.setSingleShot(true); d->noDebugOutputTimer.setSingleShot(true);
d->noDebugOutputTimer.setInterval(8000); d->noDebugOutputTimer.setInterval(8000);
connect(&d->noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(tryToConnect())); connect(&d->noDebugOutputTimer, &QTimer::timeout,
this, [this] { tryToConnect(); });
// we won't get any debug output // we won't get any debug output
if (startParameters.useTerminal) { if (startParameters.useTerminal) {
@@ -407,7 +409,7 @@ void QmlEngine::connectionStartupFailed()
{ {
if (d->retryOnConnectFail) { if (d->retryOnConnectFail) {
// retry after 3 seconds ... // retry after 3 seconds ...
QTimer::singleShot(3000, this, SLOT(beginConnection())); QTimer::singleShot(3000, this, [this] { beginConnection(); });
return; return;
} }

View File

@@ -33,12 +33,6 @@ namespace Internal {
class DebuggerEngine; class DebuggerEngine;
////////////////////////////////////////////////////////////////////////
//
// SnapshotModel
//
////////////////////////////////////////////////////////////////////////
class SnapshotHandler : public QAbstractTableModel class SnapshotHandler : public QAbstractTableModel
{ {
Q_OBJECT Q_OBJECT
@@ -68,7 +62,6 @@ private:
QVariant data(const QModelIndex &index, int role) const; QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;
Q_SLOT void resetModel() { beginResetModel(); endResetModel(); }
int m_currentIndex; int m_currentIndex;
QList< QPointer<DebuggerEngine> > m_snapshots; QList< QPointer<DebuggerEngine> > m_snapshots;

View File

@@ -83,7 +83,7 @@ private:
QVariant data(const QModelIndex &index, int role) const; QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;
Q_SLOT void resetModel() { beginResetModel(); endResetModel(); } void resetModel() { beginResetModel(); endResetModel(); }
DebuggerEngine *m_engine; DebuggerEngine *m_engine;
StackFrames m_stackFrames; StackFrames m_stackFrames;

View File

@@ -68,7 +68,7 @@ public:
void watchExpression(const QString &exp, const QString &name = QString()); void watchExpression(const QString &exp, const QString &name = QString());
void updateWatchExpression(WatchItem *item, const QByteArray &newExp); void updateWatchExpression(WatchItem *item, const QByteArray &newExp);
void watchVariable(const QString &exp); void watchVariable(const QString &exp);
Q_SLOT void clearWatches(); void clearWatches();
const WatchItem *watchItem(const QModelIndex &) const; const WatchItem *watchItem(const QModelIndex &) const;
void fetchMore(const QByteArray &iname) const; void fetchMore(const QByteArray &iname) const;

View File

@@ -1003,7 +1003,7 @@ void WatchTreeView::doItemsLayout()
m_sliderPosition = verticalScrollBar()->sliderPosition(); m_sliderPosition = verticalScrollBar()->sliderPosition();
Utils::BaseTreeView::doItemsLayout(); Utils::BaseTreeView::doItemsLayout();
if (m_sliderPosition) if (m_sliderPosition)
QTimer::singleShot(0, this, SLOT(adjustSlider())); QTimer::singleShot(0, this, &WatchTreeView::adjustSlider);
} }
void WatchTreeView::adjustSlider() void WatchTreeView::adjustSlider()
@@ -1056,8 +1056,9 @@ public:
m_lineEdit, &Utils::FancyLineEdit::onEditingFinished); m_lineEdit, &Utils::FancyLineEdit::onEditingFinished);
connect(m_buttons, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(m_buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_hint, SIGNAL(linkActivated(QString)), connect(m_hint, &QLabel::linkActivated, [](const QString &link) {
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString))); Core::HelpManager::handleHelpRequest(link);
});
} }
void setLabelText(const QString &text) void setLabelText(const QString &text)

View File

@@ -30,12 +30,6 @@
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
/////////////////////////////////////////////////////////////////////
//
// WatchWindow
//
/////////////////////////////////////////////////////////////////////
enum WatchType { LocalsType, InspectType, WatchersType, ReturnType, TooltipType }; enum WatchType { LocalsType, InspectType, WatchersType, ReturnType, TooltipType };
class WatchTreeView : public Utils::BaseTreeView class WatchTreeView : public Utils::BaseTreeView
@@ -53,7 +47,6 @@ public:
void fillFormatMenu(QMenu *, const QModelIndex &mi); void fillFormatMenu(QMenu *, const QModelIndex &mi);
static void reexpand(QTreeView *view, const QModelIndex &idx); static void reexpand(QTreeView *view, const QModelIndex &idx);
public slots:
void watchExpression(const QString &exp); void watchExpression(const QString &exp);
void watchExpression(const QString &exp, const QString &name); void watchExpression(const QString &exp, const QString &name);
void handleItemIsExpanded(const QModelIndex &idx); void handleItemIsExpanded(const QModelIndex &idx);
@@ -65,7 +58,7 @@ private:
void resetHelper(); void resetHelper();
void expandNode(const QModelIndex &idx); void expandNode(const QModelIndex &idx);
void collapseNode(const QModelIndex &idx); void collapseNode(const QModelIndex &idx);
Q_SLOT void adjustSlider(); // Used by single-shot timer. void adjustSlider();
void showUnprintable(int base); void showUnprintable(int base);
void doItemsLayout(); void doItemsLayout();