Commit ceb57574 authored by hjk's avatar hjk Committed by hjk

debugger: merge notifyEngineRemoteSetup* and handleRemoteSetup*

Change-Id: I89abcb0dcceef6767cb3e78f4e85c1cd718e78c1
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent d601e379
......@@ -84,7 +84,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.solibSearchPath.append(qtSoPaths(runConfig->activeQt4BuildConfiguration()->qtVersion()));
params.useServerStartScript = true;
params.requestRemoteSetup = true;
params.remoteSetupNeeded = true;
params.remoteArchitecture = QLatin1String("arm");
DebuggerRunControl * const debuggerRunControl
......@@ -124,14 +124,14 @@ void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlP
{
disconnect(m_runner, SIGNAL(remoteProcessStarted(int,int)),
this, SLOT(handleRemoteProcessStarted(int,int)));
m_runControl->engine()->handleRemoteSetupDone(gdbServerPort, qmlPort);
m_runControl->engine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
}
void AndroidDebugSupport::handleRemoteProcessFinished(const QString &errorMsg)
{
disconnect(m_runner, SIGNAL(remoteProcessFinished(const QString &)),
this,SLOT(handleRemoteProcessFinished(const QString &)));
m_runControl->engine()->handleRemoteSetupFailed(errorMsg);
m_runControl->engine()->notifyEngineRemoteSetupFailed(errorMsg);
}
void AndroidDebugSupport::handleRemoteOutput(const QByteArray &output)
......
......@@ -939,9 +939,10 @@ void DebuggerEngine::notifyEngineRequestRemoteSetup()
emit requestRemoteSetup();
}
void DebuggerEngine::notifyEngineRemoteSetupDone()
void DebuggerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
showMessage(_("NOTE: REMOTE SETUP DONE"));
showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
.arg(gdbServerPort).arg(qmlPort));
QTC_ASSERT(state() == EngineSetupRequested
|| state() == EngineSetupFailed
|| state() == DebuggerFinished, qDebug() << this << state());
......@@ -956,9 +957,9 @@ void DebuggerEngine::notifyEngineRemoteSetupDone()
d->setRemoteSetupState(RemoteSetupSucceeded);
}
void DebuggerEngine::notifyEngineRemoteSetupFailed()
void DebuggerEngine::notifyEngineRemoteSetupFailed(const QString &message)
{
showMessage(_("NOTE: REMOTE SETUP FAILED"));
showMessage(_("NOTE: REMOTE SETUP FAILED: ") + message);
QTC_ASSERT(state() == EngineSetupRequested
|| state() == EngineSetupFailed
|| state() == DebuggerFinished, qDebug() << this << state());
......@@ -1825,15 +1826,6 @@ void DebuggerEngine::openDisassemblerView(const Location &location)
agent->setLocation(location);
}
void DebuggerEngine::handleRemoteSetupDone(int /*gdbServerPort*/,
int /*qmlPort*/)
{
}
void DebuggerEngine::handleRemoteSetupFailed(const QString &/*message*/)
{
}
bool DebuggerEngine::isStateDebugging() const
{
return d->m_isStateDebugging;
......
......@@ -213,9 +213,6 @@ public:
const QString &expr, const QVariant &value);
virtual void selectThread(int index);
virtual void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
virtual void handleRemoteSetupFailed(const QString &message);
virtual Internal::ModulesHandler *modulesHandler() const;
virtual Internal::RegisterHandler *registerHandler() const;
virtual Internal::StackHandler *stackHandler() const;
......@@ -295,8 +292,8 @@ signals:
/*
* For "external" clients of a debugger run control that needs to do
* further setup before the debugger is started (e.g. Maemo).
* Afterwards, handleRemoteSetupDone() or handleRemoteSetupFailed() must be called
* to continue or abort debugging, respectively.
* Afterwards, notifyEngineRemoteSetupDone() or notifyEngineRemoteSetupFailed()
* must be called to continue or abort debugging, respectively.
* This signal is only emitted if the start parameters indicate that
* a server start script should be used, but none is given.
*/
......@@ -312,9 +309,11 @@ protected:
virtual void notifyEngineRunFailed();
virtual void notifyEngineRequestRemoteSetup();
virtual void notifyEngineRemoteSetupDone();
virtual void notifyEngineRemoteSetupFailed();
public:
virtual void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
virtual void notifyEngineRemoteSetupFailed(const QString &message);
protected:
virtual void notifyInferiorSetupOk();
virtual void notifyInferiorSetupFailed();
......
......@@ -66,7 +66,7 @@ public:
qmlServerAddress(QLatin1String("127.0.0.1")),
qmlServerPort(ProjectExplorer::Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
useServerStartScript(false),
requestRemoteSetup(false),
remoteSetupNeeded(false),
startMode(NoStartMode),
closeMode(KillAtClose),
executableUid(0),
......@@ -120,7 +120,7 @@ public:
QString remoteMountPoint;
QString localMountDir;
QSsh::SshConnectionParameters connParams;
bool requestRemoteSetup;
bool remoteSetupNeeded;
QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi;
......
......@@ -5163,19 +5163,6 @@ void GdbEngine::resetCommandQueue()
}
}
void GdbEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
{
Q_UNUSED(gdbServerPort);
Q_UNUSED(qmlPort);
notifyEngineRemoteSetupDone();
}
void GdbEngine::handleRemoteSetupFailed(const QString &message)
{
Q_UNUSED(message);
notifyEngineRemoteSetupFailed();
}
bool GdbEngine::setupQmlStep(bool on)
{
QTC_ASSERT(isSlaveEngine(), return false);
......
......@@ -233,8 +233,6 @@ protected: ////////// Gdb Process Management //////////
void reportEngineSetupOk(const GdbResponse &response);
void handleInferiorShutdown(const GdbResponse &response);
void handleGdbExit(const GdbResponse &response);
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
void handleRemoteSetupFailed(const QString &message);
void handleNamespaceExtraction(const GdbResponse &response);
void loadInitScript();
......
......@@ -96,7 +96,7 @@ void GdbRemoteServerEngine::setupEngine()
m_uploadProc.waitForStarted();
}
}
if (startParameters().requestRemoteSetup)
if (startParameters().remoteSetupNeeded)
notifyEngineRequestRemoteSetup();
else
startGdb();
......@@ -158,7 +158,7 @@ void GdbRemoteServerEngine::uploadProcFinished()
&& m_uploadProc.exitCode() == 0)
startGdb();
else
handleRemoteSetupFailed(m_uploadProc.errorString());
notifyEngineRemoteSetupFailed(m_uploadProc.errorString());
}
void GdbRemoteServerEngine::setupInferior()
......@@ -380,10 +380,10 @@ void GdbRemoteServerEngine::shutdownEngine()
notifyAdapterShutdownOk();
}
void GdbRemoteServerEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
void GdbRemoteServerEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
notifyEngineRemoteSetupDone();
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
......@@ -398,9 +398,10 @@ void GdbRemoteServerEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort
startGdb();
}
void GdbRemoteServerEngine::handleRemoteSetupFailed(const QString &reason)
void GdbRemoteServerEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFailed(reason);
handleAdapterStartFailed(reason);
}
......
......@@ -81,8 +81,8 @@ private:
Q_SLOT void uploadProcError(QProcess::ProcessError error);
Q_SLOT void uploadProcFinished();
virtual void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
virtual void handleRemoteSetupFailed(const QString &reason);
virtual void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
virtual void notifyEngineRemoteSetupFailed(const QString &reason);
void handleSetTargetAsync(const GdbResponse &response);
void handleFileExecAndSymbols(const GdbResponse &response);
......
......@@ -61,7 +61,7 @@ void GdbRemotePlainEngine::setupEngine()
if (startParameters().environment.size())
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
handleRemoteSetupDone(startParameters().connParams.port, startParameters().qmlServerPort);
notifyEngineRemoteSetupDone(startParameters().connParams.port, startParameters().qmlServerPort);
}
void GdbRemotePlainEngine::setupInferior()
......@@ -100,7 +100,7 @@ void GdbRemotePlainEngine::shutdownEngine()
notifyAdapterShutdownOk();
}
void GdbRemotePlainEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
void GdbRemotePlainEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
Q_UNUSED(gdbServerPort);
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
......@@ -122,7 +122,7 @@ void GdbRemotePlainEngine::handleGdbStartFailed1()
handleAdapterStartFailed(m_gdbProc.errorString());
}
void GdbRemotePlainEngine::handleRemoteSetupFailed(const QString &reason)
void GdbRemotePlainEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
handleAdapterStartFailed(reason);
......
......@@ -57,8 +57,8 @@ private:
void setupInferior();
void interruptInferior2();
void shutdownEngine();
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
void handleRemoteSetupFailed(const QString &reason);
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &reason);
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
DumperHandling dumperHandling() const { return DumperLoadedByGdbPreload; }
......
......@@ -436,7 +436,7 @@ void QmlCppEngine::setupEngine()
d->m_qmlEngine->setupSlaveEngine();
d->m_cppEngine->setupSlaveEngine();
if (startParameters().requestRemoteSetup)
if (startParameters().remoteSetupNeeded)
notifyEngineRequestRemoteSetup();
}
......@@ -777,21 +777,21 @@ void QmlCppEngine::slaveEngineStateChanged
}
}
void QmlCppEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
void QmlCppEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
EDEBUG("MASTER REMOTE SETUP DONE");
notifyEngineRemoteSetupDone();
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
cppEngine()->handleRemoteSetupDone(gdbServerPort, qmlPort);
qmlEngine()->handleRemoteSetupDone(gdbServerPort, qmlPort);
cppEngine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
qmlEngine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
}
void QmlCppEngine::handleRemoteSetupFailed(const QString &message)
void QmlCppEngine::notifyEngineRemoteSetupFailed(const QString &message)
{
EDEBUG("MASTER REMOTE SETUP FAILED");
notifyEngineRemoteSetupFailed();
notifyEngineRemoteSetupFailed(message);
cppEngine()->handleRemoteSetupFailed(message);
cppEngine()->notifyEngineRemoteSetupFailed(message);
}
void QmlCppEngine::showMessage(const QString &msg, int channel, int timeout) const
......
......@@ -90,8 +90,8 @@ public:
DebuggerEngine *cppEngine() const;
DebuggerEngine *qmlEngine() const;
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
void handleRemoteSetupFailed(const QString &message);
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &message);
void showMessage(const QString &msg, int channel = LogDebug,
int timeout = -1) const;
......
......@@ -627,14 +627,12 @@ void QmlEngine::stopApplicationLauncher()
}
}
void QmlEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
void QmlEngine::notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort)
{
Q_UNUSED(gdbServerPort);
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
notifyEngineRemoteSetupDone();
DebuggerEngine::notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
notifyEngineSetupOk();
// The remote setup can take while especialy with mixed debugging.
......@@ -644,13 +642,13 @@ void QmlEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
m_noDebugOutputTimer.setInterval(60000);
}
void QmlEngine::handleRemoteSetupFailed(const QString &message)
void QmlEngine::notifyEngineRemoteSetupFailed(const QString &message)
{
DebuggerEngine::notifyEngineRemoteSetupFailed(message);
if (isMasterEngine())
QMessageBox::critical(0,tr("Failed to start application"),
tr("Application startup failed: %1").arg(message));
notifyEngineRemoteSetupFailed();
notifyEngineSetupFailed();
}
......@@ -682,7 +680,7 @@ void QmlEngine::shutdownEngine()
void QmlEngine::setupEngine()
{
if (startParameters().requestRemoteSetup) {
if (startParameters().remoteSetupNeeded) {
// we need to get the port first
notifyEngineRequestRemoteSetup();
} else {
......
......@@ -66,8 +66,8 @@ public:
DebuggerEngine *masterEngine);
~QmlEngine();
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
void handleRemoteSetupFailed(const QString &message);
void notifyEngineRemoteSetupDone(int gdbServerPort, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &message);
bool canDisplayTooltip() const;
......
......@@ -87,7 +87,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
sp.remoteChannel = dev->serialPortName();
sp.processArgs = rc->commandLineArguments();
if (rc->debuggerAspect()->useQmlDebugger() && !rc->debuggerAspect()->useCppDebugger()) {
sp.requestRemoteSetup = true;
sp.remoteSetupNeeded = true;
sp.startMode = Debugger::AttachToRemoteServer;
} else {
sp.startMode = Debugger::StartInternal;
......@@ -181,7 +181,7 @@ void S60DeviceDebugRunControl::codaFinished()
m_codaRunControl = NULL;
}
if (m_codaState == EWaitingForCodaConnection) {
engine()->handleRemoteSetupFailed(QLatin1String("CODA failed to initialise")); // TODO sort out this error string? Unlikely we'll ever hit this state anyway.
engine()->notifyEngineRemoteSetupFailed(QLatin1String("CODA failed to initialise")); // TODO sort out this error string? Unlikely we'll ever hit this state anyway.
} else {
debuggingFinished();
}
......@@ -192,7 +192,7 @@ void S60DeviceDebugRunControl::codaConnected()
{
QTC_ASSERT(m_codaState == EWaitingForCodaConnection, return);
m_codaState = ECodaConnected;
engine()->handleRemoteSetupDone(-1, -1); // calls notifyInferiorSetupOk()
engine()->notifyEngineRemoteSetupDone(-1, -1); // calls notifyInferiorSetupOk()
}
void S60DeviceDebugRunControl::qmlEngineStateChanged(Debugger::DebuggerState state)
......
......@@ -120,7 +120,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
} else {
params.startMode = AttachToRemoteServer;
}
params.requestRemoteSetup = true;
params.remoteSetupNeeded = true;
params.displayName = runConfig->displayName();
if (const ProjectExplorer::Project *project = runConfig->target()->project()) {
......@@ -138,7 +138,7 @@ AbstractRemoteLinuxDebugSupport::AbstractRemoteLinuxDebugSupport(RunConfiguratio
DebuggerEngine *engine)
: QObject(engine), d(new AbstractRemoteLinuxDebugSupportPrivate(runConfig, engine))
{
connect(d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested()));
connect(d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested()));
}
AbstractRemoteLinuxDebugSupport::~AbstractRemoteLinuxDebugSupport()
......@@ -153,7 +153,7 @@ void AbstractRemoteLinuxDebugSupport::showMessage(const QString &msg, int channe
d->engine->showMessage(msg, channel);
}
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupRequested()
void AbstractRemoteLinuxDebugSupport::handleRemoteSetupRequested()
{
QTC_ASSERT(d->state == Inactive, return);
......@@ -235,7 +235,7 @@ void AbstractRemoteLinuxDebugSupport::handleRemoteProcessFinished(qint64 exitCod
const QString errorMsg = (d->qmlDebugging && !d->cppDebugging)
? tr("Remote application failed with exit code %1.").arg(exitCode)
: tr("The gdbserver process closed unexpectedly.");
d->engine->handleRemoteSetupFailed(errorMsg);
d->engine->notifyEngineRemoteSetupFailed(errorMsg);
}
}
......@@ -277,13 +277,13 @@ void AbstractRemoteLinuxDebugSupport::handleProgressReport(const QString &progre
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupFailed(const QString &error)
{
setFinished();
d->engine->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
d->engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
}
void AbstractRemoteLinuxDebugSupport::handleAdapterSetupDone()
{
d->state = Debugging;
d->engine->handleRemoteSetupDone(d->gdbServerPort, d->qmlPort);
d->engine->notifyEngineRemoteSetupDone(d->gdbServerPort, d->qmlPort);
}
void AbstractRemoteLinuxDebugSupport::handleRemoteProcessStarted()
......
......@@ -67,7 +67,7 @@ public:
~AbstractRemoteLinuxDebugSupport();
private slots:
void handleAdapterSetupRequested();
void handleRemoteSetupRequested();
void handleSshError(const QString &error);
void startExecution();
void handleDebuggingFinished();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment