Commit 32e79e10 authored by hjk's avatar hjk
Browse files

debugger: rename TrkFunctor1 into Callback

parent 5f69a028
......@@ -87,7 +87,6 @@ include(cdb/cdb.pri)
include(gdb/gdb.pri)
include(script/script.pri)
include(tcf/tcf.pri)
include(symbian/symbian.pri)
include(shared/shared.pri)
OTHER_FILES += Debugger.pluginspec
......@@ -27,50 +27,50 @@
**
**************************************************************************/
#ifndef DEBUGGER_TRK_FUNCTOR_H
#define DEBUGGER_TRK_FUNCTOR_H
#ifndef DEBUGGER_CALLBACK_H
#define DEBUGGER_CALLBACK_H
#include <QtGlobal>
// FIXME: rename into something less TRK-specific
namespace trk {
namespace Debugger {
namespace Internal {
/* Helper class for the 1-argument functor:
* Cloneable base class for the implementation which is
* invokeable with the argument. */
template <class Argument>
class TrkFunctor1ImplBase {
Q_DISABLE_COPY(TrkFunctor1ImplBase)
class CallbackImplBase
{
Q_DISABLE_COPY(CallbackImplBase)
public:
TrkFunctor1ImplBase() {}
virtual TrkFunctor1ImplBase *clone() const = 0;
CallbackImplBase() {}
virtual CallbackImplBase *clone() const = 0;
virtual void invoke(Argument a) = 0;
virtual ~TrkFunctor1ImplBase() {}
virtual ~CallbackImplBase() {}
};
/* Helper class for the 1-argument functor: Implementation for
* a class instance with a member function pointer. */
template <class Klass, class Argument>
class TrkFunctor1MemberPtrImpl : public TrkFunctor1ImplBase<Argument> {
template <class Class, class Argument>
class CallbackMemberPtrImpl : public CallbackImplBase<Argument>
{
public:
typedef void (Klass::*MemberFuncPtr)(Argument);
typedef void (Class::*MemberFuncPtr)(Argument);
explicit TrkFunctor1MemberPtrImpl(Klass *instance,
MemberFuncPtr memberFunc) :
m_instance(instance),
m_memberFunc(memberFunc) {}
CallbackMemberPtrImpl(Class *instance,
MemberFuncPtr memberFunc) :
m_instance(instance),
m_memberFunc(memberFunc) {}
virtual TrkFunctor1ImplBase<Argument> *clone() const
virtual CallbackImplBase<Argument> *clone() const
{
return new TrkFunctor1MemberPtrImpl<Klass, Argument>(m_instance, m_memberFunc);
return new CallbackMemberPtrImpl<Class, Argument>(m_instance, m_memberFunc);
}
virtual void invoke(Argument a)
{ (m_instance->*m_memberFunc)(a); }
private:
Klass *m_instance;
Class *m_instance;
MemberFuncPtr m_memberFunc;
};
......@@ -85,33 +85,34 @@ public:
};
...
Foo foo;
TrkFunctor1<const std::string &> f1(&foo, &Foo::print);
Callback<const std::string &> f1(&foo, &Foo::print);
f1("test");
\endcode */
template <class Argument>
class TrkFunctor1 {
class Callback
{
public:
TrkFunctor1() : m_impl(0) {}
Callback() : m_impl(0) {}
template <class Klass>
TrkFunctor1(Klass *instance,
void (Klass::*memberFunc)(Argument)) :
m_impl(new Internal::TrkFunctor1MemberPtrImpl<Klass,Argument>(instance, memberFunc)) {}
template <class Class>
Callback(Class *instance, void (Class::*memberFunc)(Argument)) :
m_impl(new Internal::CallbackMemberPtrImpl<Class,Argument>(instance, memberFunc))
{}
~TrkFunctor1()
~Callback()
{
clean();
}
TrkFunctor1(const TrkFunctor1 &rhs) :
Callback(const Callback &rhs) :
m_impl(0)
{
if (rhs.m_impl)
m_impl = rhs.m_impl->clone();
}
TrkFunctor1 &operator=(const TrkFunctor1 &rhs)
Callback &operator=(const Callback &rhs)
{
if (this != &rhs) {
clean();
......@@ -121,7 +122,7 @@ public:
return *this;
}
inline bool isNull() const { return m_impl == 0; }
bool isNull() const { return m_impl == 0; }
operator bool() const { return !isNull(); }
void operator()(Argument a)
......@@ -139,9 +140,9 @@ private:
}
}
Internal::TrkFunctor1ImplBase<Argument> *m_impl;
Internal::CallbackImplBase<Argument> *m_impl;
};
} // namespace trk
} // namespace Debugger
#endif // _TRK_FUNCTOR_H_
#endif // DEBUGGER_CALLBACK_H
......@@ -3,11 +3,21 @@ HEADERS += \
$$PWD/gdbmi.h \
$$PWD/gdbengine.h \
$$PWD/gdboptionspage.h \
$$PWD/callback.h \
$$PWD/trkutils.h \
$$PWD/trkclient.h \
$$PWD/symbianadapter.h \
#$$PWD/gdboptionspage.h \
SOURCES += \
$$PWD/gdbmi.cpp \
$$PWD/gdbengine.cpp \
$$PWD/gdboptionspage.cpp \
$$PWD/trkutils.cpp \
$$PWD/trkclient.cpp \
$$PWD/symbianadapter.cpp \
$$PWD/symbianengine.cpp \
#$$PWD/gdboptionspage.cpp \
FORMS += $$PWD/gdboptionspage.ui
......
......@@ -29,7 +29,7 @@
#include "symbianadapter.h"
#ifndef STANDALONE_RUNNER
#include "gdb/gdbengine.h"
#include "gdbengine.h"
#endif
#define TrkCB(s) TrkCallback(this, &SymbianAdapter::s)
......@@ -75,7 +75,7 @@ SymbianAdapter::SymbianAdapter()
m_gdbAckMode = true;
m_verbose = 2;
m_serialFrame = false;
m_bufferedMemoryRead = true;
m_bufferedMemoryRead = false;
m_rfcommDevice = "/dev/rfcomm0";
uid_t userId = getuid();
......
......@@ -32,7 +32,7 @@
#include "trkutils.h"
#include "trkclient.h"
#include "../gdb/gdbprocessbase.h"
#include "gdbprocessbase.h"
#include <QtCore/QDebug>
#include <QtCore/QDir>
......@@ -79,8 +79,8 @@ class SymbianAdapter : public GdbProcessBase
public:
typedef trk::TrkResult TrkResult;
typedef trk::TrkFunctor1<const TrkResult &> TrkCallback;
typedef trk::TrkFunctor1<const GdbResult &> GdbCallback;
typedef Callback<const TrkResult &> TrkCallback;
typedef Callback<const GdbResult &> GdbCallback;
SymbianAdapter();
~SymbianAdapter();
......
......@@ -29,7 +29,7 @@
#define QT_NO_CAST_FROM_ASCII
#include "gdb/gdbengine.h"
#include "gdbengine.h"
#include "symbianadapter.h"
#include "debuggermanager.h"
......
......@@ -52,14 +52,17 @@ enum { TimerInterval = 100 };
#ifdef Q_OS_WIN
// Format windows error from GetLastError() value: TODO: Use the one provided by the utisl lib.
// Format windows error from GetLastError() value:
// TODO: Use the one provided by the utils lib.
QString winErrorMessage(unsigned long error)
{
QString rc = QString::fromLatin1("#%1: ").arg(error);
ushort *lpMsgBuf;
const int len = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
if (len) {
rc = QString::fromUtf16(lpMsgBuf, len);
......@@ -106,19 +109,17 @@ namespace trk {
* of the answer. */
struct TrkMessage
{
typedef TrkFunctor1<const TrkResult &> Callback;
explicit TrkMessage(byte code = 0u, byte token = 0u,
Callback callback = Callback());
TrkCallback callback = TrkCallback());
byte code;
byte token;
QByteArray data;
QVariant cookie;
Callback callback;
TrkCallback callback;
};
TrkMessage::TrkMessage(byte c, byte t, Callback cb) :
TrkMessage::TrkMessage(byte c, byte t, TrkCallback cb) :
code(c),
token(t),
callback(cb)
......@@ -135,12 +136,10 @@ TrkMessage::TrkMessage(byte c, byte t, Callback cb) :
class TrkWriteQueue
{
public:
typedef TrkDevice::Callback Callback;
TrkWriteQueue();
// Enqueue messages.
void queueTrkMessage(byte code, Callback callback,
void queueTrkMessage(byte code, TrkCallback callback,
const QByteArray &data, const QVariant &cookie);
void queueTrkInitialPing();
......@@ -179,7 +178,7 @@ byte TrkWriteQueue::nextTrkWriteToken()
return trkWriteToken;
}
void TrkWriteQueue::queueTrkMessage(byte code, Callback callback,
void TrkWriteQueue::queueTrkMessage(byte code, TrkCallback callback,
const QByteArray &data, const QVariant &cookie)
{
const byte token = code == TRK_WRITE_QUEUE_NOOP_CODE ?
......@@ -509,7 +508,7 @@ void TrkDevice::emitError(const QString &s)
emit error(s);
}
void TrkDevice::sendTrkMessage(byte code, Callback callback,
void TrkDevice::sendTrkMessage(byte code, TrkCallback callback,
const QByteArray &data, const QVariant &cookie)
{
d->queue.queueTrkMessage(code, callback, data, cookie);
......
......@@ -30,7 +30,7 @@
#ifndef TRKDEVICE_H
#define TRKDEVICE_H
#include "trkfunctor.h"
#include "callback.h"
#include <QtCore/QObject>
#include <QtCore/QVariant>
......@@ -60,6 +60,8 @@ struct TrkDevicePrivate;
enum { TRK_WRITE_QUEUE_NOOP_CODE = 0x7f };
typedef Debugger::Callback<const TrkResult &> TrkCallback;
class TrkDevice : public QObject
{
Q_OBJECT
......@@ -83,9 +85,6 @@ public:
bool write(const QByteArray &data, QString *errorMessage);
// Construct as 'TrkWriteQueueDevice::Callback(instance, &Klass::method);'
typedef TrkFunctor1<const TrkResult &> Callback;
signals:
void messageReceived(const trk::TrkResult &result);
// Emitted with the contents of messages enclosed in 07e, not for log output
......@@ -102,7 +101,7 @@ public:
// Enqueue a message with a notification callback.
void sendTrkMessage(unsigned char code,
Callback callBack = Callback(),
TrkCallback callBack = TrkCallback(),
const QByteArray &data = QByteArray(),
const QVariant &cookie = QVariant());
......
......@@ -104,7 +104,7 @@ class Adapter : public QObject
Q_OBJECT
public:
typedef TrkFunctor1<const TrkResult &> Callback;
typedef Debugger::Callback<const TrkResult &> TrkCallback;
Adapter();
~Adapter();
......@@ -129,7 +129,7 @@ private:
bool openTrkPort(const QString &port, QString *errorMessage); // or server name for local server
void sendTrkMessage(byte code,
Callback callBack = Callback(),
TrkCallback callBack = TrkCallback(),
const QByteArray &data = QByteArray(),
const QVariant &cookie = QVariant(),
bool invokeOnFailure = false);
......@@ -261,9 +261,9 @@ void Adapter::startServer()
sendTrkInitialPing();
sendTrkMessage(0x01); // Connect
sendTrkMessage(0x05, Callback(this, &Adapter::handleSupportMask));
sendTrkMessage(0x06, Callback(this, &Adapter::handleCpuType));
sendTrkMessage(0x04, Callback(this, &Adapter::handleTrkVersions)); // Versions
sendTrkMessage(0x05, TrkCallback(this, &Adapter::handleSupportMask));
sendTrkMessage(0x06, TrkCallback(this, &Adapter::handleCpuType));
sendTrkMessage(0x04, TrkCallback(this, &Adapter::handleTrkVersions)); // Versions
//sendTrkMessage(0x09); // Unrecognized command
//sendTrkMessage(0x4a, 0,
// "10 " + formatString("C:\\data\\usingdlls.sisx")); // Open File
......@@ -427,7 +427,7 @@ void Adapter::sendGdbMessage(const QByteArray &msg, const QByteArray &logNote)
void Adapter::sendGdbMessageAfterSync(const QByteArray &msg, const QByteArray &logNote)
{
QByteArray ba = msg + char(1) + logNote;
sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, Callback(this, &Adapter::reportToGdb), "", ba); // Answer gdb
sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, TrkCallback(this, &Adapter::reportToGdb), "", ba); // Answer gdb
}
void Adapter::reportToGdb(const TrkResult &result)
......@@ -492,7 +492,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
appendInt(&ba, 0); // end address
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x18, Callback(), ba);
sendTrkMessage(0x18, TrkCallback(), ba);
// FIXME: should be triggered by real stop
//sendGdbMessageAfterSync("S11", "target stopped");
}
......@@ -508,7 +508,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
QByteArray ba;
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x18, Callback(this, &Adapter::handleSignalContinue), ba, signalNumber); // Continue
sendTrkMessage(0x18, TrkCallback(this, &Adapter::handleSignalContinue), ba, signalNumber); // Continue
}
else if (response.startsWith("D")) {
......@@ -529,7 +529,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
appendShort(&ba, RegisterCount - 1); // last register
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x12, Callback(this, &Adapter::handleAndReportReadRegisters), ba, QVariant(), true);
sendTrkMessage(0x12, TrkCallback(this, &Adapter::handleAndReportReadRegisters), ba, QVariant(), true);
}
else if (response.startsWith("Hc")) {
......@@ -562,7 +562,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
QByteArray ba;
appendByte(&ba, 0); // Sub-command: Delete Process
appendInt(&ba, m_session.pid);
sendTrkMessage(0x41, Callback(), ba, "Delete process"); // Delete Item
sendTrkMessage(0x41, TrkCallback(), ba, "Delete process"); // Delete Item
sendGdbMessageAfterSync("", "process killed");
}
......@@ -740,7 +740,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
appendInt(&ba, m_snapshot.registers[RegisterPC] + 4); // end address
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x19, Callback(), ba, "Step range");
sendTrkMessage(0x19, TrkCallback(), ba, "Step range");
// FIXME: should be triggered by "real" stop"
//sendGdbMessageAfterSync("S05", "target halted");
}
......@@ -762,7 +762,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
QByteArray ba;
appendByte(&ba, 0); // Sub-command: Delete Process
appendInt(&ba, m_session.pid);
sendTrkMessage(0x41, Callback(), ba, "Delete process"); // Delete Item
sendTrkMessage(0x41, TrkCallback(), ba, "Delete process"); // Delete Item
sendGdbMessageAfterSync("", "process killed");
}
......@@ -789,7 +789,7 @@ void Adapter::handleGdbResponse(const QByteArray &response)
// [1B 09 82 00 78 67 43 40 00 00 00 01 00 00 00 00
// 00 00 01 B5 FF FF FF FF]
const QByteArray ba = breakpointTrkMessage(addr, len, m_session.pid);
sendTrkMessage(0x1B, Callback(this, &Adapter::handleAndReportSetBreakpoint), ba);
sendTrkMessage(0x1B, TrkCallback(this, &Adapter::handleAndReportSetBreakpoint), ba);
//m_session.toekn
//---TRK------------------------------------------------------
......@@ -852,7 +852,7 @@ bool Adapter::openTrkPort(const QString &port, QString *errorMessage)
return m_trkDevice->open(port, errorMessage);
}
void Adapter::sendTrkMessage(byte code, Callback callBack,
void Adapter::sendTrkMessage(byte code, TrkCallback callBack,
const QByteArray &data, const QVariant &cookie, bool invokeOnFailure)
{
if (m_useSocket)
......@@ -874,13 +874,13 @@ void Adapter::sendTrkContinue()
QByteArray ba;
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x18, Callback(), ba, "CONTINUE");
sendTrkMessage(0x18, TrkCallback(), ba, "CONTINUE");
}
void Adapter::waitForTrkFinished()
{
// initiate one last roundtrip to ensure all is flushed
sendTrkMessage(0x0, Callback(this, &Adapter::handleWaitForFinished));
sendTrkMessage(0x0, TrkCallback(this, &Adapter::handleWaitForFinished));
}
void Adapter::sendTrkAck(byte token)
......@@ -1032,7 +1032,7 @@ void Adapter::setTrkBreakpoint(const Breakpoint &bp)
// [1B 09 82 00 78 67 43 40 00 00 00 01 00 00 00 00
// 00 00 01 B5 FF FF FF FF]
const QByteArray ba = breakpointTrkMessage(m_session.codeseg + bp.offset, 1, m_session.pid);
sendTrkMessage(0x1B, Callback(this, &Adapter::handleSetTrkBreakpoint), ba);
sendTrkMessage(0x1B, TrkCallback(this, &Adapter::handleSetTrkBreakpoint), ba);
//---TRK------------------------------------------------------
// Command: 0x80 Acknowledge
......@@ -1088,10 +1088,10 @@ void Adapter::handleCreateProcess(const TrkResult &result)
// Command: 0x42 Read Info
// [42 0C 00 06 00 00 00 00 00 14 50 6F 6C 79 6D 6F
// 72 70 68 69 63 44 4C 4C 32 2E 64 6C 6C 00]
sendTrkMessage(0x42, Callback(this, &Adapter::handleReadInfo),
sendTrkMessage(0x42, TrkCallback(this, &Adapter::handleReadInfo),
"00 06 00 00 00 00 00 14 50 6F 6C 79 6D 6F "
"72 70 68 69 63 44 4C 4C 32 2E 64 6C 6C 00");
//sendTrkMessage(0x42, Callback(this, &Adapter::handleReadInfo),
//sendTrkMessage(0x42, TrkCallback(this, &Adapter::handleReadInfo),
// "00 01 00 00 00 00");
//---TRK------------------------------------------------------
// Command: 0x80 Acknowledge
......@@ -1103,7 +1103,7 @@ void Adapter::handleCreateProcess(const TrkResult &result)
// Command: 0x42 Read Info
// [42 0D 00 06 00 00 00 00 00 14 50 6F 6C 79 6D 6F
// 72 70 68 69 63 44 4C 4C 31 2E 64 6C 6C 00]
sendTrkMessage(0x42, Callback(this, &Adapter::handleReadInfo),
sendTrkMessage(0x42, TrkCallback(this, &Adapter::handleReadInfo),
"00 06 00 00 00 00 00 14 50 6F 6C 79 6D 6F "
"72 70 68 69 63 44 4C 4C 31 2E 64 6C 6C 00");
//---TRK------------------------------------------------------
......@@ -1112,7 +1112,7 @@ void Adapter::handleCreateProcess(const TrkResult &result)
// [80 0D 20]
#endif
//sendTrkMessage(0x18, Callback(this, &Adapter::handleStop),
//sendTrkMessage(0x18, TrkCallback(this, &Adapter::handleStop),
// "01 " + formatInt(m_session.pid) + formatInt(m_session.tid));
//---IDE------------------------------------------------------
......@@ -1123,8 +1123,8 @@ void Adapter::handleCreateProcess(const TrkResult &result)
QByteArray ba;
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid);
sendTrkMessage(0x18, Callback(this, &Adapter::handleContinue), ba);
//sendTrkMessage(0x18, Callback(this, &Adapter::handleContinue),
sendTrkMessage(0x18, TrkCallback(this, &Adapter::handleContinue), ba);
//sendTrkMessage(0x18, TrkCallback(this, &Adapter::handleContinue),
// formatInt(m_session.pid) + "ff ff ff ff");
//---TRK------------------------------------------------------
// Command: 0x80 Acknowledge
......@@ -1267,7 +1267,7 @@ void Adapter::clearTrkBreakpoint(const Breakpoint &bp)
appendByte(&ba, 0x00);
appendShort(&ba, bp.number);
appendInt(&ba, m_session.codeseg + bp.offset);
sendTrkMessage(0x1C, Callback(this, &Adapter::handleClearBreakpoint), ba);
sendTrkMessage(0x1C, TrkCallback(this, &Adapter::handleClearBreakpoint), ba);
}
void Adapter::handleClearBreakpoint(const TrkResult &result)
......@@ -1341,7 +1341,7 @@ void Adapter::cleanUp()
appendByte(&ba, 0x00);
appendByte(&ba, 0x00);
appendInt(&ba, m_session.pid);
sendTrkMessage(0x41, Callback(), ba, "Delete process");
sendTrkMessage(0x41, TrkCallback(), ba, "Delete process");
//---TRK------------------------------------------------------
// Command: 0x80 Acknowledge
......@@ -1351,7 +1351,7 @@ void Adapter::cleanUp()
foreach (const Breakpoint &bp, m_breakpoints)
clearTrkBreakpoint(bp);
sendTrkMessage(0x02, Callback(this, &Adapter::handleDisconnect));
sendTrkMessage(0x02, TrkCallback(this, &Adapter::handleDisconnect));
m_startInferiorTriggered = false;
//---IDE------------------------------------------------------
// Command: 0x1C Clear Break
......@@ -1382,7 +1382,7 @@ void Adapter::cleanUp()
//---IDE------------------------------------------------------
// Command: 0x02 Disconnect
// [02 27]
// sendTrkMessage(0x02, Callback(this, &Adapter::handleDisconnect));
// sendTrkMessage(0x02, TrkCallback(this, &Adapter::handleDisconnect));
//---TRK------------------------------------------------------
// Command: 0x80 Acknowledge
// Error: 0x00
......@@ -1413,17 +1413,17 @@ void Adapter::readMemory(uint addr, uint len)
if (!m_snapshot.memory.contains(blockaddr)) {
if (m_verbose)
logMessage(QString::fromLatin1("Requesting buffered memory %1 bytes from 0x%2").arg(MemoryChunkSize).arg(blockaddr, 0, 16));
sendTrkMessage(0x10, Callback(this, &Adapter::handleReadMemoryBuffered),
sendTrkMessage(0x10, TrkCallback(this, &Adapter::handleReadMemoryBuffered),
memoryRequestTrkMessage(blockaddr, MemoryChunkSize, m_session.pid, m_session.tid),
QVariant(blockaddr), true);
}
}
const qulonglong cookie = (qulonglong(addr) << 32) + len;
sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, Callback(this, &Adapter::reportReadMemoryBuffered), QByteArray(), cookie);
sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, TrkCallback(this, &Adapter::reportReadMemoryBuffered), QByteArray(), cookie);
} else {
if (m_verbose)
logMessage(QString::fromLatin1("Requesting unbuffered memory %1 bytes from 0x%2").arg(len).arg(addr, 0, 16));
sendTrkMessage(0x10, Callback(this, &Adapter::handleReadMemoryUnbuffered),
sendTrkMessage(0x10, TrkCallback(this, &Adapter::handleReadMemoryUnbuffered),
memoryRequestTrkMessage(addr, len, m_session.pid, m_session.tid),
QVariant(addr), true);
}
......@@ -1446,7 +1446,7 @@ void Adapter::startInferiorIfNeeded()
QByteArray file("C:\\sys\\bin\\filebrowseapp.exe");
appendString(&ba, file, TargetByteOrder);
sendTrkMessage(0x40, Callback(this, &Adapter::handleCreateProcess), ba); // Create Item
sendTrkMessage(0x40, TrkCallback(this, &Adapter::handleCreateProcess), ba); // Create Item
}
void Adapter::interruptInferior()
......@@ -1456,7 +1456,7 @@ void Adapter::interruptInferior()
appendByte(&ba, 1);
appendInt(&ba, m_session.pid);
appendInt(&ba, m_session.tid); // threadID: 4 bytes Variable number of bytes.
sendTrkMessage(0x1A, Callback(), ba, "Interrupting...");
sendTrkMessage(0x1A, TrkCallback(), ba, "Interrupting...");
}
static bool readAdapterArgs(const QStringList &args, AdapterOptions *o)
......
......@@ -11,7 +11,7 @@ win32:CONFIG+=console
HEADERS += \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkfunctor.h \
$$DEBUGGERHOME/callback.h \
$$PWD/trkdevice.h \
SOURCES += \
......
......@@ -40,7 +40,7 @@
namespace trk {
typedef TrkWriteQueueDevice::Callback Callback;
typedef TrkWriteQueueDevice::TrkCallback TrkCallback;
struct LauncherPrivate {
struct CopyState {
......@@ -125,9 +125,9 @@ bool Launcher::startServer(QString *errorMessage)
return false;
d->m_device.sendTrkInitialPing();
d->m_device.sendTrkMessage(TrkConnect); // Connect
d->m_device.sendTrkMessage(TrkSupported, Callback(this, &Launcher::handleSupportMask));
d->m_device.sendTrkMessage(TrkCpuType, Callback(this, &Launcher::handleCpuType));
d->m_device.sendTrkMessage(TrkVersions, Callback(this, &Launcher::handleTrkVersion));
d->m_device.sendTrkMessage(TrkSupported, TrkCallback(this, &Launcher::handleSupportMask));
d->m_device.sendTrkMessage(TrkCpuType, TrkCallback(this, &Launcher::handleCpuType));
d->m_device.sendTrkMessage(TrkVersions, TrkCallback(this, &Launcher::handleTrkVersion));
if (d->m_fileName.isEmpty())
return true;
if (!d->m_copyState.sourceFileName.isEmpty() && !d->m_copyState.destinationFileName.isEmpty())
......@@ -160,7 +160,7 @@ void Launcher::logMessage(const QString &msg)
void Launcher::waitForTrkFinished(const TrkResult &result)
{
Q_UNUSED(result)
d->m_device.sendTrkMessage(TrkPing, Callback(this, &Launcher::handleWaitForFinished));
d->m_device.sendTrkMessage(TrkPing, TrkCallback(this, &Launcher::handleWaitForFinished));
}
void Launcher::terminate()
......@@ -169,7 +169,7 @@ void Launcher::terminate()