Commit 491a747e authored by hjk's avatar hjk

debugger: refactoring

rename GdbProcessBase into AbstractGdbAdapter
rename SymbianAdapter into TrkGdbAdapter
rename GdbProcess into PlainGdbAdapter
parent 5077794f
......@@ -27,8 +27,8 @@
**
**************************************************************************/
#ifndef DEBUGGER_PROCESSBASE_H
#define DEBUGGER_PROCESSBASE_H
#ifndef DEBUGGER_ABSTRACT_GDB_ADAPTER
#define DEBUGGER_ABSTRACT_GDB_ADAPTER
#include <QtCore/QObject>
#include <QtCore/QProcess>
......@@ -38,16 +38,17 @@ namespace Internal {
class GdbEngine;
// GdbProcessBase is inherited by GdbProcess and the gdb/trk Adapter.
// In the GdbProcess case it's just a wrapper around a QProcess running
// gdb, in the Adapter case it's the interface to the gdb process in
// AbstractGdbAdapter is inherited by PlainGdbAdapter used for local
// debugging and TrkGdbAdapter used for on-device debugging.
// In the PlainGdbAdapter case it's just a wrapper around a QProcess running
// gdb, in the TrkGdbAdapter case it's the interface to the gdb process in
// the whole rfomm/gdb/gdbserver combo.
class GdbProcessBase : public QObject
class AbstractGdbAdapter : public QObject
{
Q_OBJECT
public:
GdbProcessBase(QObject *parent = 0) : QObject(parent) {}
AbstractGdbAdapter(QObject *parent = 0) : QObject(parent) {}
virtual void start(const QString &program, const QStringList &args,
QIODevice::OpenMode mode = QIODevice::ReadWrite) = 0;
......@@ -77,4 +78,4 @@ signals:
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_PROCESSBASE_H
#endif // DEBUGGER_ABSTRACT_GDB_ADAPTER
HEADERS += \
$$PWD/gdbprocessbase.h \
$$PWD/abstractgdbadapter.h \
$$PWD/gdbmi.h \
$$PWD/gdbengine.h \
$$PWD/gdboptionspage.h \
$$PWD/callback.h \
$$PWD/trkutils.h \
$$PWD/trkclient.h \
$$PWD/symbianadapter.h \
$$PWD/trkgdbadapter.h \
#$$PWD/gdboptionspage.h \
SOURCES += \
......@@ -15,7 +15,7 @@ SOURCES += \
$$PWD/gdboptionspage.cpp \
$$PWD/trkutils.cpp \
$$PWD/trkclient.cpp \
$$PWD/symbianadapter.cpp \
$$PWD/trkgdbadapter.cpp \
#$$PWD/gdboptionspage.cpp \
FORMS += $$PWD/gdboptionspage.ui
......
This diff is collapsed.
......@@ -33,7 +33,7 @@
#include "idebuggerengine.h"
#include "debuggermanager.h" // only for StartParameters
#include "gdbmi.h"
#include "gdbprocessbase.h"
#include "abstractgdbadapter.h"
#include "outputcollector.h"
#include "watchutils.h"
......@@ -75,11 +75,11 @@ enum DebuggingHelperState
DebuggingHelperUnavailable,
};
class GdbProcess : public GdbProcessBase
class PlainGdbAdapter : public AbstractGdbAdapter
{
public:
GdbProcess(QObject *parent = 0)
: GdbProcessBase(parent)
PlainGdbAdapter(QObject *parent = 0)
: AbstractGdbAdapter(parent)
{
connect(&m_proc, SIGNAL(error(QProcess::ProcessError)),
this, SIGNAL(error(QProcess::ProcessError)));
......@@ -118,7 +118,7 @@ class GdbEngine : public IDebuggerEngine
Q_OBJECT
public:
GdbEngine(DebuggerManager *parent, GdbProcessBase *gdbProc);
GdbEngine(DebuggerManager *parent, AbstractGdbAdapter *gdbAdapter);
~GdbEngine();
signals:
......@@ -127,8 +127,8 @@ signals:
void applicationOutputAvailable(const QString &output);
private:
friend class GdbProcess;
friend class SymbianAdapter;
friend class PlainGdbAdapter;
friend class TrkGdbAdapter;
const DebuggerStartParameters &startParameters() const
{ return m_startParameters; }
......@@ -299,7 +299,7 @@ private:
QByteArray m_inbuffer;
GdbProcessBase *m_gdbProc;
AbstractGdbAdapter *m_gdbAdapter;
QProcess m_uploadProc;
Core::Utils::ConsoleProcess m_stubProc;
......
......@@ -27,12 +27,12 @@
**
**************************************************************************/
#ifndef DEBUGGER_SYMBIANADAPTER_H
#define DEBUGGER_SYMBIANADAPTER_H
#ifndef DEBUGGER_TRKGDBADAPTER_H
#define DEBUGGER_TRKGDBADAPTER_H
#include "trkutils.h"
#include "trkclient.h"
#include "gdbprocessbase.h"
#include "abstractgdbadapter.h"
#include <QtCore/QDebug>
#include <QtCore/QDir>
......@@ -69,11 +69,11 @@ struct GdbResult
///////////////////////////////////////////////////////////////////////
//
// SymbianAdapter
// TrkGdbAdapter
//
///////////////////////////////////////////////////////////////////////
class SymbianAdapter : public GdbProcessBase
class TrkGdbAdapter : public AbstractGdbAdapter
{
Q_OBJECT
......@@ -82,8 +82,8 @@ public:
typedef Callback<const TrkResult &> TrkCallback;
typedef Callback<const GdbResult &> GdbCallback;
SymbianAdapter();
~SymbianAdapter();
TrkGdbAdapter();
~TrkGdbAdapter();
void setGdbServerName(const QString &name);
QString gdbServerName() const { return m_gdbServerName; }
QString gdbServerIP() const;
......@@ -242,4 +242,4 @@ public:
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_SYMBIANADAPTER_H
#endif // DEBUGGER_TRKGDBADAPTER_H
......@@ -27,7 +27,7 @@
**
**************************************************************************/
#include "symbianadapter.h"
#include "trkgdbadapter.h"
#include <QtCore/QDebug>
......@@ -97,7 +97,7 @@ class RunnerGui : public QMainWindow
Q_OBJECT
public:
RunnerGui(SymbianAdapter *adapter);
RunnerGui(TrkGdbAdapter *adapter);
private slots:
void executeStepICommand() { executeCommand("-exec-step-instruction"); }
......@@ -118,7 +118,7 @@ private:
void executeCommand(const QString &cmd) { m_adapter->executeCommand(cmd); }
void connectAction(QAction *&, QString name, const char *slot);
SymbianAdapter *m_adapter;
TrkGdbAdapter *m_adapter;
TextEdit m_textEdit;
QToolBar m_toolBar;
QAction *m_stopAction;
......@@ -130,7 +130,7 @@ private:
QAction *m_continueAction;
};
RunnerGui::RunnerGui(SymbianAdapter *adapter)
RunnerGui::RunnerGui(TrkGdbAdapter *adapter)
: m_adapter(adapter)
{
resize(1200, 1000);
......@@ -224,7 +224,7 @@ void RunnerGui::started()
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
SymbianAdapter adapter;
TrkGdbAdapter adapter;
adapter.setVerbose(2);
RunnerGui gui(&adapter);
gui.show();
......
......@@ -11,13 +11,13 @@ QT += network
win32:CONFIG+=console
HEADERS += \
$$DEBUGGERHOME/../gdb/gdbprocessbase.h \
$$DEBUGGERHOME/../gdb/abstractgdbadapter.h \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkclient.h \
$$DEBUGGERHOME/symbianadapter.h \
$$DEBUGGERHOME/trkgdbadapter.h \
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$DEBUGGERHOME/trkclient.cpp \
$$DEBUGGERHOME/symbianadapter.cpp \
$$DEBUGGERHOME/trkgdbadapter.cpp \
$$PWD/runner.cpp \
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