debugger: remove breakpoint notification indirection through the engine

This commit is contained in:
hjk
2010-11-16 18:20:52 +01:00
parent 4e1452fd59
commit adba4c954c
5 changed files with 22 additions and 52 deletions

View File

@@ -676,6 +676,18 @@ void BreakHandler::notifyBreakpointReleased(BreakpointId id)
layoutChanged(); layoutChanged();
} }
void BreakHandler::notifyBreakpointAdjusted(BreakpointId id,
const BreakpointParameters &data)
{
QTC_ASSERT(state(id) == BreakpointInserted, /**/);
Iterator it = m_storage.find(id);
QTC_ASSERT(it != m_storage.end(), return);
it->data = data;
if (it->needsChange())
setState(id, BreakpointChangeRequested);
}
void BreakHandler::ackCondition(BreakpointId id) void BreakHandler::ackCondition(BreakpointId id)
{ {
Iterator it = m_storage.find(id); Iterator it = m_storage.find(id);

View File

@@ -143,6 +143,8 @@ public:
void notifyBreakpointRemoveOk(BreakpointId id); void notifyBreakpointRemoveOk(BreakpointId id);
void notifyBreakpointRemoveFailed(BreakpointId id); void notifyBreakpointRemoveFailed(BreakpointId id);
void notifyBreakpointReleased(BreakpointId id); void notifyBreakpointReleased(BreakpointId id);
void notifyBreakpointAdjusted(BreakpointId id,
const BreakpointParameters &data);
private: private:
public: public:

View File

@@ -1280,53 +1280,16 @@ void DebuggerEngine::insertBreakpoint(BreakpointId)
QTC_ASSERT(false, /**/); QTC_ASSERT(false, /**/);
} }
void DebuggerEngine::notifyBreakpointInsertOk(BreakpointId id)
{
breakHandler()->notifyBreakpointInsertOk(id);
}
void DebuggerEngine::notifyBreakpointInsertFailed(BreakpointId id)
{
breakHandler()->notifyBreakpointInsertFailed(id);
}
void DebuggerEngine::removeBreakpoint(BreakpointId) void DebuggerEngine::removeBreakpoint(BreakpointId)
{ {
QTC_ASSERT(false, /**/); QTC_ASSERT(false, /**/);
} }
void DebuggerEngine::notifyBreakpointRemoveOk(BreakpointId id)
{
breakHandler()->notifyBreakpointRemoveOk(id);
}
void DebuggerEngine::notifyBreakpointRemoveFailed(BreakpointId id)
{
breakHandler()->notifyBreakpointRemoveFailed(id);
}
void DebuggerEngine::changeBreakpoint(BreakpointId) void DebuggerEngine::changeBreakpoint(BreakpointId)
{ {
QTC_ASSERT(false, /**/); QTC_ASSERT(false, /**/);
} }
void DebuggerEngine::notifyBreakpointChangeOk(BreakpointId id)
{
breakHandler()->notifyBreakpointChangeOk(id);
}
void DebuggerEngine::notifyBreakpointChangeFailed(BreakpointId id)
{
breakHandler()->notifyBreakpointChangeFailed(id);
}
void DebuggerEngine::notifyBreakpointAdjusted(BreakpointId id,
const BreakpointParameters &data)
{
QTC_ASSERT(false, /* FIXME */);
breakHandler()->setBreakpointData(id, data);
}
void DebuggerEngine::selectThread(int) void DebuggerEngine::selectThread(int)
{ {
} }

View File

@@ -187,16 +187,8 @@ public:
virtual void attemptBreakpointSynchronization(); virtual void attemptBreakpointSynchronization();
virtual bool acceptsBreakpoint(BreakpointId id) const; // FIXME: make pure virtual bool acceptsBreakpoint(BreakpointId id) const; // FIXME: make pure
virtual void insertBreakpoint(BreakpointId id); // FIXME: make pure virtual void insertBreakpoint(BreakpointId id); // FIXME: make pure
virtual void notifyBreakpointInsertOk(BreakpointId id);
virtual void notifyBreakpointInsertFailed(BreakpointId id);
virtual void removeBreakpoint(BreakpointId id); // FIXME: make pure virtual void removeBreakpoint(BreakpointId id); // FIXME: make pure
virtual void notifyBreakpointRemoveOk(BreakpointId id);
virtual void notifyBreakpointRemoveFailed(BreakpointId id);
virtual void changeBreakpoint(BreakpointId id); // FIXME: make pure virtual void changeBreakpoint(BreakpointId id); // FIXME: make pure
virtual void notifyBreakpointChangeOk(BreakpointId id);
virtual void notifyBreakpointChangeFailed(BreakpointId id);
virtual void notifyBreakpointAdjusted(BreakpointId id,
const Internal::BreakpointParameters &data);
virtual void assignValueInDebugger(const Internal::WatchData *data, virtual void assignValueInDebugger(const Internal::WatchData *data,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);

View File

@@ -290,6 +290,7 @@ void IPCEngineHost::updateWatchData(const WatchData &data,
void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload) void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
{ {
BreakHandler *handler;
switch (f) { switch (f) {
default: default:
showMessage(QLatin1String("IPC Error: unhandled id in guest to host call")); showMessage(QLatin1String("IPC Error: unhandled id in guest to host call"));
@@ -475,7 +476,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
} }
case IPCEngineGuest::NotifyAddBreakpointFailed: case IPCEngineGuest::NotifyAddBreakpointFailed:
{ {
@@ -483,7 +484,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointInsertFailed(id); handler->notifyBreakpointInsertFailed(id);
} }
case IPCEngineGuest::NotifyRemoveBreakpointOk: case IPCEngineGuest::NotifyRemoveBreakpointOk:
{ {
@@ -491,7 +492,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointRemoveOk(id); handler->notifyBreakpointRemoveOk(id);
} }
case IPCEngineGuest::NotifyRemoveBreakpointFailed: case IPCEngineGuest::NotifyRemoveBreakpointFailed:
{ {
@@ -499,7 +500,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointRemoveFailed(id); handler->notifyBreakpointRemoveFailed(id);
} }
case IPCEngineGuest::NotifyChangeBreakpointOk: case IPCEngineGuest::NotifyChangeBreakpointOk:
{ {
@@ -507,7 +508,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointChangeOk(id); handler->notifyBreakpointChangeOk(id);
} }
case IPCEngineGuest::NotifyChangeBreakpointFailed: case IPCEngineGuest::NotifyChangeBreakpointFailed:
{ {
@@ -515,7 +516,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
SET_NATIVE_BYTE_ORDER(s); SET_NATIVE_BYTE_ORDER(s);
BreakpointId id; BreakpointId id;
s >> id; s >> id;
notifyBreakpointChangeFailed(id); handler->notifyBreakpointChangeFailed(id);
} }
case IPCEngineGuest::NotifyBreakpointAdjusted: case IPCEngineGuest::NotifyBreakpointAdjusted:
{ {
@@ -524,7 +525,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
BreakpointId id; BreakpointId id;
BreakpointParameters d; BreakpointParameters d;
s >> id >> d; s >> id >> d;
notifyBreakpointAdjusted(id, d); handler->notifyBreakpointAdjusted(id, d);
} }
} }
} }