Commit f318dcde authored by hjk's avatar hjk

Debugger: Move LldbEngine connections to constructor

Doing it on startup duplicates the connections on re-run.

Change-Id: Idccd039b4a005a96b9a20d99e663fc636b2e67c9
Reviewed-by: default avatarFilipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: default avatarhjk <hjk@qt.io>
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 5f09b323
......@@ -95,6 +95,18 @@ LldbEngine::LldbEngine()
this, &LldbEngine::updateLocals);
connect(action(IntelFlavor), &SavedAction::valueChanged,
this, &LldbEngine::updateAll);
connect(&m_lldbProc, &QProcess::errorOccurred,
this, &LldbEngine::handleLldbError);
connect(&m_lldbProc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &LldbEngine::handleLldbFinished);
connect(&m_lldbProc, &QProcess::readyReadStandardOutput,
this, &LldbEngine::readLldbStandardOutput);
connect(&m_lldbProc, &QProcess::readyReadStandardError,
this, &LldbEngine::readLldbStandardError);
connect(this, &LldbEngine::outputReady,
this, &LldbEngine::handleResponse, Qt::QueuedConnection);
}
LldbEngine::~LldbEngine()
......@@ -166,22 +178,8 @@ void LldbEngine::abortDebuggerProcess()
void LldbEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
startLldb();
}
void LldbEngine::startLldb()
{
QString lldbCmd = runParameters().debugger.executable;
connect(&m_lldbProc, &QProcess::errorOccurred, this, &LldbEngine::handleLldbError);
connect(&m_lldbProc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &LldbEngine::handleLldbFinished);
connect(&m_lldbProc, &QProcess::readyReadStandardOutput,
this, &LldbEngine::readLldbStandardOutput);
connect(&m_lldbProc, &QProcess::readyReadStandardError,
this, &LldbEngine::readLldbStandardError);
connect(this, &LldbEngine::outputReady,
this, &LldbEngine::handleResponse, Qt::QueuedConnection);
showMessage("STARTING LLDB: " + lldbCmd);
m_lldbProc.setEnvironment(runParameters().debugger.environment);
......
......@@ -72,7 +72,6 @@ private:
void executeNextI() override;
void setupEngine() override;
void startLldb();
void startLldbStage2();
void setupInferior() override;
void runEngine() override;
......
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