From d58f0e7c756a36f487b1b395514487cf8d9d7444 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 May 2011 12:18:32 +0200 Subject: [PATCH] Debugger[CDB]: Move breakpoint back from corrected location. Make it fully work. Task-number: QTCREATORBUG-4842 --- src/plugins/debugger/breakhandler.cpp | 13 ++++++++++--- src/plugins/debugger/breakhandler.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 89afb54d57..0e73359e27 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -781,6 +781,15 @@ static bool isAllowedTransition(BreakpointState from, BreakpointState to) return false; } +bool BreakHandler::isEngineRunning(BreakpointId id) const +{ + if (const DebuggerEngine *e = engine(id)) { + const DebuggerState state = e->state(); + return state != DebuggerFinished && state != DebuggerNotReady; + } + return false; +} + void BreakHandler::setState(BreakpointId id, BreakpointState state) { Iterator it = m_storage.find(id); @@ -1028,10 +1037,8 @@ void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber) // Ignore updates to the "real" line number while the debugger is // running, as this can be triggered by moving the breakpoint to // the next line that generated code. - if (it->response.number == 0) { - // FIXME: Do we need yet another data member? + if (!isEngineRunning(id)) it->data.lineNumber = lineNumber; - } updateMarker(id); emit layoutChanged(); } diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index a79b6af15d..33f09507bc 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -168,6 +168,7 @@ private: QVariant headerData(int section, Qt::Orientation orientation, int role) const; Qt::ItemFlags flags(const QModelIndex &index) const; + bool isEngineRunning(BreakpointId id) const; void setState(BreakpointId id, BreakpointState state); void loadBreakpoints(); void saveBreakpoints(); -- 2.11.0