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
|
class DebuggerEnginePrivate : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -331,12 +322,10 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerState state() const { return m_state; }
|
DebuggerState state() const { return m_state; }
|
||||||
RemoteSetupState remoteSetupState() const { return m_remoteSetupState; }
|
|
||||||
bool isMasterEngine() const { return m_engine->isMasterEngine(); }
|
bool isMasterEngine() const { return m_engine->isMasterEngine(); }
|
||||||
DebuggerRunTool *runTool() const
|
DebuggerRunTool *runTool() const
|
||||||
{ return m_masterEngine ? m_masterEngine->runTool() : m_runTool.data(); }
|
{ return m_masterEngine ? m_masterEngine->runTool() : m_runTool.data(); }
|
||||||
RunControl *runControl() const;
|
RunControl *runControl() const;
|
||||||
void setRemoteSetupState(RemoteSetupState state);
|
|
||||||
|
|
||||||
DebuggerEngine *m_engine = nullptr; // Not owned.
|
DebuggerEngine *m_engine = nullptr; // Not owned.
|
||||||
DebuggerEngine *m_masterEngine = nullptr; // Not owned
|
DebuggerEngine *m_masterEngine = nullptr; // Not owned
|
||||||
@@ -348,9 +337,6 @@ public:
|
|||||||
// The state we had before something unexpected happend.
|
// The state we had before something unexpected happend.
|
||||||
DebuggerState m_lastGoodState = DebuggerNotReady;
|
DebuggerState m_lastGoodState = DebuggerNotReady;
|
||||||
|
|
||||||
// State of RemoteSetup signal/slots.
|
|
||||||
RemoteSetupState m_remoteSetupState = RemoteSetupNone;
|
|
||||||
|
|
||||||
Terminal m_terminal;
|
Terminal m_terminal;
|
||||||
ProcessHandle m_inferiorPid;
|
ProcessHandle m_inferiorPid;
|
||||||
|
|
||||||
@@ -757,13 +743,6 @@ void DebuggerEnginePrivate::doSetupEngine()
|
|||||||
void DebuggerEngine::notifyEngineSetupFailed()
|
void DebuggerEngine::notifyEngineSetupFailed()
|
||||||
{
|
{
|
||||||
showMessage("NOTE: ENGINE SETUP FAILED");
|
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());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||||
setState(EngineSetupFailed);
|
setState(EngineSetupFailed);
|
||||||
if (isMasterEngine() && runTool())
|
if (isMasterEngine() && runTool())
|
||||||
@@ -774,10 +753,6 @@ void DebuggerEngine::notifyEngineSetupFailed()
|
|||||||
void DebuggerEngine::notifyEngineSetupOk()
|
void DebuggerEngine::notifyEngineSetupOk()
|
||||||
{
|
{
|
||||||
showMessage("NOTE: ENGINE SETUP OK");
|
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());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||||
setState(EngineSetupOk);
|
setState(EngineSetupOk);
|
||||||
if (isMasterEngine() && runTool()) {
|
if (isMasterEngine() && runTool()) {
|
||||||
@@ -862,67 +837,6 @@ void DebuggerEngine::notifyEngineRunFailed()
|
|||||||
d->queueShutdownEngine();
|
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()
|
void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
|
||||||
{
|
{
|
||||||
showMessage("NOTE: ENGINE RUN AND INFERIOR RUN OK");
|
showMessage("NOTE: ENGINE RUN AND INFERIOR RUN OK");
|
||||||
@@ -1120,27 +1034,6 @@ RunControl *DebuggerEnginePrivate::runControl() const
|
|||||||
return tool ? tool->runControl() : nullptr;
|
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()
|
void DebuggerEngine::notifyEngineIll()
|
||||||
{
|
{
|
||||||
runControl()->initiateStop();
|
runControl()->initiateStop();
|
||||||
|
@@ -53,7 +53,6 @@ class ProcessHandle;
|
|||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
class RemoteSetupResult;
|
|
||||||
class DebuggerRunTool;
|
class DebuggerRunTool;
|
||||||
|
|
||||||
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
|
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
|
||||||
@@ -348,12 +347,6 @@ protected:
|
|||||||
virtual void notifyEngineSetupFailed();
|
virtual void notifyEngineSetupFailed();
|
||||||
virtual void notifyEngineRunFailed();
|
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 notifyInferiorSetupOk();
|
||||||
virtual void notifyInferiorSetupFailed();
|
virtual void notifyInferiorSetupFailed();
|
||||||
|
|
||||||
@@ -377,8 +370,6 @@ protected:
|
|||||||
void notifyDebuggerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus,
|
void notifyDebuggerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus,
|
||||||
const QString &backendName);
|
const QString &backendName);
|
||||||
|
|
||||||
void setRemoteParameters(const RemoteSetupResult &result);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void setState(DebuggerState state, bool forced = false);
|
virtual void setState(DebuggerState state, bool forced = false);
|
||||||
|
|
||||||
|
@@ -164,16 +164,6 @@ void DebuggerRunTool::startFailed()
|
|||||||
m_engine->handleStartFailed();
|
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()
|
void DebuggerRunTool::stop()
|
||||||
{
|
{
|
||||||
m_isDying = true;
|
m_isDying = true;
|
||||||
@@ -181,16 +171,6 @@ void DebuggerRunTool::stop()
|
|||||||
m_engine->quitDebugger();
|
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()
|
void DebuggerRunTool::debuggingFinished()
|
||||||
{
|
{
|
||||||
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
|
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
|
||||||
class RemoteSetupResult;
|
|
||||||
class DebuggerStartParameters;
|
class DebuggerStartParameters;
|
||||||
|
|
||||||
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
||||||
@@ -66,9 +65,7 @@ public:
|
|||||||
void stop() override;
|
void stop() override;
|
||||||
|
|
||||||
void startFailed();
|
void startFailed();
|
||||||
void onTargetFailure();
|
|
||||||
void notifyEngineRemoteServerRunning(const QByteArray &msg, int pid);
|
|
||||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
|
||||||
void notifyInferiorIll();
|
void notifyInferiorIll();
|
||||||
Q_SLOT void notifyInferiorExited(); // Called from Android.
|
Q_SLOT void notifyInferiorExited(); // Called from Android.
|
||||||
void quitDebugger();
|
void quitDebugger();
|
||||||
@@ -85,7 +82,6 @@ public:
|
|||||||
int portsUsedByDebugger() const;
|
int portsUsedByDebugger() const;
|
||||||
|
|
||||||
void appendSolibSearchPath(const QString &str);
|
void appendSolibSearchPath(const QString &str);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void aboutToNotifyInferiorSetupOk();
|
void aboutToNotifyInferiorSetupOk();
|
||||||
|
|
||||||
|
@@ -46,18 +46,6 @@ namespace Debugger {
|
|||||||
// Note: This is part of the "soft interface" of the debugger plugin.
|
// Note: This is part of the "soft interface" of the debugger plugin.
|
||||||
// Do not add anything that needs implementation in a .cpp file.
|
// 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
|
class DEBUGGER_EXPORT TcpServerConnection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -84,7 +72,6 @@ public:
|
|||||||
// Used by general remote debugging.
|
// Used by general remote debugging.
|
||||||
QString remoteChannel;
|
QString remoteChannel;
|
||||||
QSsh::SshConnectionParameters connParams;
|
QSsh::SshConnectionParameters connParams;
|
||||||
bool remoteSetupNeeded = false;
|
|
||||||
bool useExtendedRemote = false; // Whether to use GDB's target extended-remote or not.
|
bool useExtendedRemote = false; // Whether to use GDB's target extended-remote or not.
|
||||||
QString symbolFile;
|
QString symbolFile;
|
||||||
|
|
||||||
@@ -122,5 +109,4 @@ public:
|
|||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Debugger::RemoteSetupResult)
|
|
||||||
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
|
Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters)
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include <debugger/debuggeractions.h>
|
#include <debugger/debuggeractions.h>
|
||||||
#include <debugger/debuggercore.h>
|
#include <debugger/debuggercore.h>
|
||||||
#include <debugger/debuggerprotocol.h>
|
#include <debugger/debuggerprotocol.h>
|
||||||
#include <debugger/debuggerstartparameters.h>
|
#include <debugger/debuggerruncontrol.h>
|
||||||
#include <debugger/procinterrupt.h>
|
#include <debugger/procinterrupt.h>
|
||||||
|
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
@@ -84,15 +84,11 @@ void GdbRemoteServerEngine::setupEngine()
|
|||||||
|
|
||||||
m_uploadProc.start(arglist);
|
m_uploadProc.start(arglist);
|
||||||
m_uploadProc.waitForStarted();
|
m_uploadProc.waitForStarted();
|
||||||
|
m_uploadProc.waitForFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runParameters().remoteSetupNeeded) {
|
|
||||||
notifyEngineRequestRemoteSetup();
|
|
||||||
} else {
|
|
||||||
m_startAttempted = true;
|
|
||||||
startGdb();
|
startGdb();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error)
|
void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error)
|
||||||
{
|
{
|
||||||
@@ -147,13 +143,9 @@ void GdbRemoteServerEngine::readUploadStandardError()
|
|||||||
void GdbRemoteServerEngine::uploadProcFinished()
|
void GdbRemoteServerEngine::uploadProcFinished()
|
||||||
{
|
{
|
||||||
if (m_uploadProc.exitStatus() == QProcess::NormalExit && m_uploadProc.exitCode() == 0) {
|
if (m_uploadProc.exitStatus() == QProcess::NormalExit && m_uploadProc.exitCode() == 0) {
|
||||||
if (!m_startAttempted)
|
// all good.
|
||||||
startGdb();
|
|
||||||
} else {
|
} else {
|
||||||
RemoteSetupResult result;
|
runTool()->reportFailure(tr("Upload failed: %1").arg(m_uploadProc.errorString()));
|
||||||
result.success = false;
|
|
||||||
result.reason = m_uploadProc.errorString();
|
|
||||||
notifyEngineRemoteSetupFinished(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,30 +451,5 @@ void GdbRemoteServerEngine::shutdownEngine()
|
|||||||
notifyAdapterShutdownOk();
|
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 Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -50,9 +50,6 @@ private:
|
|||||||
void uploadProcFinished();
|
void uploadProcFinished();
|
||||||
void callTargetRemote();
|
void callTargetRemote();
|
||||||
|
|
||||||
void notifyEngineRemoteServerRunning(const QString &serverChannel, int inferiorPid) override;
|
|
||||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
|
||||||
|
|
||||||
void handleSetTargetAsync(const DebuggerResponse &response);
|
void handleSetTargetAsync(const DebuggerResponse &response);
|
||||||
void handleFileExecAndSymbols(const DebuggerResponse &response);
|
void handleFileExecAndSymbols(const DebuggerResponse &response);
|
||||||
void handleTargetRemote(const DebuggerResponse &response);
|
void handleTargetRemote(const DebuggerResponse &response);
|
||||||
@@ -65,7 +62,6 @@ private:
|
|||||||
void handleExecRun(const DebuggerResponse &response);
|
void handleExecRun(const DebuggerResponse &response);
|
||||||
|
|
||||||
QProcess m_uploadProc;
|
QProcess m_uploadProc;
|
||||||
bool m_startAttempted = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -226,13 +226,10 @@ void LldbEngine::setupEngine()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
|
||||||
if (runParameters().remoteSetupNeeded)
|
|
||||||
notifyEngineRequestRemoteSetup();
|
|
||||||
else
|
|
||||||
startLldb();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
|
startLldb();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::startLldb()
|
void LldbEngine::startLldb()
|
||||||
@@ -1119,24 +1116,6 @@ DebuggerEngine *createLldbEngine()
|
|||||||
return new LldbEngine;
|
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()
|
void LldbEngine::stubStarted()
|
||||||
{
|
{
|
||||||
startLldb();
|
startLldb();
|
||||||
|
@@ -38,9 +38,7 @@
|
|||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QQueue>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QStack>
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
|
||||||
@@ -139,8 +137,6 @@ private:
|
|||||||
void updateBreakpointData(Breakpoint bp, const GdbMi &bkpt, bool added);
|
void updateBreakpointData(Breakpoint bp, const GdbMi &bkpt, bool added);
|
||||||
void fetchStack(int limit);
|
void fetchStack(int limit);
|
||||||
|
|
||||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
|
||||||
|
|
||||||
void runCommand(const DebuggerCommand &cmd) override;
|
void runCommand(const DebuggerCommand &cmd) override;
|
||||||
void debugLastCommand() override;
|
void debugLastCommand() override;
|
||||||
|
|
||||||
|
@@ -376,9 +376,6 @@ void QmlCppEngine::setupEngine()
|
|||||||
m_activeEngine = m_cppEngine;
|
m_activeEngine = m_cppEngine;
|
||||||
m_qmlEngine->setupSlaveEngine();
|
m_qmlEngine->setupSlaveEngine();
|
||||||
m_cppEngine->setupSlaveEngine();
|
m_cppEngine->setupSlaveEngine();
|
||||||
|
|
||||||
if (runParameters().remoteSetupNeeded)
|
|
||||||
notifyEngineRequestRemoteSetup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlCppEngine::notifyEngineRunAndInferiorRunOk()
|
void QmlCppEngine::notifyEngineRunAndInferiorRunOk()
|
||||||
@@ -411,11 +408,6 @@ void QmlCppEngine::notifyInferiorSetupOk()
|
|||||||
DebuggerEngine::notifyInferiorSetupOk();
|
DebuggerEngine::notifyInferiorSetupOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlCppEngine::notifyEngineRemoteServerRunning(const QString &serverChannel, int pid)
|
|
||||||
{
|
|
||||||
m_cppEngine->notifyEngineRemoteServerRunning(serverChannel, pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlCppEngine::setupInferior()
|
void QmlCppEngine::setupInferior()
|
||||||
{
|
{
|
||||||
EDEBUG("\nMASTER SETUP INFERIOR");
|
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()
|
void QmlCppEngine::resetLocation()
|
||||||
{
|
{
|
||||||
if (m_qmlEngine)
|
if (m_qmlEngine)
|
||||||
|
@@ -83,7 +83,6 @@ public:
|
|||||||
DebuggerEngine *activeEngine() override { return m_activeEngine; }
|
DebuggerEngine *activeEngine() override { return m_activeEngine; }
|
||||||
void setRunTool(DebuggerRunTool *runTool) override;
|
void setRunTool(DebuggerRunTool *runTool) override;
|
||||||
|
|
||||||
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
|
||||||
void resetLocation() override;
|
void resetLocation() override;
|
||||||
void notifyInferiorIll() override;
|
void notifyInferiorIll() override;
|
||||||
|
|
||||||
@@ -121,7 +120,6 @@ protected:
|
|||||||
void notifyInferiorShutdownOk() override;
|
void notifyInferiorShutdownOk() override;
|
||||||
|
|
||||||
void notifyInferiorSetupOk() override;
|
void notifyInferiorSetupOk() override;
|
||||||
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
|
|
||||||
void loadAdditionalQmlStack() override;
|
void loadAdditionalQmlStack() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -593,65 +593,38 @@ void QmlEngine::stopApplicationLauncher()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
|
// FIXME: Is the timeout raise still needed? Since the RunWorker conversion,
|
||||||
{
|
// the debugger tool only starts when the remote setup has all interesting
|
||||||
QObject::disconnect(d->startupMessageFilterConnection);
|
// ports gathered, so much less chance for waiting on longer operations.
|
||||||
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
|
//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) {
|
// // The remote setup can take while especialy with mixed debugging.
|
||||||
if (result.qmlServerPort.isValid())
|
// // Just waiting for 8 seconds is not enough. Increase the timeout
|
||||||
runParameters().qmlServer.port = result.qmlServerPort;
|
// // to 60 s
|
||||||
|
// // In case we get an output the d->outputParser will start the connection.
|
||||||
switch (state()) {
|
// d->noDebugOutputTimer.setInterval(60000);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlEngine::shutdownInferior()
|
void QmlEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
@@ -687,13 +660,8 @@ void QmlEngine::shutdownEngine()
|
|||||||
|
|
||||||
void QmlEngine::setupEngine()
|
void QmlEngine::setupEngine()
|
||||||
{
|
{
|
||||||
if (runParameters().remoteSetupNeeded) {
|
|
||||||
// we need to get the port first
|
|
||||||
notifyEngineRequestRemoteSetup();
|
|
||||||
} else {
|
|
||||||
notifyEngineSetupOk();
|
notifyEngineSetupOk();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void QmlEngine::continueInferior()
|
void QmlEngine::continueInferior()
|
||||||
{
|
{
|
||||||
|
@@ -69,9 +69,6 @@ private:
|
|||||||
|
|
||||||
void setState(DebuggerState state, bool forced) override;
|
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 gotoLocation(const Internal::Location &location) override;
|
||||||
void insertBreakpoint(Breakpoint bp) override;
|
void insertBreakpoint(Breakpoint bp) override;
|
||||||
|
|
||||||
|
@@ -410,6 +410,11 @@ IosDebugSupport::IosDebugSupport(RunControl *runControl)
|
|||||||
|
|
||||||
void IosDebugSupport::start()
|
void IosDebugSupport::start()
|
||||||
{
|
{
|
||||||
|
if (!m_runner->isAppRunning()) {
|
||||||
|
reportFailure(tr("Application not running."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RunConfiguration *runConfig = runControl()->runConfiguration();
|
RunConfiguration *runConfig = runControl()->runConfiguration();
|
||||||
|
|
||||||
DebuggerStartParameters params;
|
DebuggerStartParameters params;
|
||||||
@@ -447,7 +452,6 @@ void IosDebugSupport::start()
|
|||||||
|
|
||||||
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runConfig);
|
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runConfig);
|
||||||
params.displayName = iosRunConfig->applicationName();
|
params.displayName = iosRunConfig->applicationName();
|
||||||
params.remoteSetupNeeded = true;
|
|
||||||
params.continueAfterAttach = true;
|
params.continueAfterAttach = true;
|
||||||
|
|
||||||
Utils::Port gdbServerPort = m_runner->gdbServerPort();
|
Utils::Port gdbServerPort = m_runner->gdbServerPort();
|
||||||
@@ -458,10 +462,7 @@ void IosDebugSupport::start()
|
|||||||
const bool qmlDebug = isQmlDebugging();
|
const bool qmlDebug = isQmlDebugging();
|
||||||
if (cppDebug) {
|
if (cppDebug) {
|
||||||
params.inferior.executable = iosRunConfig->localExecutable().toString();
|
params.inferior.executable = iosRunConfig->localExecutable().toString();
|
||||||
if (gdbServerPort.isValid())
|
|
||||||
params.remoteChannel = "connect://localhost:" + gdbServerPort.toString();
|
params.remoteChannel = "connect://localhost:" + gdbServerPort.toString();
|
||||||
else
|
|
||||||
params.remoteChannel = "connect://localhost:0";
|
|
||||||
|
|
||||||
FileName xcodeInfo = IosConfigurations::developerPath().parentDir().appendPath("Info.plist");
|
FileName xcodeInfo = IosConfigurations::developerPath().parentDir().appendPath("Info.plist");
|
||||||
bool buggyLldb = false;
|
bool buggyLldb = false;
|
||||||
@@ -506,20 +507,6 @@ void IosDebugSupport::start()
|
|||||||
|
|
||||||
setStartParameters(params);
|
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();
|
DebuggerRunTool::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,7 +90,6 @@ void LinuxDeviceDebugSupport::start()
|
|||||||
DebuggerStartParameters params;
|
DebuggerStartParameters params;
|
||||||
params.startMode = AttachToRemoteServer;
|
params.startMode = AttachToRemoteServer;
|
||||||
params.closeMode = KillAndExitMonitorAtClose;
|
params.closeMode = KillAndExitMonitorAtClose;
|
||||||
params.remoteSetupNeeded = false;
|
|
||||||
|
|
||||||
if (isQmlDebugging()) {
|
if (isQmlDebugging()) {
|
||||||
params.qmlServer.host = host;
|
params.qmlServer.host = host;
|
||||||
|
Reference in New Issue
Block a user