forked from qt-creator/qt-creator
BareMetal: Avoid use of otherwise unneeded requestRemoteSetup() signal
Note that this changes the startup timing in the StartupOnNetwork case slightly, as the application launch is now triggered in parallel with the gdb launch. Change-Id: Iaa0b60b8c478eb47abb6e93fbd3b326e0acdd13b Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -118,22 +118,38 @@ void BareMetalDebugSupport::start()
|
||||
sp.remoteChannel = p->channel();
|
||||
sp.useContinueInsteadOfRun = true;
|
||||
|
||||
if (p->startupMode() == GdbServerProvider::StartupOnNetwork)
|
||||
sp.remoteSetupNeeded = true;
|
||||
setStartParameters(sp);
|
||||
|
||||
connect(this, &Debugger::DebuggerRunTool::requestRemoteSetup,
|
||||
this, &BareMetalDebugSupport::remoteSetupRequested);
|
||||
connect(runControl(), &RunControl::finished,
|
||||
this, &BareMetalDebugSupport::debuggingFinished);
|
||||
|
||||
DebuggerRunTool::start();
|
||||
if (p->startupMode() == GdbServerProvider::StartupOnNetwork) {
|
||||
m_state = StartingRunner;
|
||||
showMessage(tr("Starting GDB server...") + '\n', Debugger::LogStatus);
|
||||
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteStderr,
|
||||
this, &BareMetalDebugSupport::remoteErrorOutputMessage);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteStdout,
|
||||
this, &BareMetalDebugSupport::remoteOutputMessage);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteProcessStarted,
|
||||
this, &BareMetalDebugSupport::remoteProcessStarted);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::finished,
|
||||
this, &BareMetalDebugSupport::appRunnerFinished);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::reportProgress,
|
||||
this, &BareMetalDebugSupport::progressReport);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::reportError,
|
||||
this, &BareMetalDebugSupport::appRunnerError);
|
||||
|
||||
StandardRunnable r;
|
||||
r.executable = p->executable();
|
||||
// We need to wrap the command arguments depending on a host OS,
|
||||
// as the bare metal's GDB servers are launched on a host,
|
||||
// but not on a target.
|
||||
r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::HostOsInfo::hostOs());
|
||||
m_appLauncher->start(r, dev);
|
||||
}
|
||||
|
||||
void BareMetalDebugSupport::remoteSetupRequested()
|
||||
{
|
||||
QTC_ASSERT(m_state == Inactive, return);
|
||||
startExecution();
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
void BareMetalDebugSupport::debuggingFinished()
|
||||
@@ -213,39 +229,6 @@ void BareMetalDebugSupport::adapterSetupFailed(const QString &error)
|
||||
notifyEngineRemoteSetupFinished(result);
|
||||
}
|
||||
|
||||
void BareMetalDebugSupport::startExecution()
|
||||
{
|
||||
auto dev = qSharedPointerCast<const BareMetalDevice>(runControl()->device());
|
||||
QTC_ASSERT(dev, return);
|
||||
|
||||
const GdbServerProvider *p = GdbServerProviderManager::findProvider(dev->gdbServerProviderId());
|
||||
QTC_ASSERT(p, return);
|
||||
|
||||
m_state = StartingRunner;
|
||||
showMessage(tr("Starting GDB server...") + QLatin1Char('\n'), Debugger::LogStatus);
|
||||
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteStderr,
|
||||
this, &BareMetalDebugSupport::remoteErrorOutputMessage);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteStdout,
|
||||
this, &BareMetalDebugSupport::remoteOutputMessage);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::remoteProcessStarted,
|
||||
this, &BareMetalDebugSupport::remoteProcessStarted);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::finished,
|
||||
this, &BareMetalDebugSupport::appRunnerFinished);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::reportProgress,
|
||||
this, &BareMetalDebugSupport::progressReport);
|
||||
connect(m_appLauncher, &ProjectExplorer::ApplicationLauncher::reportError,
|
||||
this, &BareMetalDebugSupport::appRunnerError);
|
||||
|
||||
StandardRunnable r;
|
||||
r.executable = p->executable();
|
||||
// We need to wrap the command arguments depending on a host OS,
|
||||
// as the bare metal's GDB servers are launched on a host,
|
||||
// but not on a target.
|
||||
r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::HostOsInfo::hostOs());
|
||||
m_appLauncher->start(r, dev);
|
||||
}
|
||||
|
||||
void BareMetalDebugSupport::setFinished()
|
||||
{
|
||||
if (m_state == Inactive)
|
||||
|
||||
@@ -42,9 +42,9 @@ public:
|
||||
|
||||
private:
|
||||
enum State { Inactive, StartingRunner, Running };
|
||||
|
||||
void start() override;
|
||||
|
||||
void remoteSetupRequested();
|
||||
void debuggingFinished();
|
||||
void remoteOutputMessage(const QByteArray &output);
|
||||
void remoteErrorOutputMessage(const QByteArray &output);
|
||||
|
||||
@@ -870,7 +870,7 @@ void DebuggerEngine::notifyEngineRequestRemoteSetup()
|
||||
<< "remoteSetupState" << d->remoteSetupState());
|
||||
|
||||
d->setRemoteSetupState(RemoteSetupRequested);
|
||||
runTool()->doRemoteSetup();
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
void DebuggerEngine::notifyEngineRemoteServerRunning(const QString &, int /*pid*/)
|
||||
|
||||
@@ -84,12 +84,10 @@ public:
|
||||
bool isQmlDebugging() const { return m_isQmlDebugging; }
|
||||
int portsUsedByDebugger() const;
|
||||
|
||||
virtual void doRemoteSetup() { emit requestRemoteSetup(); }
|
||||
void appendSolibSearchPath(const QString &str);
|
||||
|
||||
signals:
|
||||
void aboutToNotifyInferiorSetupOk();
|
||||
void requestRemoteSetup();
|
||||
|
||||
private:
|
||||
Internal::DebuggerEngine *m_engine = nullptr; // Master engine
|
||||
|
||||
Reference in New Issue
Block a user