diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index bd59c626c891fdea762ace61590e386fe6333696..04982a509747f815cd31a99e101ec565d7b4e2d7 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -462,7 +462,9 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const type BreakHandler::getter(BreakpointId id) const \ { \ ConstIterator it = m_storage.find(id); \ - QTC_ASSERT(it != m_storage.end(), return type()); \ + QTC_ASSERT(it != m_storage.end(), \ + qDebug() << "ID" << id << "NOT KNOWN"; \ + return type()); \ return it->data.getter(); \ } @@ -470,7 +472,8 @@ type BreakHandler::getter(BreakpointId id) const \ void BreakHandler::setter(BreakpointId id, const type &value) \ { \ Iterator it = m_storage.find(id); \ - QTC_ASSERT(it != m_storage.end(), return); \ + QTC_ASSERT(it != m_storage.end(), \ + qDebug() << "ID" << id << "NOT KNOWN"; return); \ if (it->data.setter(value)) \ scheduleSynchronization(); \ } @@ -485,7 +488,6 @@ PROPERTY(QString, markerFileName, setMarkerFileName) PROPERTY(QString, fileName, setFileName) PROPERTY(QString, functionName, setFunctionName) PROPERTY(int, markerLineNumber, setMarkerLineNumber) -PROPERTY(bool, isEnabled, setEnabled) PROPERTY(BreakpointType, type, setType) PROPERTY(QByteArray, threadSpec, setThreadSpec) PROPERTY(QByteArray, condition, setCondition) @@ -493,6 +495,25 @@ PROPERTY(int, lineNumber, setLineNumber) PROPERTY(quint64, address, setAddress) PROPERTY(int, ignoreCount, setIgnoreCount) +bool BreakHandler::isEnabled(BreakpointId id) const +{ + ConstIterator it = m_storage.find(id); + QTC_ASSERT(it != m_storage.end(), return BreakpointDead); + return it->data.isEnabled(); +} + +void BreakHandler::setEnabled(BreakpointId id, bool on) +{ + Iterator it = m_storage.find(id); + QTC_ASSERT(it != m_storage.end(), return); + //qDebug() << "SET ENABLED: " << id << it->data.isEnabled() << on; + if (it->data.setEnabled(on)) { + it->destroyMarker(); + updateMarker(id); + scheduleSynchronization(); + } +} + BreakpointState BreakHandler::state(BreakpointId id) const { ConstIterator it = m_storage.find(id); @@ -644,18 +665,13 @@ void BreakHandler::breakByFunction(const QString &functionName) QIcon BreakHandler::icon(BreakpointId id) const { - //if (!m_handler->isActive()) - // return m_handler->emptyIcon(); ConstIterator it = m_storage.find(id); QTC_ASSERT(it != m_storage.end(), return pendingBreakPointIcon()); - //if (!isActive()) - // return emptyIcon(); - switch (it->state) { - case BreakpointInserted: + if (!it->data.isEnabled()) + return m_disabledBreakpointIcon; + if (it->state == BreakpointInserted) return breakpointIcon(); - default: - return pendingBreakPointIcon(); - } + return pendingBreakPointIcon(); } void BreakHandler::scheduleSynchronization() @@ -887,7 +903,7 @@ QString BreakHandler::BreakpointItem::toToolTip() const str << "<html><body><table>" //<< "<tr><td>" << tr("Id:") << "</td><td>" << m_id << "</td></tr>" << "<tr><td>" << tr("State:") - << "</td><td>" << state << "(" << stateToString(state) << ")</td></tr>" + << "</td><td>" << state << " (" << stateToString(state) << ")</td></tr>" << "<tr><td>" << tr("Engine:") << "</td><td>" << (engine ? engine->objectName() : "0") << "</td></tr>" << "<tr><td>" << tr("Marker File:") diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 3da660fdb62eab64e2609ca53bbae1ef91b51b5e..cc027636be272f255c27a86ed89124bf52ec3ceb 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -116,8 +116,7 @@ public: #undef PROPERTY BreakpointState state(BreakpointId id) const; bool isEnabled(BreakpointId id) const; - void setEnabled(BreakpointId id, const bool &on); - void updateEnabled(BreakpointId id, const bool &on); + void setEnabled(BreakpointId id, bool on); void updateLineNumberFromMarker(BreakpointId id, int lineNumber); DebuggerEngine *engine(BreakpointId id) const; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 7efe4608783394bdae096e8a50f79d6d541a0162..e132665a9dec1153566cedd731fb311c4de96b72 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -937,6 +937,7 @@ public slots: void synchronizeBreakpoints() { + showMessage("ATTEMPT SYNC", LogDebug); for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) { if (DebuggerRunControl *runControl = m_snapshotHandler->at(i)) { DebuggerEngine *engine = runControl->engine(); @@ -2319,6 +2320,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor, // Enable/disable existing breakpoint. act = new QAction(menu); + act->setData(int(id)); if (breakHandler()->isEnabled(id)) { act->setText(tr("Disable Breakpoint %1").arg(id)); connect(act, SIGNAL(triggered()),