forked from qt-creator/qt-creator
purge completely dysfunctional debug-in-terminal code
This commit is contained in:
@@ -60,19 +60,6 @@ PlainGdbAdapter::PlainGdbAdapter(GdbEngine *engine, QObject *parent)
|
|||||||
{
|
{
|
||||||
commonInit();
|
commonInit();
|
||||||
|
|
||||||
m_stubProc.setMode(Utils::ConsoleProcess::Debug);
|
|
||||||
#ifdef Q_OS_UNIX
|
|
||||||
m_stubProc.setSettings(Core::ICore::instance()->settings());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
connect(&m_stubProc, SIGNAL(processError(QString)),
|
|
||||||
this, SLOT(stubError(QString)));
|
|
||||||
connect(&m_stubProc, SIGNAL(processStarted()),
|
|
||||||
this, SLOT(stubStarted()));
|
|
||||||
// FIXME:
|
|
||||||
// connect(&m_stubProc, SIGNAL(wrapperStopped()),
|
|
||||||
// m_manager, SLOT(exitDebugger()));
|
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
|
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
|
||||||
engine, SLOT(readDebugeeOutput(QByteArray)));
|
engine, SLOT(readDebugeeOutput(QByteArray)));
|
||||||
@@ -88,20 +75,8 @@ void PlainGdbAdapter::startAdapter()
|
|||||||
gdbArgs.prepend(_("mi"));
|
gdbArgs.prepend(_("mi"));
|
||||||
gdbArgs.prepend(_("-i"));
|
gdbArgs.prepend(_("-i"));
|
||||||
|
|
||||||
if (startParameters().useTerminal) {
|
|
||||||
m_stubProc.stop(); // We leave the console open, so recycle it now.
|
|
||||||
|
|
||||||
m_stubProc.setWorkingDirectory(startParameters().workingDir);
|
|
||||||
m_stubProc.setEnvironment(startParameters().environment);
|
|
||||||
if (!m_stubProc.start(startParameters().executable,
|
|
||||||
startParameters().processArgs)) {
|
|
||||||
// Error message for user is delivered via a signal.
|
|
||||||
emitAdapterStartFailed(QString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!m_outputCollector.listen()) {
|
if (!m_outputCollector.listen()) {
|
||||||
emitAdapterStartFailed(tr("Cannot set up communication with child process: %1")
|
emit adapterStartFailed(tr("Cannot set up communication with child process: %1")
|
||||||
.arg(m_outputCollector.errorString()));
|
.arg(m_outputCollector.errorString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -111,7 +86,6 @@ void PlainGdbAdapter::startAdapter()
|
|||||||
m_gdbProc.setWorkingDirectory(startParameters().workingDir);
|
m_gdbProc.setWorkingDirectory(startParameters().workingDir);
|
||||||
if (!startParameters().environment.isEmpty())
|
if (!startParameters().environment.isEmpty())
|
||||||
m_gdbProc.setEnvironment(startParameters().environment);
|
m_gdbProc.setEnvironment(startParameters().environment);
|
||||||
}
|
|
||||||
|
|
||||||
m_gdbProc.start(theDebuggerStringSetting(GdbLocation), gdbArgs);
|
m_gdbProc.start(theDebuggerStringSetting(GdbLocation), gdbArgs);
|
||||||
}
|
}
|
||||||
@@ -269,34 +243,5 @@ void PlainGdbAdapter::handleGdbFinished(int, QProcess::ExitStatus)
|
|||||||
emit adapterShutDown();
|
emit adapterShutDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainGdbAdapter::stubStarted()
|
|
||||||
{
|
|
||||||
const qint64 attachedPID = m_stubProc.applicationPID();
|
|
||||||
emit inferiorPidChanged(attachedPID);
|
|
||||||
m_engine->postCommand(_("attach %1").arg(attachedPID), CB(handleStubAttached));
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlainGdbAdapter::handleStubAttached(const GdbResponse &)
|
|
||||||
{
|
|
||||||
qDebug() << "STUB ATTACHED, FIXME";
|
|
||||||
//qq->notifyInferiorStopped();
|
|
||||||
//handleAqcuiredInferior();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlainGdbAdapter::stubError(const QString &msg)
|
|
||||||
{
|
|
||||||
QMessageBox::critical(m_engine->mainWindow(), tr("Debugger Error"), msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlainGdbAdapter::emitAdapterStartFailed(const QString &msg)
|
|
||||||
{
|
|
||||||
// QMessageBox::critical(mainWindow(), tr("Debugger Startup Failure"),
|
|
||||||
// tr("Cannot start debugger: %1").arg(m_gdbAdapter->errorString()));
|
|
||||||
bool blocked = m_stubProc.blockSignals(true);
|
|
||||||
m_stubProc.stop();
|
|
||||||
m_stubProc.blockSignals(blocked);
|
|
||||||
emit adapterStartFailed(msg, QString());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -34,8 +34,6 @@
|
|||||||
#include "gdbengine.h"
|
#include "gdbengine.h"
|
||||||
#include "outputcollector.h"
|
#include "outputcollector.h"
|
||||||
|
|
||||||
#include <consoleprocess.h>
|
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
|
||||||
@@ -67,17 +65,12 @@ private:
|
|||||||
void handleFileExecAndSymbols(const GdbResponse &response);
|
void handleFileExecAndSymbols(const GdbResponse &response);
|
||||||
void handleKill(const GdbResponse &response);
|
void handleKill(const GdbResponse &response);
|
||||||
void handleExit(const GdbResponse &response);
|
void handleExit(const GdbResponse &response);
|
||||||
void handleStubAttached(const GdbResponse &response);
|
|
||||||
void handleExecRun(const GdbResponse &response);
|
void handleExecRun(const GdbResponse &response);
|
||||||
|
|
||||||
void emitAdapterStartFailed(const QString &msg);
|
|
||||||
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus status);
|
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus status);
|
||||||
Q_SLOT void handleGdbError(QProcess::ProcessError error);
|
Q_SLOT void handleGdbError(QProcess::ProcessError error);
|
||||||
Q_SLOT void handleGdbStarted();
|
Q_SLOT void handleGdbStarted();
|
||||||
Q_SLOT void stubStarted();
|
|
||||||
Q_SLOT void stubError(const QString &msg);
|
|
||||||
|
|
||||||
Utils::ConsoleProcess m_stubProc;
|
|
||||||
OutputCollector m_outputCollector;
|
OutputCollector m_outputCollector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user