forked from qt-creator/qt-creator
Debugger: Show confirmed state on breakpoint removal
So far we cheated by pretending removal always succeeds immediately. Now just draw in grey in the view and remove fully after the backend confirmed removal. Change-Id: I0bd607774a3db0fe302b9654798be9dcc50abe8a Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -579,6 +579,23 @@ QVariant BreakpointItem::data(int column, int role) const
|
||||
break;
|
||||
};
|
||||
|
||||
if (role == Qt::ForegroundRole) {
|
||||
static const QVariant gray(QColor(140, 140, 140));
|
||||
switch (m_state) {
|
||||
case BreakpointInsertRequested:
|
||||
case BreakpointInsertProceeding:
|
||||
case BreakpointChangeRequested:
|
||||
case BreakpointChangeProceeding:
|
||||
case BreakpointRemoveRequested:
|
||||
case BreakpointRemoveProceeding:
|
||||
return gray;
|
||||
case BreakpointInserted:
|
||||
case BreakpointNew:
|
||||
case BreakpointDead:
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
switch (column) {
|
||||
case 0:
|
||||
if (role == Qt::DisplayRole)
|
||||
|
@@ -2617,6 +2617,15 @@ void GdbEngine::handleBreakInsert2(const GdbResponse &response)
|
||||
}
|
||||
}
|
||||
|
||||
void GdbEngine::handleBreakDelete(const GdbResponse &response)
|
||||
{
|
||||
Breakpoint bp = response.cookie.value<Breakpoint>();
|
||||
if (response.resultClass == GdbResultDone)
|
||||
bp.notifyBreakpointRemoveOk();
|
||||
else
|
||||
bp.notifyBreakpointRemoveFailed();
|
||||
}
|
||||
|
||||
void GdbEngine::handleBreakDisable(const GdbResponse &response)
|
||||
{
|
||||
QTC_CHECK(response.resultClass == GdbResultDone);
|
||||
@@ -2900,14 +2909,13 @@ void GdbEngine::removeBreakpoint(Breakpoint bp)
|
||||
}
|
||||
|
||||
if (br.id.isValid()) {
|
||||
QVariant vid = QVariant::fromValue(bp);
|
||||
// We already have a fully inserted breakpoint.
|
||||
bp.notifyBreakpointRemoveProceeding();
|
||||
showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName()));
|
||||
postCommand("-break-delete " + br.id.toByteArray(),
|
||||
NeedsStop | RebuildBreakpointModel);
|
||||
// Pretend it succeeds without waiting for response. Feels better.
|
||||
// FIXME: Really?
|
||||
bp.notifyBreakpointRemoveOk();
|
||||
NeedsStop | RebuildBreakpointModel,
|
||||
CB(handleBreakDelete), vid);
|
||||
} else {
|
||||
// Breakpoint was scheduled to be inserted, but we haven't had
|
||||
// an answer so far. Postpone activity by doing nothing.
|
||||
|
@@ -311,6 +311,7 @@ private: ////////// View & Data Stuff //////////
|
||||
void handleBreakEnable(const GdbResponse &response);
|
||||
void handleBreakInsert1(const GdbResponse &response);
|
||||
void handleBreakInsert2(const GdbResponse &response);
|
||||
void handleBreakDelete(const GdbResponse &response);
|
||||
void handleTraceInsert2(const GdbResponse &response);
|
||||
void handleBreakCondition(const GdbResponse &response);
|
||||
void handleBreakThreadSpec(const GdbResponse &response);
|
||||
|
Reference in New Issue
Block a user