forked from qt-creator/qt-creator
Debugger: Remove remote setup sub-statemachinery
Not needed anymore in the world of RunWorkers. Change-Id: Id7fb24fece6acb03de12f2677dd99a05c513e7a4 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -210,15 +210,6 @@ private:
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// transitions:
|
||||
// None->Requested
|
||||
// Requested->Succeeded
|
||||
// Requested->Failed
|
||||
// Requested->Cancelled
|
||||
enum RemoteSetupState { RemoteSetupNone, RemoteSetupRequested,
|
||||
RemoteSetupSucceeded, RemoteSetupFailed,
|
||||
RemoteSetupCancelled };
|
||||
|
||||
class DebuggerEnginePrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -331,12 +322,10 @@ public:
|
||||
|
||||
public:
|
||||
DebuggerState state() const { return m_state; }
|
||||
RemoteSetupState remoteSetupState() const { return m_remoteSetupState; }
|
||||
bool isMasterEngine() const { return m_engine->isMasterEngine(); }
|
||||
DebuggerRunTool *runTool() const
|
||||
{ return m_masterEngine ? m_masterEngine->runTool() : m_runTool.data(); }
|
||||
RunControl *runControl() const;
|
||||
void setRemoteSetupState(RemoteSetupState state);
|
||||
|
||||
DebuggerEngine *m_engine = nullptr; // Not owned.
|
||||
DebuggerEngine *m_masterEngine = nullptr; // Not owned
|
||||
@@ -348,9 +337,6 @@ public:
|
||||
// The state we had before something unexpected happend.
|
||||
DebuggerState m_lastGoodState = DebuggerNotReady;
|
||||
|
||||
// State of RemoteSetup signal/slots.
|
||||
RemoteSetupState m_remoteSetupState = RemoteSetupNone;
|
||||
|
||||
Terminal m_terminal;
|
||||
ProcessHandle m_inferiorPid;
|
||||
|
||||
@@ -757,13 +743,6 @@ void DebuggerEnginePrivate::doSetupEngine()
|
||||
void DebuggerEngine::notifyEngineSetupFailed()
|
||||
{
|
||||
showMessage("NOTE: ENGINE SETUP FAILED");
|
||||
QTC_ASSERT(d->remoteSetupState() == RemoteSetupNone
|
||||
|| d->remoteSetupState() == RemoteSetupRequested
|
||||
|| d->remoteSetupState() == RemoteSetupSucceeded,
|
||||
qDebug() << this << "remoteSetupState" << d->remoteSetupState());
|
||||
if (d->remoteSetupState() == RemoteSetupRequested)
|
||||
d->setRemoteSetupState(RemoteSetupCancelled);
|
||||
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||
setState(EngineSetupFailed);
|
||||
if (isMasterEngine() && runTool())
|
||||
@@ -774,10 +753,6 @@ void DebuggerEngine::notifyEngineSetupFailed()
|
||||
void DebuggerEngine::notifyEngineSetupOk()
|
||||
{
|
||||
showMessage("NOTE: ENGINE SETUP OK");
|
||||
QTC_ASSERT(d->remoteSetupState() == RemoteSetupNone
|
||||
|| d->remoteSetupState() == RemoteSetupSucceeded,
|
||||
qDebug() << this << "remoteSetupState" << d->remoteSetupState());
|
||||
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||
setState(EngineSetupOk);
|
||||
if (isMasterEngine() && runTool()) {
|
||||
@@ -862,67 +837,6 @@ void DebuggerEngine::notifyEngineRunFailed()
|
||||
d->queueShutdownEngine();
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineRequestRemoteSetup()
|
||||
{
|
||||
showMessage("NOTE: REQUEST REMOTE SETUP");
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||
QTC_ASSERT(d->remoteSetupState() == RemoteSetupNone, qDebug() << this
|
||||
<< "remoteSetupState" << d->remoteSetupState());
|
||||
|
||||
d->setRemoteSetupState(RemoteSetupRequested);
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineRemoteServerRunning(const QString &, int /*pid*/)
|
||||
{
|
||||
showMessage("NOTE: REMOTE SERVER RUNNING IN MULTIMODE");
|
||||
}
|
||||
|
||||
void DebuggerEngine::setRemoteParameters(const RemoteSetupResult &result)
|
||||
{
|
||||
showMessage(QString("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
|
||||
.arg(result.gdbServerPort.number()).arg(result.qmlServerPort.number()));
|
||||
|
||||
DebuggerRunParameters &rp = runParameters();
|
||||
if (result.gdbServerPort.isValid()) {
|
||||
QString &rc = rp.remoteChannel;
|
||||
const int sepIndex = rc.lastIndexOf(':');
|
||||
if (sepIndex != -1) {
|
||||
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
|
||||
QString::number(result.gdbServerPort.number()));
|
||||
}
|
||||
} else if (result.inferiorPid != InvalidPid && rp.startMode == AttachExternal) {
|
||||
// e.g. iOS Simulator
|
||||
rp.attachPID = ProcessHandle(result.inferiorPid);
|
||||
}
|
||||
|
||||
if (result.qmlServerPort.isValid()) {
|
||||
rp.qmlServer.port = result.qmlServerPort;
|
||||
rp.inferior.commandLineArguments.replace("%qml_port%",
|
||||
QString::number(result.qmlServerPort.number()));
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested
|
||||
|| state() == EngineSetupFailed
|
||||
|| state() == DebuggerFinished, qDebug() << this << state());
|
||||
|
||||
QTC_ASSERT(d->remoteSetupState() == RemoteSetupRequested
|
||||
|| d->remoteSetupState() == RemoteSetupCancelled,
|
||||
qDebug() << this << "remoteSetupState" << d->remoteSetupState());
|
||||
|
||||
if (result.success) {
|
||||
if (d->remoteSetupState() != RemoteSetupCancelled)
|
||||
d->setRemoteSetupState(RemoteSetupSucceeded);
|
||||
setRemoteParameters(result);
|
||||
} else {
|
||||
d->setRemoteSetupState(RemoteSetupFailed);
|
||||
showMessage("NOTE: REMOTE SETUP FAILED: " + result.reason);
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
|
||||
{
|
||||
showMessage("NOTE: ENGINE RUN AND INFERIOR RUN OK");
|
||||
@@ -1120,27 +1034,6 @@ RunControl *DebuggerEnginePrivate::runControl() const
|
||||
return tool ? tool->runControl() : nullptr;
|
||||
}
|
||||
|
||||
void DebuggerEnginePrivate::setRemoteSetupState(RemoteSetupState state)
|
||||
{
|
||||
bool allowedTransition = false;
|
||||
if (m_remoteSetupState == RemoteSetupNone) {
|
||||
if (state == RemoteSetupRequested)
|
||||
allowedTransition = true;
|
||||
}
|
||||
if (m_remoteSetupState == RemoteSetupRequested) {
|
||||
if (state == RemoteSetupCancelled
|
||||
|| state == RemoteSetupSucceeded
|
||||
|| state == RemoteSetupFailed)
|
||||
allowedTransition = true;
|
||||
}
|
||||
|
||||
|
||||
if (!allowedTransition)
|
||||
qDebug() << "*** UNEXPECTED REMOTE SETUP TRANSITION from"
|
||||
<< m_remoteSetupState << "to" << state;
|
||||
m_remoteSetupState = state;
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineIll()
|
||||
{
|
||||
runControl()->initiateStop();
|
||||
|
@@ -53,7 +53,6 @@ class ProcessHandle;
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
class RemoteSetupResult;
|
||||
class DebuggerRunTool;
|
||||
|
||||
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
|
||||
@@ -348,12 +347,6 @@ protected:
|
||||
virtual void notifyEngineSetupFailed();
|
||||
virtual void notifyEngineRunFailed();
|
||||
|
||||
virtual void notifyEngineRequestRemoteSetup();
|
||||
public:
|
||||
virtual void notifyEngineRemoteServerRunning(const QString &, int pid);
|
||||
virtual void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
||||
|
||||
protected:
|
||||
virtual void notifyInferiorSetupOk();
|
||||
virtual void notifyInferiorSetupFailed();
|
||||
|
||||
@@ -377,8 +370,6 @@ protected:
|
||||
void notifyDebuggerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus,
|
||||
const QString &backendName);
|
||||
|
||||
void setRemoteParameters(const RemoteSetupResult &result);
|
||||
|
||||
protected:
|
||||
virtual void setState(DebuggerState state, bool forced = false);
|
||||
|
||||
|
@@ -164,16 +164,6 @@ void DebuggerRunTool::startFailed()
|
||||
m_engine->handleStartFailed();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::notifyEngineRemoteServerRunning(const QByteArray &msg, int pid)
|
||||
{
|
||||
m_engine->notifyEngineRemoteServerRunning(QString::fromUtf8(msg), pid);
|
||||
}
|
||||
|
||||
void DebuggerRunTool::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
m_engine->notifyEngineRemoteSetupFinished(result);
|
||||
}
|
||||
|
||||
void DebuggerRunTool::stop()
|
||||
{
|
||||
m_isDying = true;
|
||||
@@ -181,16 +171,6 @@ void DebuggerRunTool::stop()
|
||||
m_engine->quitDebugger();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::onTargetFailure()
|
||||
{
|
||||
if (m_engine->state() == EngineSetupRequested) {
|
||||
RemoteSetupResult result;
|
||||
result.success = false;
|
||||
result.reason = tr("Initial setup failed.");
|
||||
m_engine->notifyEngineRemoteSetupFinished(result);
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerRunTool::debuggingFinished()
|
||||
{
|
||||
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
class RemoteSetupResult;
|
||||
class DebuggerStartParameters;
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
||||
@@ -66,9 +65,7 @@ public:
|
||||
void stop() override;
|
||||
|
||||
void startFailed();
|
||||
void onTargetFailure();
|
||||
void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
||||
|
||||
void notifyInferiorIll();
|
||||
Q_SLOT void notifyInferiorExited(); // Called from Android.
|
||||
void quitDebugger();
|
||||
@@ -85,7 +82,6 @@ public:
|
||||
int portsUsedByDebugger() const;
|
||||
|
||||
void appendSolibSearchPath(const QString &str);
|
||||
|
||||
signals:
|
||||
void aboutToNotifyInferiorSetupOk();
|
||||
|
||||
|
@@ -46,18 +46,6 @@ namespace Debugger {
|
||||
// Note: This is part of the "soft interface" of the debugger plugin.
|
||||
// Do not add anything that needs implementation in a .cpp file.
|
||||
|
||||
const qint64 InvalidPid = -1;
|
||||
|
||||
class DEBUGGER_EXPORT RemoteSetupResult
|
||||
{
|
||||
public:
|
||||
Utils::Port gdbServerPort;
|
||||
Utils::Port qmlServerPort;
|
||||
qint64 inferiorPid = InvalidPid;
|
||||
bool success = false;
|
||||
QString reason;
|
||||
};
|
||||
|
||||
class DEBUGGER_EXPORT TcpServerConnection
|
||||
{
|
||||
public:
|
||||
@@ -84,7 +72,6 @@ public:
|
||||
// Used by general remote debugging.
|
||||
QString remoteChannel;
|
||||
QSsh::SshConnectionParameters connParams;
|
||||
bool remoteSetupNeeded = false;
|
||||
bool useExtendedRemote = false; // Whether to use GDB's target extended-remote or not.
|
||||
QString symbolFile;
|
||||
|
||||
@@ -122,5 +109,4 @@ public:
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
Q_DECLARE_METATYPE(Debugger::RemoteSetupResult)
|
||||
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include <debugger/debuggeractions.h>
|
||||
#include <debugger/debuggercore.h>
|
||||
#include <debugger/debuggerprotocol.h>
|
||||
#include <debugger/debuggerstartparameters.h>
|
||||
#include <debugger/debuggerruncontrol.h>
|
||||
#include <debugger/procinterrupt.h>
|
||||
|
||||
#include <coreplugin/messagebox.h>
|
||||
@@ -84,14 +84,10 @@ void GdbRemoteServerEngine::setupEngine()
|
||||
|
||||
m_uploadProc.start(arglist);
|
||||
m_uploadProc.waitForStarted();
|
||||
m_uploadProc.waitForFinished();
|
||||
}
|
||||
|
||||
if (runParameters().remoteSetupNeeded) {
|
||||
notifyEngineRequestRemoteSetup();
|
||||
} else {
|
||||
m_startAttempted = true;
|
||||
startGdb();
|
||||
}
|
||||
startGdb();
|
||||
}
|
||||
|
||||
void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error)
|
||||
@@ -147,13 +143,9 @@ void GdbRemoteServerEngine::readUploadStandardError()
|
||||
void GdbRemoteServerEngine::uploadProcFinished()
|
||||
{
|
||||
if (m_uploadProc.exitStatus() == QProcess::NormalExit && m_uploadProc.exitCode() == 0) {
|
||||
if (!m_startAttempted)
|
||||
startGdb();
|
||||
// all good.
|
||||
} else {
|
||||
RemoteSetupResult result;
|
||||
result.success = false;
|
||||
result.reason = m_uploadProc.errorString();
|
||||
notifyEngineRemoteSetupFinished(result);
|
||||
runTool()->reportFailure(tr("Upload failed: %1").arg(m_uploadProc.errorString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,30 +451,5 @@ void GdbRemoteServerEngine::shutdownEngine()
|
||||
notifyAdapterShutdownOk();
|
||||
}
|
||||
|
||||
void GdbRemoteServerEngine::notifyEngineRemoteServerRunning
|
||||
(const QString &serverChannel, int inferiorPid)
|
||||
{
|
||||
// Currently only used by Android support.
|
||||
runParameters().attachPID = Utils::ProcessHandle(inferiorPid);
|
||||
runParameters().remoteChannel = serverChannel;
|
||||
runParameters().useExtendedRemote = true;
|
||||
showMessage("NOTE: REMOTE SERVER RUNNING IN MULTIMODE");
|
||||
m_startAttempted = true;
|
||||
startGdb();
|
||||
}
|
||||
|
||||
void GdbRemoteServerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
GdbEngine::notifyEngineRemoteSetupFinished(result);
|
||||
|
||||
if (result.success) {
|
||||
if (!m_startAttempted)
|
||||
startGdb();
|
||||
} else {
|
||||
handleAdapterStartFailed(result.reason);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
@@ -50,9 +50,6 @@ private:
|
||||
void uploadProcFinished();
|
||||
void callTargetRemote();
|
||||
|
||||
void notifyEngineRemoteServerRunning(const QString &serverChannel, int inferiorPid) override;
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
||||
|
||||
void handleSetTargetAsync(const DebuggerResponse &response);
|
||||
void handleFileExecAndSymbols(const DebuggerResponse &response);
|
||||
void handleTargetRemote(const DebuggerResponse &response);
|
||||
@@ -65,7 +62,6 @@ private:
|
||||
void handleExecRun(const DebuggerResponse &response);
|
||||
|
||||
QProcess m_uploadProc;
|
||||
bool m_startAttempted = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -226,13 +226,10 @@ void LldbEngine::setupEngine()
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
if (runParameters().remoteSetupNeeded)
|
||||
notifyEngineRequestRemoteSetup();
|
||||
else
|
||||
startLldb();
|
||||
}
|
||||
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
startLldb();
|
||||
}
|
||||
|
||||
void LldbEngine::startLldb()
|
||||
@@ -1119,24 +1116,6 @@ DebuggerEngine *createLldbEngine()
|
||||
return new LldbEngine;
|
||||
}
|
||||
|
||||
void LldbEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
|
||||
|
||||
if (result.success) {
|
||||
startLldb();
|
||||
} else {
|
||||
showMessage("ADAPTER START FAILED");
|
||||
if (!result.reason.isEmpty()) {
|
||||
const QString title = tr("Adapter start failed");
|
||||
ICore::showWarningWithOptions(title, result.reason);
|
||||
}
|
||||
notifyEngineSetupFailed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void LldbEngine::stubStarted()
|
||||
{
|
||||
startLldb();
|
||||
|
@@ -38,9 +38,7 @@
|
||||
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
#include <QQueue>
|
||||
#include <QMap>
|
||||
#include <QStack>
|
||||
#include <QVariant>
|
||||
|
||||
|
||||
@@ -139,8 +137,6 @@ private:
|
||||
void updateBreakpointData(Breakpoint bp, const GdbMi &bkpt, bool added);
|
||||
void fetchStack(int limit);
|
||||
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
||||
|
||||
void runCommand(const DebuggerCommand &cmd) override;
|
||||
void debugLastCommand() override;
|
||||
|
||||
|
@@ -376,9 +376,6 @@ void QmlCppEngine::setupEngine()
|
||||
m_activeEngine = m_cppEngine;
|
||||
m_qmlEngine->setupSlaveEngine();
|
||||
m_cppEngine->setupSlaveEngine();
|
||||
|
||||
if (runParameters().remoteSetupNeeded)
|
||||
notifyEngineRequestRemoteSetup();
|
||||
}
|
||||
|
||||
void QmlCppEngine::notifyEngineRunAndInferiorRunOk()
|
||||
@@ -411,11 +408,6 @@ void QmlCppEngine::notifyInferiorSetupOk()
|
||||
DebuggerEngine::notifyInferiorSetupOk();
|
||||
}
|
||||
|
||||
void QmlCppEngine::notifyEngineRemoteServerRunning(const QString &serverChannel, int pid)
|
||||
{
|
||||
m_cppEngine->notifyEngineRemoteServerRunning(serverChannel, pid);
|
||||
}
|
||||
|
||||
void QmlCppEngine::setupInferior()
|
||||
{
|
||||
EDEBUG("\nMASTER SETUP INFERIOR");
|
||||
@@ -723,15 +715,6 @@ void QmlCppEngine::slaveEngineStateChanged
|
||||
}
|
||||
}
|
||||
|
||||
void QmlCppEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
EDEBUG("MASTER REMOTE SETUP FINISHED");
|
||||
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
|
||||
|
||||
cppEngine()->notifyEngineRemoteSetupFinished(result);
|
||||
qmlEngine()->notifyEngineRemoteSetupFinished(result);
|
||||
}
|
||||
|
||||
void QmlCppEngine::resetLocation()
|
||||
{
|
||||
if (m_qmlEngine)
|
||||
|
@@ -83,7 +83,6 @@ public:
|
||||
DebuggerEngine *activeEngine() override { return m_activeEngine; }
|
||||
void setRunTool(DebuggerRunTool *runTool) override;
|
||||
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
||||
void resetLocation() override;
|
||||
void notifyInferiorIll() override;
|
||||
|
||||
@@ -121,7 +120,6 @@ protected:
|
||||
void notifyInferiorShutdownOk() override;
|
||||
|
||||
void notifyInferiorSetupOk() override;
|
||||
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
|
||||
void loadAdditionalQmlStack() override;
|
||||
|
||||
private:
|
||||
|
@@ -593,65 +593,38 @@ void QmlEngine::stopApplicationLauncher()
|
||||
}
|
||||
}
|
||||
|
||||
void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
||||
{
|
||||
QObject::disconnect(d->startupMessageFilterConnection);
|
||||
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
|
||||
// FIXME: Is the timeout raise still needed? Since the RunWorker conversion,
|
||||
// the debugger tool only starts when the remote setup has all interesting
|
||||
// ports gathered, so much less chance for waiting on longer operations.
|
||||
//void QmlEngine::notifyEngineRemoteSetupFinished()
|
||||
//{
|
||||
// QObject::disconnect(d->startupMessageFilterConnection);
|
||||
// switch (state()) {
|
||||
// case InferiorSetupOk:
|
||||
// // FIXME: This is not a legal transition, but we need to
|
||||
// // get to EngineSetupOk somehow from InferiorSetupOk.
|
||||
// // fallthrough. QTCREATORBUG-14089.
|
||||
// case EngineSetupRequested:
|
||||
// notifyEngineSetupOk();
|
||||
// break;
|
||||
// case EngineSetupOk:
|
||||
// case EngineRunRequested:
|
||||
// // QTCREATORBUG-17718: On Android while doing debugging in mixed mode, the QML debug engine
|
||||
// // sometimes reports EngineSetupOK after the EngineRunRequested thus overwriting the state
|
||||
// // which eventually results into app to waiting for the QML engine connection.
|
||||
// // Skipping the EngineSetupOK in aforementioned case.
|
||||
// // Nothing to do here. The setup is already done.
|
||||
// break;
|
||||
// default:
|
||||
// QTC_ASSERT(false, qDebug() << "Unexpected state" << state());
|
||||
// }
|
||||
|
||||
if (result.success) {
|
||||
if (result.qmlServerPort.isValid())
|
||||
runParameters().qmlServer.port = result.qmlServerPort;
|
||||
|
||||
switch (state()) {
|
||||
case InferiorSetupOk:
|
||||
// FIXME: This is not a legal transition, but we need to
|
||||
// get to EngineSetupOk somehow from InferiorSetupOk.
|
||||
// fallthrough. QTCREATORBUG-14089.
|
||||
case EngineSetupRequested:
|
||||
notifyEngineSetupOk();
|
||||
break;
|
||||
case EngineSetupOk:
|
||||
case EngineRunRequested:
|
||||
// QTCREATORBUG-17718: On Android while doing debugging in mixed mode, the QML debug engine
|
||||
// sometimes reports EngineSetupOK after the EngineRunRequested thus overwriting the state
|
||||
// which eventually results into app to waiting for the QML engine connection.
|
||||
// Skipping the EngineSetupOK in aforementioned case.
|
||||
// Nothing to do here. The setup is already done.
|
||||
break;
|
||||
default:
|
||||
QTC_ASSERT(false, qDebug() << "Unexpected state" << state());
|
||||
}
|
||||
|
||||
// The remote setup can take while especialy with mixed debugging.
|
||||
// Just waiting for 8 seconds is not enough. Increase the timeout
|
||||
// to 60 s
|
||||
// In case we get an output the d->outputParser will start the connection.
|
||||
d->noDebugOutputTimer.setInterval(60000);
|
||||
} else {
|
||||
if (isMasterEngine())
|
||||
QMessageBox::critical(ICore::dialogParent(), tr("Failed to start application"),
|
||||
tr("Application startup failed: %1").arg(result.reason));
|
||||
notifyEngineSetupFailed();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlEngine::notifyEngineRemoteServerRunning(const QString &serverChannel, int pid)
|
||||
{
|
||||
bool ok = false;
|
||||
quint16 qmlPort = serverChannel.toUInt(&ok);
|
||||
if (ok)
|
||||
runParameters().qmlServer.port = Utils::Port(qmlPort);
|
||||
else
|
||||
qWarning() << tr("QML debugging port not set: Unable to convert %1 to unsigned int.").arg(serverChannel);
|
||||
|
||||
DebuggerEngine::notifyEngineRemoteServerRunning(serverChannel, pid);
|
||||
notifyEngineSetupOk();
|
||||
|
||||
// The remote setup can take a while especially with mixed debugging.
|
||||
// Just waiting for 8 seconds is not enough. Increase the timeout to 60 s.
|
||||
// In case we get an output the d->outputParser will start the connection.
|
||||
d->noDebugOutputTimer.setInterval(60000);
|
||||
}
|
||||
// // The remote setup can take while especialy with mixed debugging.
|
||||
// // Just waiting for 8 seconds is not enough. Increase the timeout
|
||||
// // to 60 s
|
||||
// // In case we get an output the d->outputParser will start the connection.
|
||||
// d->noDebugOutputTimer.setInterval(60000);
|
||||
//}
|
||||
|
||||
void QmlEngine::shutdownInferior()
|
||||
{
|
||||
@@ -687,12 +660,7 @@ void QmlEngine::shutdownEngine()
|
||||
|
||||
void QmlEngine::setupEngine()
|
||||
{
|
||||
if (runParameters().remoteSetupNeeded) {
|
||||
// we need to get the port first
|
||||
notifyEngineRequestRemoteSetup();
|
||||
} else {
|
||||
notifyEngineSetupOk();
|
||||
}
|
||||
notifyEngineSetupOk();
|
||||
}
|
||||
|
||||
void QmlEngine::continueInferior()
|
||||
|
@@ -69,9 +69,6 @@ private:
|
||||
|
||||
void setState(DebuggerState state, bool forced) override;
|
||||
|
||||
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
|
||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
||||
|
||||
void gotoLocation(const Internal::Location &location) override;
|
||||
void insertBreakpoint(Breakpoint bp) override;
|
||||
|
||||
|
@@ -410,6 +410,11 @@ IosDebugSupport::IosDebugSupport(RunControl *runControl)
|
||||
|
||||
void IosDebugSupport::start()
|
||||
{
|
||||
if (!m_runner->isAppRunning()) {
|
||||
reportFailure(tr("Application not running."));
|
||||
return;
|
||||
}
|
||||
|
||||
RunConfiguration *runConfig = runControl()->runConfiguration();
|
||||
|
||||
DebuggerStartParameters params;
|
||||
@@ -447,7 +452,6 @@ void IosDebugSupport::start()
|
||||
|
||||
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runConfig);
|
||||
params.displayName = iosRunConfig->applicationName();
|
||||
params.remoteSetupNeeded = true;
|
||||
params.continueAfterAttach = true;
|
||||
|
||||
Utils::Port gdbServerPort = m_runner->gdbServerPort();
|
||||
@@ -458,10 +462,7 @@ void IosDebugSupport::start()
|
||||
const bool qmlDebug = isQmlDebugging();
|
||||
if (cppDebug) {
|
||||
params.inferior.executable = iosRunConfig->localExecutable().toString();
|
||||
if (gdbServerPort.isValid())
|
||||
params.remoteChannel = "connect://localhost:" + gdbServerPort.toString();
|
||||
else
|
||||
params.remoteChannel = "connect://localhost:0";
|
||||
params.remoteChannel = "connect://localhost:" + gdbServerPort.toString();
|
||||
|
||||
FileName xcodeInfo = IosConfigurations::developerPath().parentDir().appendPath("Info.plist");
|
||||
bool buggyLldb = false;
|
||||
@@ -506,20 +507,6 @@ void IosDebugSupport::start()
|
||||
|
||||
setStartParameters(params);
|
||||
|
||||
if (!m_runner->isAppRunning()) {
|
||||
reportFailure(tr("Application not running."));
|
||||
return;
|
||||
}
|
||||
|
||||
RemoteSetupResult result;
|
||||
if (m_runner->pid() > 0)
|
||||
result.inferiorPid = m_runner->pid();
|
||||
else
|
||||
result.gdbServerPort = gdbServerPort;
|
||||
result.qmlServerPort = qmlServerPort;
|
||||
result.success = true; // Port validation already checked.
|
||||
notifyEngineRemoteSetupFinished(result);
|
||||
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
|
@@ -90,7 +90,6 @@ void LinuxDeviceDebugSupport::start()
|
||||
DebuggerStartParameters params;
|
||||
params.startMode = AttachToRemoteServer;
|
||||
params.closeMode = KillAndExitMonitorAtClose;
|
||||
params.remoteSetupNeeded = false;
|
||||
|
||||
if (isQmlDebugging()) {
|
||||
params.qmlServer.host = host;
|
||||
|
Reference in New Issue
Block a user