Commit 09b04caf authored by hjk's avatar hjk
Browse files

debugger: interface cleanup

parent d7cddd4e
......@@ -44,8 +44,8 @@
namespace Debugger {
namespace Internal {
AbstractGdbAdapter::AbstractGdbAdapter(GdbEngine *engine, QObject *parent)
: QObject(parent), m_engine(engine)
AbstractGdbAdapter::AbstractGdbAdapter(GdbEngine *engine)
: m_engine(engine)
{
}
......
......@@ -67,7 +67,7 @@ public:
DumperLoadedByGdb
};
explicit AbstractGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit AbstractGdbAdapter(GdbEngine *engine);
virtual ~AbstractGdbAdapter();
virtual void write(const QByteArray &data);
......@@ -99,6 +99,7 @@ public:
protected:
DebuggerState state() const;
GdbEngine *engine() const { return m_engine; }
const DebuggerStartParameters &startParameters() const;
DebuggerStartParameters &startParameters();
void showMessage(const QString &msg, int channel = LogDebug, int timeout = 1);
......
......@@ -52,9 +52,8 @@ namespace Internal {
static_cast<GdbEngine::AdapterCallback>(&AbstractPlainGdbAdapter::callback), \
STRINGIFY(callback)
AbstractPlainGdbAdapter::AbstractPlainGdbAdapter(GdbEngine *engine,
QObject *parent)
: AbstractGdbAdapter(engine, parent)
AbstractPlainGdbAdapter::AbstractPlainGdbAdapter(GdbEngine *engine)
: AbstractGdbAdapter(engine)
{
}
......
......@@ -45,7 +45,7 @@ class AbstractPlainGdbAdapter : public AbstractGdbAdapter
Q_OBJECT
public:
explicit AbstractPlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit AbstractPlainGdbAdapter(GdbEngine *engine);
virtual void setupInferior();
void runEngine();
......
......@@ -55,8 +55,8 @@ namespace Internal {
//
///////////////////////////////////////////////////////////////////////
AttachGdbAdapter::AttachGdbAdapter(GdbEngine *engine, QObject *parent)
: AbstractGdbAdapter(engine, parent)
AttachGdbAdapter::AttachGdbAdapter(GdbEngine *engine)
: AbstractGdbAdapter(engine)
{
}
......
......@@ -51,7 +51,7 @@ class AttachGdbAdapter : public AbstractGdbAdapter
Q_OBJECT
public:
explicit AttachGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit AttachGdbAdapter(GdbEngine *engine);
private:
DumperHandling dumperHandling() const { return DumperLoadedByGdb; }
......
......@@ -65,8 +65,8 @@ static QByteArray coreName(const DebuggerStartParameters &sp)
return fi.absoluteFilePath().toLocal8Bit();
}
CoreGdbAdapter::CoreGdbAdapter(GdbEngine *engine, QObject *parent)
: AbstractGdbAdapter(engine, parent),
CoreGdbAdapter::CoreGdbAdapter(GdbEngine *engine)
: AbstractGdbAdapter(engine),
m_executable(startParameters().executable),
m_coreName(coreName(startParameters()))
{}
......
......@@ -51,7 +51,7 @@ class CoreGdbAdapter : public AbstractGdbAdapter
Q_OBJECT
public:
explicit CoreGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit CoreGdbAdapter(GdbEngine *engine);
private:
DumperHandling dumperHandling() const { return DumperNotAvailable; }
......
......@@ -1832,7 +1832,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter()
case AttachCore:
return new CoreGdbAdapter(this);
case AttachToRemote:
return new RemoteGdbServerAdapter(this, sp.toolChainAbi);
return new RemoteGdbServerAdapter(this);
case StartRemoteGdb:
return new RemotePlainGdbAdapter(this);
case AttachExternal:
......
......@@ -54,8 +54,8 @@ namespace Internal {
//
///////////////////////////////////////////////////////////////////////
LocalPlainGdbAdapter::LocalPlainGdbAdapter(GdbEngine *engine, QObject *parent)
: AbstractPlainGdbAdapter(engine, parent)
LocalPlainGdbAdapter::LocalPlainGdbAdapter(GdbEngine *engine)
: AbstractPlainGdbAdapter(engine)
{
// Output
connect(&m_outputCollector, SIGNAL(byteDelivery(QByteArray)),
......
......@@ -52,7 +52,7 @@ class LocalPlainGdbAdapter : public AbstractPlainGdbAdapter
Q_OBJECT
public:
explicit LocalPlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit LocalPlainGdbAdapter(GdbEngine *engine);
private:
void startAdapter();
......
......@@ -59,11 +59,8 @@ namespace Internal {
//
///////////////////////////////////////////////////////////////////////
RemoteGdbServerAdapter::RemoteGdbServerAdapter(GdbEngine *engine,
const ProjectExplorer::Abi &abi,
QObject *parent) :
AbstractGdbAdapter(engine, parent),
m_abi(abi)
RemoteGdbServerAdapter::RemoteGdbServerAdapter(GdbEngine *engine)
: AbstractGdbAdapter(engine)
{
connect(&m_uploadProc, SIGNAL(error(QProcess::ProcessError)),
SLOT(uploadProcError(QProcess::ProcessError)));
......@@ -77,9 +74,11 @@ RemoteGdbServerAdapter::RemoteGdbServerAdapter(GdbEngine *engine,
AbstractGdbAdapter::DumperHandling RemoteGdbServerAdapter::dumperHandling() const
{
if (m_abi.os() == ProjectExplorer::Abi::SymbianOS
|| m_abi.os() == ProjectExplorer::Abi::WindowsOS
|| m_abi.binaryFormat() == ProjectExplorer::Abi::ElfFormat)
using namespace ProjectExplorer;
const Abi abi = startParameters().toolChainAbi;
if (abi.os() == Abi::SymbianOS
|| abi.os() == Abi::WindowsOS
|| abi.binaryFormat() == Abi::ElfFormat)
return DumperLoadedByGdb;
return DumperLoadedByGdbPreload;
}
......
......@@ -37,8 +37,6 @@
#include "abstractgdbadapter.h"
#include "localgdbprocess.h"
#include <projectexplorer/abi.h>
namespace Debugger {
namespace Internal {
......@@ -53,7 +51,7 @@ class RemoteGdbServerAdapter : public AbstractGdbAdapter
Q_OBJECT
public:
RemoteGdbServerAdapter(GdbEngine *engine, const ProjectExplorer::Abi &abi, QObject *parent = 0);
RemoteGdbServerAdapter(GdbEngine *engine);
private:
DumperHandling dumperHandling() const;
......@@ -95,8 +93,6 @@ private:
void handleTargetRemote(const GdbResponse &response);
void handleInterruptInferior(const GdbResponse &response);
const ProjectExplorer::Abi m_abi;
QProcess m_uploadProc;
LocalGdbProcess m_gdbProc;
};
......
......@@ -42,8 +42,8 @@
namespace Debugger {
namespace Internal {
RemotePlainGdbAdapter::RemotePlainGdbAdapter(GdbEngine *engine, QObject *parent)
: AbstractPlainGdbAdapter(engine, parent),
RemotePlainGdbAdapter::RemotePlainGdbAdapter(GdbEngine *engine)
: AbstractPlainGdbAdapter(engine),
m_gdbProc(engine->startParameters().connParams, this)
{
connect(&m_gdbProc, SIGNAL(started()), this, SLOT(handleGdbStarted()));
......
......@@ -46,7 +46,7 @@ class RemotePlainGdbAdapter : public AbstractPlainGdbAdapter
public:
friend class RemoteGdbProcess;
explicit RemotePlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit RemotePlainGdbAdapter(GdbEngine *engine);
private slots:
void handleGdbStarted();
......
......@@ -63,8 +63,8 @@ namespace Internal {
//
///////////////////////////////////////////////////////////////////////
TermGdbAdapter::TermGdbAdapter(GdbEngine *engine, QObject *parent)
: AbstractGdbAdapter(engine, parent)
TermGdbAdapter::TermGdbAdapter(GdbEngine *engine)
: AbstractGdbAdapter(engine)
{
m_stubProc.setMode(Utils::ConsoleProcess::Debug);
#ifdef Q_OS_UNIX
......
......@@ -53,7 +53,7 @@ class TermGdbAdapter : public AbstractGdbAdapter
Q_OBJECT
public:
explicit TermGdbAdapter(GdbEngine *engine, QObject *parent = 0);
explicit TermGdbAdapter(GdbEngine *engine);
~TermGdbAdapter();
private:
......
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