Commit 81677fca authored by hjk's avatar hjk

Debugger: Move GdbEngine connections to constructor

In constrast to the LldbEngine this did properly disconnect
on restart, but moving it to the constructor avoid the need
to disconnect and follows the intended pattern.

Change-Id: I9a5727c1f6b76c0282de159251803f6ff5e76eb4
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent f318dcde
......@@ -211,6 +211,15 @@ GdbEngine::GdbEngine()
connect(action(UseDynamicType), &SavedAction::valueChanged,
this, &GdbEngine::reloadLocals);
connect(&m_gdbProc, &QProcess::errorOccurred,
this, &GdbEngine::handleGdbError);
connect(&m_gdbProc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &GdbEngine::handleGdbFinished);
connect(&m_gdbProc, &QtcProcess::readyReadStandardOutput,
this, &GdbEngine::readGdbStandardOutput);
connect(&m_gdbProc, &QtcProcess::readyReadStandardError,
this, &GdbEngine::readGdbStandardError);
// Output
connect(&m_outputCollector, &OutputCollector::byteDelivery,
this, &GdbEngine::readDebuggeeOutput);
......@@ -3745,7 +3754,6 @@ void GdbEngine::setupEngine()
foreach (int test, m_testCases)
showMessage("ENABLING TEST CASE: " + QString::number(test));
m_gdbProc.disconnect(); // From any previous runs
m_expectTerminalTrap = terminal();
const DebuggerRunParameters &rp = runParameters();
......@@ -3762,12 +3770,6 @@ void GdbEngine::setupEngine()
if (!boolSetting(LoadGdbInit))
gdbArgs << "-n";
connect(&m_gdbProc, &QProcess::errorOccurred, this, &GdbEngine::handleGdbError);
connect(&m_gdbProc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &GdbEngine::handleGdbFinished);
connect(&m_gdbProc, &QtcProcess::readyReadStandardOutput, this, &GdbEngine::readGdbStandardOutput);
connect(&m_gdbProc, &QtcProcess::readyReadStandardError, this, &GdbEngine::readGdbStandardError);
showMessage("STARTING " + rp.debugger.executable + " " + gdbArgs.join(' '));
m_gdbProc.setCommand(rp.debugger.executable, QtcProcess::joinArgs(gdbArgs));
if (QFileInfo(rp.debugger.workingDirectory).isDir())
......
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