debugger: move the breakpoint hash to the private structure

This commit is contained in:
hjk
2010-11-09 12:50:46 +01:00
parent 55ab8742e2
commit 35cc78726f
2 changed files with 21 additions and 28 deletions

View File

@@ -271,6 +271,7 @@ public:
DisassemblerViewAgent m_disassemblerViewAgent; DisassemblerViewAgent m_disassemblerViewAgent;
QFutureInterface<void> m_progress; QFutureInterface<void> m_progress;
QHash<quint64, Internal::BreakpointData *> m_breakpoints;
bool m_isSlaveEngine; bool m_isSlaveEngine;
}; };
@@ -1222,10 +1223,9 @@ void DebuggerEngine::attemptBreakpointSynchronization()
{ {
for (int i = 0; i < breakHandler()->size(); i++) { for (int i = 0; i < breakHandler()->size(); i++) {
BreakpointData *bp = breakHandler()->at(i); BreakpointData *bp = breakHandler()->at(i);
if (!m_breakpoints.contains(bp->id)) { if (!d->m_breakpoints.contains(bp->id))
m_breakpoints.insert(bp->id, bp); d->m_breakpoints.insert(bp->id, bp);
} QTC_ASSERT(d->m_breakpoints[bp->id] == bp, qDebug() << "corrupted breakpoint map");
QTC_ASSERT(m_breakpoints[bp->id] == bp, qDebug() << "corrupted breakpoint map");
if (bp->uiDirty) { if (bp->uiDirty) {
bp->uiDirty = false; bp->uiDirty = false;
bp->state = BreakpointChangeRequested; bp->state = BreakpointChangeRequested;
@@ -1235,13 +1235,14 @@ void DebuggerEngine::attemptBreakpointSynchronization()
Breakpoints bps = breakHandler()->takeRemovedBreakpoints(); Breakpoints bps = breakHandler()->takeRemovedBreakpoints();
foreach (BreakpointData *bp, bps) { foreach (BreakpointData *bp, bps) {
if (m_breakpoints.contains(bp->id)) { if (d->m_breakpoints.contains(bp->id)) {
bp->state = BreakpointRemovalRequested; bp->state = BreakpointRemovalRequested;
removeBreakpoint(bp->id); removeBreakpoint(bp->id);
} else } else {
delete bp; delete bp;
} }
} }
}
bool DebuggerEngine::acceptsBreakpoint(const BreakpointData *) bool DebuggerEngine::acceptsBreakpoint(const BreakpointData *)
{ {
@@ -1254,17 +1255,15 @@ void DebuggerEngine::addBreakpoint(const BreakpointData &)
void DebuggerEngine::notifyAddBreakpointOk(quint64 id) void DebuggerEngine::notifyAddBreakpointOk(quint64 id)
{ {
BreakpointData *bp = m_breakpoints[id]; BreakpointData *bp = d->m_breakpoints[id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointOk; bp->state = BreakpointOk;
} }
void DebuggerEngine::notifyAddBreakpointFailed(quint64 id) void DebuggerEngine::notifyAddBreakpointFailed(quint64 id)
{ {
BreakpointData *bp = m_breakpoints[id]; BreakpointData *bp = d->m_breakpoints[id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointDead; bp->state = BreakpointDead;
} }
@@ -1274,18 +1273,16 @@ void DebuggerEngine::removeBreakpoint(quint64)
void DebuggerEngine::notifyRemoveBreakpointOk(quint64 id) void DebuggerEngine::notifyRemoveBreakpointOk(quint64 id)
{ {
BreakpointData *bp = m_breakpoints.take(id); BreakpointData *bp = d->m_breakpoints.take(id);
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointDead; bp->state = BreakpointDead;
delete bp; delete bp;
} }
void DebuggerEngine::notifyRemoveBreakpointFailed(quint64 id) void DebuggerEngine::notifyRemoveBreakpointFailed(quint64 id)
{ {
BreakpointData *bp = m_breakpoints[id]; BreakpointData *bp = d->m_breakpoints[id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointOk; bp->state = BreakpointOk;
} }
@@ -1295,25 +1292,22 @@ void DebuggerEngine::changeBreakpoint(const BreakpointData &)
void DebuggerEngine::notifyChangeBreakpointOk(quint64 id) void DebuggerEngine::notifyChangeBreakpointOk(quint64 id)
{ {
BreakpointData *bp = m_breakpoints[id]; BreakpointData *bp = d->m_breakpoints[id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointOk; bp->state = BreakpointOk;
} }
void DebuggerEngine::notifyChangeBreakpointFailed(quint64 id) void DebuggerEngine::notifyChangeBreakpointFailed(quint64 id)
{ {
BreakpointData *bp = m_breakpoints[id]; BreakpointData *bp = d->m_breakpoints[id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->state = BreakpointDead; bp->state = BreakpointDead;
} }
void DebuggerEngine::notifyBreakpointAdjusted(const BreakpointData & rbp) void DebuggerEngine::notifyBreakpointAdjusted(const BreakpointData & rbp)
{ {
BreakpointData *bp = m_breakpoints[rbp.id]; BreakpointData *bp = d->m_breakpoints[rbp.id];
if (!bp) QTC_ASSERT(bp, return);
return;
bp->bpNumber = rbp.bpNumber; bp->bpNumber = rbp.bpNumber;
bp->bpCondition = rbp.bpCondition; bp->bpCondition = rbp.bpCondition;
bp->bpIgnoreCount = rbp.bpIgnoreCount; bp->bpIgnoreCount = rbp.bpIgnoreCount;

View File

@@ -354,7 +354,6 @@ private:
friend class DebuggerEnginePrivate; friend class DebuggerEnginePrivate;
DebuggerEnginePrivate *d; DebuggerEnginePrivate *d;
QHash<quint64, Internal::BreakpointData *> m_breakpoints;
}; };
} // namespace Debugger } // namespace Debugger