debugger: refactoring

rename GdbResultRecord into GdbResponse
merge cookie QVariant into GdbResponse
move debugMessage convienience function from individual adapters to base
This commit is contained in:
hjk
2009-09-24 11:16:00 +02:00
parent f5c6f667d1
commit 8f6aa2259e
15 changed files with 312 additions and 330 deletions

View File

@@ -118,6 +118,8 @@ protected:
void setState(GdbAdapterState state); void setState(GdbAdapterState state);
const DebuggerStartParameters &startParameters() const const DebuggerStartParameters &startParameters() const
{ return m_engine->startParameters(); } { return m_engine->startParameters(); }
void debugMessage(const QString &msg) const
{ m_engine->debugMessage(msg); }
GdbEngine * const m_engine; GdbEngine * const m_engine;
GdbAdapterState m_state; GdbAdapterState m_state;

View File

@@ -102,16 +102,15 @@ void AttachGdbAdapter::handleGdbStarted()
void AttachGdbAdapter::prepareInferior() void AttachGdbAdapter::prepareInferior()
{ {
const qint64 pid = startParameters().attachPID;
QTC_ASSERT(state() == AdapterStarted, qDebug() << state()); QTC_ASSERT(state() == AdapterStarted, qDebug() << state());
setState(InferiorPreparing); setState(InferiorPreparing);
qDebug() << "USING " << pid; const qint64 pid = startParameters().attachPID;
m_engine->postCommand(_("attach %1").arg(pid), CB(handleAttach)); m_engine->postCommand(_("attach %1").arg(pid), CB(handleAttach));
// Task 254674 does not want to remove them // Task 254674 does not want to remove them
//qq->breakHandler()->removeAllBreakpoints(); //qq->breakHandler()->removeAllBreakpoints();
} }
void AttachGdbAdapter::handleAttach(const GdbResultRecord &response, const QVariant &) void AttachGdbAdapter::handleAttach(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
@@ -131,7 +130,7 @@ void AttachGdbAdapter::startInferior()
m_engine->postCommand(_("-exec-continue"), CB(handleContinue)); m_engine->postCommand(_("-exec-continue"), CB(handleContinue));
} }
void AttachGdbAdapter::handleContinue(const GdbResultRecord &response, const QVariant &) void AttachGdbAdapter::handleContinue(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultRunning) { if (response.resultClass == GdbResultRunning) {
@@ -169,7 +168,7 @@ void AttachGdbAdapter::shutdown()
QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state()); QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state());
} }
void AttachGdbAdapter::handleDetach(const GdbResultRecord &response, const QVariant &) void AttachGdbAdapter::handleDetach(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
setState(InferiorShutDown); setState(InferiorShutDown);
@@ -183,7 +182,7 @@ void AttachGdbAdapter::handleDetach(const GdbResultRecord &response, const QVari
} }
} }
void AttachGdbAdapter::handleExit(const GdbResultRecord &response, const QVariant &) void AttachGdbAdapter::handleExit(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished() // don't set state here, this will be handled in handleGdbFinished()

View File

@@ -67,12 +67,11 @@ private:
void interruptInferior(); void interruptInferior();
void shutdown(); void shutdown();
void handleAttach(const GdbResultRecord &, const QVariant &); void handleAttach(const GdbResponse &response);
void handleContinue(const GdbResultRecord &, const QVariant &); void handleContinue(const GdbResponse &response);
void handleDetach(const GdbResultRecord &, const QVariant &); void handleDetach(const GdbResponse &response);
void handleExit(const GdbResultRecord &, const QVariant &); void handleExit(const GdbResponse &response);
void debugMessage(const QString &msg) { m_engine->debugMessage(msg); }
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus); Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus);
Q_SLOT void handleGdbStarted(); Q_SLOT void handleGdbStarted();

View File

@@ -112,7 +112,7 @@ void CoreGdbAdapter::prepareInferior()
CB(handleFileExecAndSymbols)); CB(handleFileExecAndSymbols));
} }
void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResultRecord &response, const QVariant &) void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
@@ -139,7 +139,7 @@ void CoreGdbAdapter::startInferior()
m_engine->postCommand(_("target core ") + coreName, CB(handleTargetCore)); m_engine->postCommand(_("target core ") + coreName, CB(handleTargetCore));
} }
void CoreGdbAdapter::handleTargetCore(const GdbResultRecord &response, const QVariant &) void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
@@ -170,7 +170,7 @@ void CoreGdbAdapter::shutdown()
QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state()); QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state());
} }
void CoreGdbAdapter::handleExit(const GdbResultRecord &response, const QVariant &) void CoreGdbAdapter::handleExit(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished() // don't set state here, this will be handled in handleGdbFinished()

View File

@@ -67,11 +67,10 @@ private:
void interruptInferior(); void interruptInferior();
void shutdown(); void shutdown();
void handleFileExecAndSymbols(const GdbResultRecord &, const QVariant &); void handleFileExecAndSymbols(const GdbResponse &response);
void handleTargetCore(const GdbResultRecord &response, const QVariant &); void handleTargetCore(const GdbResponse &response);
void handleExit(const GdbResultRecord &, const QVariant &); void handleExit(const GdbResponse &response);
void debugMessage(const QString &msg) { m_engine->debugMessage(msg); }
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus); Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus);
Q_SLOT void handleGdbStarted(); Q_SLOT void handleGdbStarted();

File diff suppressed because it is too large Load Diff

View File

@@ -59,7 +59,7 @@ namespace Internal {
class AbstractGdbAdapter; class AbstractGdbAdapter;
class DebuggerManager; class DebuggerManager;
class IDebuggerManagerAccessForEngines; class IDebuggerManagerAccessForEngines;
class GdbResultRecord; class GdbResponse;
class GdbMi; class GdbMi;
class BreakpointData; class BreakpointData;
@@ -135,18 +135,15 @@ private:
virtual QList<Symbol> moduleSymbols(const QString &moduleName); virtual QList<Symbol> moduleSymbols(const QString &moduleName);
void fetchMemory(MemoryViewAgent *agent, quint64 addr, quint64 length); void fetchMemory(MemoryViewAgent *agent, quint64 addr, quint64 length);
void handleFetchMemory(const GdbResultRecord &record, const QVariant &cookie); void handleFetchMemory(const GdbResponse &response);
void fetchDisassembler(DisassemblerViewAgent *agent, void fetchDisassembler(DisassemblerViewAgent *agent,
const StackFrame &frame); const StackFrame &frame);
void fetchDisassemblerByAddress(DisassemblerViewAgent *agent, void fetchDisassemblerByAddress(DisassemblerViewAgent *agent,
bool useMixedMode); bool useMixedMode);
void handleFetchDisassemblerByLine(const GdbResultRecord &record, void handleFetchDisassemblerByLine(const GdbResponse &response);
const QVariant &cookie); void handleFetchDisassemblerByAddress1(const GdbResponse &response);
void handleFetchDisassemblerByAddress1(const GdbResultRecord &record, void handleFetchDisassemblerByAddress0(const GdbResponse &response);
const QVariant &cookie);
void handleFetchDisassemblerByAddress0(const GdbResultRecord &record,
const QVariant &cookie);
Q_SLOT void setDebugDebuggingHelpers(const QVariant &on); Q_SLOT void setDebugDebuggingHelpers(const QVariant &on);
Q_SLOT void setUseDebuggingHelpers(const QVariant &on); Q_SLOT void setUseDebuggingHelpers(const QVariant &on);
@@ -167,7 +164,7 @@ private:
// get one usable name out of these, try full names first // get one usable name out of these, try full names first
QString fullName(const QStringList &candidates); QString fullName(const QStringList &candidates);
void handleResult(const GdbResultRecord &, int type, const QVariant &); void handleResult(const GdbResponse &response);
public: // otherwise the Qt flag macros are unhappy public: // otherwise the Qt flag macros are unhappy
enum GdbCommandFlag { enum GdbCommandFlag {
@@ -183,9 +180,9 @@ public: // otherwise the Qt flag macros are unhappy
private: private:
typedef void (GdbEngine::*GdbCommandCallback) typedef void (GdbEngine::*GdbCommandCallback)
(const GdbResultRecord &record, const QVariant &cookie); (const GdbResponse &response);
typedef void (AbstractGdbAdapter::*AdapterCallback) typedef void (AbstractGdbAdapter::*AdapterCallback)
(const GdbResultRecord &record, const QVariant &cookie); (const GdbResponse &response);
struct GdbCommand struct GdbCommand
{ {
@@ -254,24 +251,24 @@ private slots:
private: private:
int terminationIndex(const QByteArray &buffer, int &length); int terminationIndex(const QByteArray &buffer, int &length);
void handleResponse(const QByteArray &buff); void handleResponse(const QByteArray &buff);
void handleStart(const GdbResultRecord &response, const QVariant &); void handleStart(const GdbResponse &response);
void handleAqcuiredInferior(); void handleAqcuiredInferior();
void handleAsyncOutput(const GdbMi &data); void handleAsyncOutput(const GdbMi &data);
void handleStop1(const GdbResultRecord &, const QVariant &cookie); void handleStop1(const GdbResponse &response);
void handleStop2(const GdbResultRecord &, const QVariant &cookie); void handleStop2(const GdbResponse &response);
void handleStop2(const GdbMi &data); void handleStop2(const GdbMi &data);
void handleResultRecord(const GdbResultRecord &response); void handleResultRecord(const GdbResponse &response);
void handleFileExecAndSymbols(const GdbResultRecord &response, const QVariant &); void handleFileExecAndSymbols(const GdbResponse &response);
void handleExecContinue(const GdbResultRecord &response, const QVariant &); void handleExecContinue(const GdbResponse &response);
void handleExecJumpToLine(const GdbResultRecord &response, const QVariant &); void handleExecJumpToLine(const GdbResponse &response);
void handleExecRunToFunction(const GdbResultRecord &response, const QVariant &); void handleExecRunToFunction(const GdbResponse &response);
void handleInfoShared(const GdbResultRecord &response, const QVariant &); void handleInfoShared(const GdbResponse &response);
void handleInfoProc(const GdbResultRecord &response, const QVariant &); void handleInfoProc(const GdbResponse &response);
void handleInfoThreads(const GdbResultRecord &response, const QVariant &); void handleInfoThreads(const GdbResponse &response);
void handleShowVersion(const GdbResultRecord &response, const QVariant &); void handleShowVersion(const GdbResponse &response);
void handleQueryPwd(const GdbResultRecord &response, const QVariant &); void handleQueryPwd(const GdbResponse &response);
void handleQuerySources(const GdbResultRecord &response, const QVariant &); void handleQuerySources(const GdbResponse &response);
void handleWatchPoint(const GdbResultRecord &, const QVariant &); void handleWatchPoint(const GdbResponse &response);
bool showToolTip(); bool showToolTip();
// Convenience // Convenience
@@ -314,13 +311,13 @@ private:
// //
// Breakpoint specific stuff // Breakpoint specific stuff
// //
void handleBreakList(const GdbResultRecord &record, const QVariant &); void handleBreakList(const GdbResponse &response);
void handleBreakList(const GdbMi &table); void handleBreakList(const GdbMi &table);
void handleBreakIgnore(const GdbResultRecord &record, const QVariant &cookie); void handleBreakIgnore(const GdbResponse &response);
void handleBreakInsert(const GdbResultRecord &record, const QVariant &cookie); void handleBreakInsert(const GdbResponse &response);
void handleBreakInsert1(const GdbResultRecord &record, const QVariant &cookie); void handleBreakInsert1(const GdbResponse &response);
void handleBreakCondition(const GdbResultRecord &record, const QVariant &cookie); void handleBreakCondition(const GdbResponse &response);
void handleBreakInfo(const GdbResultRecord &record, const QVariant &cookie); void handleBreakInfo(const GdbResponse &response);
void extractDataFromInfoBreak(const QString &output, BreakpointData *data); void extractDataFromInfoBreak(const QString &output, BreakpointData *data);
void breakpointDataFromOutput(BreakpointData *data, const GdbMi &bkpt); void breakpointDataFromOutput(BreakpointData *data, const GdbMi &bkpt);
void sendInsertBreakpoint(int index); void sendInsertBreakpoint(int index);
@@ -329,7 +326,7 @@ private:
// Modules specific stuff // Modules specific stuff
// //
void reloadModules(); void reloadModules();
void handleModulesList(const GdbResultRecord &record, const QVariant &); void handleModulesList(const GdbResponse &response);
// //
@@ -337,8 +334,8 @@ private:
// //
Q_SLOT void reloadRegisters(); Q_SLOT void reloadRegisters();
void setRegisterValue(int nr, const QString &value); void setRegisterValue(int nr, const QString &value);
void handleRegisterListNames(const GdbResultRecord &record, const QVariant &); void handleRegisterListNames(const GdbResponse &response);
void handleRegisterListValues(const GdbResultRecord &record, const QVariant &); void handleRegisterListValues(const GdbResponse &response);
// //
// Source file specific stuff // Source file specific stuff
@@ -348,9 +345,9 @@ private:
// //
// Stack specific stuff // Stack specific stuff
// //
void handleStackListFrames(const GdbResultRecord &record, const QVariant &cookie); void handleStackListFrames(const GdbResponse &response);
void handleStackSelectThread(const GdbResultRecord &, const QVariant &); void handleStackSelectThread(const GdbResponse &response);
void handleStackListThreads(const GdbResultRecord &record, const QVariant &cookie); void handleStackListThreads(const GdbResponse &response);
Q_SLOT void reloadStack(); Q_SLOT void reloadStack();
Q_SLOT void reloadFullStack(); Q_SLOT void reloadFullStack();
@@ -384,26 +381,19 @@ private:
void runDirectDebuggingHelper(const WatchData &data, bool dumpChildren); void runDirectDebuggingHelper(const WatchData &data, bool dumpChildren);
bool hasDebuggingHelperForType(const QString &type) const; bool hasDebuggingHelperForType(const QString &type) const;
void handleVarListChildren(const GdbResultRecord &record, void handleVarListChildren(const GdbResponse &response);
const QVariant &cookie); void handleVarCreate(const GdbResponse &response);
void handleVarCreate(const GdbResultRecord &record, void handleVarAssign(const GdbResponse &response);
const QVariant &cookie); void handleEvaluateExpression(const GdbResponse &response);
void handleVarAssign(const GdbResultRecord &, const QVariant &); //void handleToolTip(const GdbResponse &response);
void handleEvaluateExpression(const GdbResultRecord &record, void handleQueryDebuggingHelper(const GdbResponse &response);
const QVariant &cookie); void handleDebuggingHelperValue1(const GdbResponse &response);
//void handleToolTip(const GdbResultRecord &record, void handleDebuggingHelperValue2(const GdbResponse &response);
// const QVariant &cookie); void handleDebuggingHelperValue3(const GdbResponse &response);
void handleQueryDebuggingHelper(const GdbResultRecord &record, const QVariant &); void handleDebuggingHelperEditValue(const GdbResponse &response);
void handleDebuggingHelperValue1(const GdbResultRecord &record, void handleDebuggingHelperSetup(const GdbResponse &response);
const QVariant &cookie); void handleStackListLocals(const GdbResponse &response);
void handleDebuggingHelperValue2(const GdbResultRecord &record, void handleStackListArguments(const GdbResponse &response);
const QVariant &cookie);
void handleDebuggingHelperValue3(const GdbResultRecord &record,
const QVariant &cookie);
void handleDebuggingHelperEditValue(const GdbResultRecord &record);
void handleDebuggingHelperSetup(const GdbResultRecord &record, const QVariant &);
void handleStackListLocals(const GdbResultRecord &record, const QVariant &);
void handleStackListArguments(const GdbResultRecord &record, const QVariant &);
void handleVarListChildrenHelper(const GdbMi &child, void handleVarListChildrenHelper(const GdbMi &child,
const WatchData &parent); const WatchData &parent);
void setWatchDataType(WatchData &data, const GdbMi &mi); void setWatchDataType(WatchData &data, const GdbMi &mi);

View File

@@ -358,7 +358,7 @@ GdbMi GdbMi::findChild(const char *name) const
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
// //
// GdbResultRecord // GdbResponse
// //
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
@@ -374,7 +374,7 @@ QByteArray stringFromResultClass(GdbResultClass resultClass)
} }
}; };
QByteArray GdbResultRecord::toString() const QByteArray GdbResponse::toString() const
{ {
QByteArray result; QByteArray result;
if (token != -1) if (token != -1)

View File

@@ -32,6 +32,7 @@
#include <QtCore/QByteArray> #include <QtCore/QByteArray>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QVariant>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -128,7 +129,7 @@ public:
void setStreamOutput(const QByteArray &name, const QByteArray &content); void setStreamOutput(const QByteArray &name, const QByteArray &content);
private: private:
friend class GdbResultRecord; friend class GdbResponse;
friend class GdbEngine; friend class GdbEngine;
static QByteArray parseCString(const char *&from, const char *to); static QByteArray parseCString(const char *&from, const char *to);
@@ -155,15 +156,16 @@ enum GdbResultClass
GdbResultExit, GdbResultExit,
}; };
class GdbResultRecord class GdbResponse
{ {
public: public:
GdbResultRecord() : token(-1), resultClass(GdbResultUnknown) {} GdbResponse() : token(-1), resultClass(GdbResultUnknown) {}
QByteArray toString() const; QByteArray toString() const;
int token; int token;
GdbResultClass resultClass; GdbResultClass resultClass;
GdbMi data; GdbMi data;
QVariant cookie;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -142,7 +142,7 @@ void PlainGdbAdapter::prepareInferior()
CB(handleFileExecAndSymbols)); CB(handleFileExecAndSymbols));
} }
void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResultRecord &response, const QVariant &) void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
@@ -157,7 +157,7 @@ void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResultRecord &response,
} }
} }
void PlainGdbAdapter::handleInfoTarget(const GdbResultRecord &response, const QVariant &) void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
{ {
QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state()); QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state());
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
@@ -199,7 +199,7 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResultRecord &response, const QV
#endif #endif
} }
void PlainGdbAdapter::handleExecRun(const GdbResultRecord &response, const QVariant &) void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (response.resultClass == GdbResultRunning) { if (response.resultClass == GdbResultRunning) {
@@ -270,7 +270,7 @@ void PlainGdbAdapter::shutdown()
QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state()); QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state());
} }
void PlainGdbAdapter::handleKill(const GdbResultRecord &response, const QVariant &) void PlainGdbAdapter::handleKill(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
setState(InferiorShutDown); setState(InferiorShutDown);
@@ -284,7 +284,7 @@ void PlainGdbAdapter::handleKill(const GdbResultRecord &response, const QVariant
} }
} }
void PlainGdbAdapter::handleExit(const GdbResultRecord &response, const QVariant &) void PlainGdbAdapter::handleExit(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished() // don't set state here, this will be handled in handleGdbFinished()
@@ -309,12 +309,11 @@ void PlainGdbAdapter::stubStarted()
m_engine->postCommand(_("attach %1").arg(attachedPID), CB(handleStubAttached)); m_engine->postCommand(_("attach %1").arg(attachedPID), CB(handleStubAttached));
} }
void PlainGdbAdapter::handleStubAttached(const GdbResultRecord &, const QVariant &) void PlainGdbAdapter::handleStubAttached(const GdbResponse &)
{ {
qDebug() << "STUB ATTACHED, FIXME"; qDebug() << "STUB ATTACHED, FIXME";
//qq->notifyInferiorStopped(); //qq->notifyInferiorStopped();
//handleAqcuiredInferior(); //handleAqcuiredInferior();
// FIXME: m_autoContinue = true;
} }
void PlainGdbAdapter::stubError(const QString &msg) void PlainGdbAdapter::stubError(const QString &msg)

View File

@@ -69,14 +69,13 @@ public:
void shutdown(); void shutdown();
private: private:
void handleFileExecAndSymbols(const GdbResultRecord &, const QVariant &); void handleFileExecAndSymbols(const GdbResponse &response);
void handleKill(const GdbResultRecord &, const QVariant &); void handleKill(const GdbResponse &response);
void handleExit(const GdbResultRecord &, const QVariant &); void handleExit(const GdbResponse &response);
void handleStubAttached(const GdbResultRecord &, const QVariant &); void handleStubAttached(const GdbResponse &response);
void handleExecRun(const GdbResultRecord &response, const QVariant &); void handleExecRun(const GdbResponse &response);
void handleInfoTarget(const GdbResultRecord &response, const QVariant &); void handleInfoTarget(const GdbResponse &response);
void debugMessage(const QString &msg) { m_engine->debugMessage(msg); }
void emitAdapterStartFailed(const QString &msg); void emitAdapterStartFailed(const QString &msg);
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus); Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus);
Q_SLOT void handleGdbStarted(); Q_SLOT void handleGdbStarted();

View File

@@ -201,7 +201,7 @@ void RemoteGdbAdapter::prepareInferior()
//emit inferiorPreparationFailed(msg); //emit inferiorPreparationFailed(msg);
} }
void RemoteGdbAdapter::handleFileExecAndSymbols(const GdbResultRecord &response, const QVariant &) void RemoteGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
@@ -217,7 +217,7 @@ void RemoteGdbAdapter::handleFileExecAndSymbols(const GdbResultRecord &response,
} }
} }
void RemoteGdbAdapter::handleTargetRemote(const GdbResultRecord &record, const QVariant &) void RemoteGdbAdapter::handleTargetRemote(const GdbResponse &record)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (record.resultClass == GdbResultDone) { if (record.resultClass == GdbResultDone) {
@@ -242,7 +242,7 @@ void RemoteGdbAdapter::startInferior()
emit inferiorStarted(); emit inferiorStarted();
} }
void RemoteGdbAdapter::handleFirstContinue(const GdbResultRecord &record, const QVariant &) void RemoteGdbAdapter::handleFirstContinue(const GdbResponse &record)
{ {
//QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); //QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
QTC_ASSERT(state() == InferiorStarted, qDebug() << state()); QTC_ASSERT(state() == InferiorStarted, qDebug() << state());
@@ -285,7 +285,7 @@ void RemoteGdbAdapter::shutdown()
} }
} }
void RemoteGdbAdapter::handleKill(const GdbResultRecord &response, const QVariant &) void RemoteGdbAdapter::handleKill(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
setState(InferiorShutDown); setState(InferiorShutDown);
@@ -299,7 +299,7 @@ void RemoteGdbAdapter::handleKill(const GdbResultRecord &response, const QVarian
} }
} }
void RemoteGdbAdapter::handleExit(const GdbResultRecord &response, const QVariant &) void RemoteGdbAdapter::handleExit(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished() // don't set state here, this will be handled in handleGdbFinished()

View File

@@ -71,13 +71,12 @@ private:
Q_SLOT void readUploadStandardError(); Q_SLOT void readUploadStandardError();
Q_SLOT void uploadProcError(QProcess::ProcessError error); Q_SLOT void uploadProcError(QProcess::ProcessError error);
void handleFileExecAndSymbols(const GdbResultRecord &, const QVariant &); void handleFileExecAndSymbols(const GdbResponse &response);
void handleKill(const GdbResultRecord &, const QVariant &); void handleKill(const GdbResponse &response);
void handleExit(const GdbResultRecord &, const QVariant &); void handleExit(const GdbResponse &response);
void handleTargetRemote(const GdbResultRecord &response, const QVariant &); void handleTargetRemote(const GdbResponse &response);
void handleFirstContinue(const GdbResultRecord &response, const QVariant &); void handleFirstContinue(const GdbResponse &response);
void debugMessage(const QString &msg) { m_engine->debugMessage(msg); }
Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus); Q_SLOT void handleGdbFinished(int, QProcess::ExitStatus);
Q_SLOT void handleGdbStarted(); Q_SLOT void handleGdbStarted();

View File

@@ -1391,7 +1391,7 @@ void TrkGdbAdapter::prepareInferior()
CB(handleTargetRemote)); CB(handleTargetRemote));
} }
void TrkGdbAdapter::handleTargetRemote(const GdbResultRecord &record, const QVariant &) void TrkGdbAdapter::handleTargetRemote(const GdbResponse &record)
{ {
QTC_ASSERT(state() == InferiorPreparing, qDebug() << state()); QTC_ASSERT(state() == InferiorPreparing, qDebug() << state());
if (record.resultClass == GdbResultDone) { if (record.resultClass == GdbResultDone) {
@@ -1414,7 +1414,7 @@ void TrkGdbAdapter::startInferior()
emit inferiorStarted(); emit inferiorStarted();
} }
void TrkGdbAdapter::handleFirstContinue(const GdbResultRecord &record, const QVariant &) void TrkGdbAdapter::handleFirstContinue(const GdbResponse &record)
{ {
//QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); //QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
QTC_ASSERT(state() == InferiorStarted, qDebug() << state()); QTC_ASSERT(state() == InferiorStarted, qDebug() << state());
@@ -1608,7 +1608,7 @@ void TrkGdbAdapter::shutdown()
QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state()); QTC_ASSERT(state() == AdapterNotRunning, qDebug() << state());
} }
void TrkGdbAdapter::handleKill(const GdbResultRecord &response, const QVariant &) void TrkGdbAdapter::handleKill(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
setState(InferiorShutDown); setState(InferiorShutDown);
@@ -1622,7 +1622,7 @@ void TrkGdbAdapter::handleKill(const GdbResultRecord &response, const QVariant &
} }
} }
void TrkGdbAdapter::handleExit(const GdbResultRecord &response, const QVariant &) void TrkGdbAdapter::handleExit(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
qDebug() << "EXITED, NO MESSAGE..."; qDebug() << "EXITED, NO MESSAGE...";

View File

@@ -100,7 +100,6 @@ private:
QProcess m_gdbProc; QProcess m_gdbProc;
QProcess m_rfcommProc; QProcess m_rfcommProc;
bool m_running; bool m_running;
void debugMessage(const QString &msg) { m_engine->debugMessage(msg); }
public: public:
// //
@@ -123,10 +122,10 @@ public:
void shutdown(); void shutdown();
Q_SLOT void startInferiorEarly(); Q_SLOT void startInferiorEarly();
void handleKill(const GdbResultRecord &, const QVariant &); void handleKill(const GdbResponse &response);
void handleExit(const GdbResultRecord &, const QVariant &); void handleExit(const GdbResponse &response);
void handleTargetRemote(const GdbResultRecord &, const QVariant &); void handleTargetRemote(const GdbResponse &response);
void handleFirstContinue(const GdbResultRecord &, const QVariant &); void handleFirstContinue(const GdbResponse &response);
// //
// TRK // TRK