From 50dc4d86646d5fc5907140fc8968c3ddc9c762a4 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Mon, 15 Nov 2010 16:58:23 +0100
Subject: [PATCH] debugger: update display on engine exit

---
 src/plugins/debugger/breakhandler.cpp  | 15 ++++++++++-----
 src/plugins/debugger/gdb/gdbengine.cpp |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index e9a9a4a6dfd..f98b09f361c 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -376,7 +376,8 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
     switch (mi.column()) {
         case 0:
             if (role == Qt::DisplayRole) {
-                return QString("%1 - %2").arg(id).arg(response.bpNumber);
+                return QString::number(id);
+                //return QString("%1 - %2").arg(id).arg(response.bpNumber);
             }
             if (role == Qt::DecorationRole) {
                 if (data.isWatchpoint())
@@ -543,8 +544,13 @@ void BreakHandler::setState(BreakpointId id, BreakpointState state)
 {
     Iterator it = m_storage.find(id);
     QTC_ASSERT(it != m_storage.end(), return);
+    if (it->state == state) {
+        qDebug() << "STATE UNCHANGED: " << id << state;
+        return;
+    }
     it->state = state;
     updateMarker(id);
+    layoutChanged();
 }
 
 DebuggerEngine *BreakHandler::engine(BreakpointId id) const
@@ -605,15 +611,13 @@ void BreakHandler::removeBreakpoint(BreakpointId id)
     Iterator it = m_storage.find(id);
     QTC_ASSERT(it != m_storage.end(), return);
     if (it->state == BreakpointInserted) {
-        qDebug() << "MARK AS CHANGED: " << id;
-        it->state = BreakpointRemoveRequested;
-        QTC_ASSERT(it->engine, return);
-        debuggerCore()->synchronizeBreakpoints();
+        setState(id, BreakpointRemoveRequested);
     } else if (it->state == BreakpointNew) {
         it->state = BreakpointDead;
         cleanupBreakpoint(id);
     } else {
         qDebug() << "CANNOT REMOVE IN STATE " << it->state;
+        it->state = BreakpointRemoveRequested;
     }
 }
 
@@ -826,6 +830,7 @@ void BreakHandler::notifyBreakpointReleased(BreakpointId id)
     delete it->marker;
     it->marker = 0;
     updateMarker(id);
+    layoutChanged();
 }
 
 void BreakHandler::cleanupBreakpoint(BreakpointId id)
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 21565cbdae8..6a440562a6e 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2308,7 +2308,7 @@ void GdbEngine::handleBreakEnable(const GdbResponse &response)
 {
     QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
     const BreakpointId id = response.cookie.toInt();
-    // This should only be the "wish" state.
+    // This should only be the requested state.
     QTC_ASSERT(breakHandler()->isEnabled(id), /* Prevent later recursion */);
     breakHandler()->ackEnabled(id);
 }
-- 
GitLab