forked from qt-creator/qt-creator
move the output collector to the plain gdb adapter
doesn't make sense anywhere else
This commit is contained in:
@@ -183,10 +183,6 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
|
||||
m_trkOptions->fromSettings(Core::ICore::instance()->settings());
|
||||
m_gdbAdapter = 0;
|
||||
|
||||
// Output
|
||||
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
|
||||
this, SLOT(readDebugeeOutput(QByteArray)));
|
||||
|
||||
connect(this, SIGNAL(gdbOutputAvailable(int,QString)),
|
||||
m_manager, SLOT(showDebuggerOutput(int,QString)),
|
||||
Qt::QueuedConnection);
|
||||
@@ -1392,7 +1388,6 @@ QString GdbEngine::fullName(const QStringList &candidates)
|
||||
void GdbEngine::shutdown()
|
||||
{
|
||||
debugMessage(_("INITIATE GDBENGINE SHUTDOWN"));
|
||||
m_outputCollector.shutdown();
|
||||
initializeVariables();
|
||||
m_gdbAdapter->shutdown();
|
||||
}
|
||||
@@ -1410,7 +1405,6 @@ void GdbEngine::detachDebugger()
|
||||
void GdbEngine::exitDebugger() // called from the manager
|
||||
{
|
||||
disconnectDebuggingHelperActions();
|
||||
m_outputCollector.shutdown();
|
||||
initializeVariables();
|
||||
m_gdbAdapter->shutdown();
|
||||
}
|
||||
@@ -1467,43 +1461,6 @@ void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
|
||||
connectAdapter();
|
||||
|
||||
m_gdbAdapter->startAdapter();
|
||||
|
||||
/*
|
||||
QStringList gdbArgs;
|
||||
gdbArgs.prepend(_("mi"));
|
||||
gdbArgs.prepend(_("-i"));
|
||||
|
||||
if (startMode() == AttachCore || startMode() == AttachExternal
|
||||
|| startMode() == AttachCrashedExternal) {
|
||||
// nothing to do
|
||||
} else if (m_startParameters->useTerminal) {
|
||||
m_stubProc.stop(); // We leave the console open, so recycle it now.
|
||||
|
||||
m_stubProc.setWorkingDirectory(m_startParameters->workingDir);
|
||||
m_stubProc.setEnvironment(m_startParameters->environment);
|
||||
if (!m_stubProc.start(m_startParameters->executable,
|
||||
m_startParameters->processArgs)) {
|
||||
// Error message for user is delivered via a signal.
|
||||
emitStartFailed();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!m_outputCollector.listen()) {
|
||||
showMessageBox(QMessageBox::Critical, tr("Debugger Startup Failure"),
|
||||
tr("Cannot set up communication with child process: %1")
|
||||
.arg(m_outputCollector.errorString()));
|
||||
emitStartFailed();
|
||||
return;
|
||||
}
|
||||
gdbArgs.prepend(_("--tty=") + m_outputCollector.serverName());
|
||||
|
||||
if (!m_startParameters->workingDir.isEmpty())
|
||||
m_gdbAdapter->setWorkingDirectory(m_startParameters->workingDir);
|
||||
if (!m_startParameters->environment.isEmpty())
|
||||
m_gdbAdapter->setEnvironment(m_startParameters->environment);
|
||||
}
|
||||
m_gdbAdapter->start(loc, gdbArgs);
|
||||
*/
|
||||
}
|
||||
|
||||
void GdbEngine::continueInferior()
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include "debuggermanager.h" // only for StartParameters
|
||||
#include "gdbmi.h"
|
||||
#include "watchutils.h"
|
||||
#include "outputcollector.h"
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QHash>
|
||||
@@ -434,8 +433,6 @@ public:
|
||||
void addOptionPages(QList<Core::IOptionsPage*> *opts) const;
|
||||
const DebuggerStartParameters &startParameters() const
|
||||
{ return *m_startParameters; }
|
||||
|
||||
OutputCollector m_outputCollector;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -82,6 +82,10 @@ PlainGdbAdapter::PlainGdbAdapter(GdbEngine *engine, QObject *parent)
|
||||
// FIXME:
|
||||
// connect(&m_stubProc, SIGNAL(wrapperStopped()),
|
||||
// m_manager, SLOT(exitDebugger()));
|
||||
|
||||
// Output
|
||||
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
|
||||
engine, SLOT(readDebugeeOutput(QByteArray)));
|
||||
}
|
||||
|
||||
void PlainGdbAdapter::startAdapter()
|
||||
@@ -106,12 +110,12 @@ void PlainGdbAdapter::startAdapter()
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!m_engine->m_outputCollector.listen()) {
|
||||
if (!m_outputCollector.listen()) {
|
||||
emitAdapterStartFailed(tr("Cannot set up communication with child process: %1")
|
||||
.arg(m_engine->m_outputCollector.errorString()));
|
||||
.arg(m_outputCollector.errorString()));
|
||||
return;
|
||||
}
|
||||
gdbArgs.prepend(_("--tty=") + m_engine->m_outputCollector.serverName());
|
||||
gdbArgs.prepend(_("--tty=") + m_outputCollector.serverName());
|
||||
|
||||
if (!startParameters().workingDir.isEmpty())
|
||||
m_gdbProc.setWorkingDirectory(startParameters().workingDir);
|
||||
@@ -202,6 +206,7 @@ void PlainGdbAdapter::interruptInferior()
|
||||
void PlainGdbAdapter::shutdown()
|
||||
{
|
||||
debugMessage(_("PLAIN ADAPTER SHUTDOWN %1").arg(state()));
|
||||
m_outputCollector.shutdown();
|
||||
switch (state()) {
|
||||
|
||||
case InferiorRunningRequested:
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "abstractgdbadapter.h"
|
||||
#include "gdbengine.h"
|
||||
#include "outputcollector.h"
|
||||
|
||||
#include <consoleprocess.h>
|
||||
|
||||
@@ -82,6 +83,7 @@ private:
|
||||
|
||||
QProcess m_gdbProc;
|
||||
Utils::ConsoleProcess m_stubProc;
|
||||
OutputCollector m_outputCollector;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user