Commit 0ae94ffc authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger[CDB]: Fix breakpoint context menu for CDB.

Immediately report known data back when settings breakpoints
so that line number/enabled is correct in the handler.
parent 46da4066
...@@ -2366,11 +2366,16 @@ void CdbEngine::attemptBreakpointSynchronization() ...@@ -2366,11 +2366,16 @@ void CdbEngine::attemptBreakpointSynchronization()
handler->notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
m_pendingBreakpointMap.insert(id, response); m_pendingBreakpointMap.insert(id, response);
addedChanged = true; addedChanged = true;
// Ensure enabled/disabled is correct in handler and line number is there.
handler->setResponse(id, response);
if (debugBreakpoints) if (debugBreakpoints)
qDebug("Adding %llu %s\n", id, qPrintable(response.toString())); qDebug("Adding %llu %s\n", id, qPrintable(response.toString()));
break; break;
case BreakpointChangeRequested: case BreakpointChangeRequested:
handler->notifyBreakpointChangeProceeding(id); handler->notifyBreakpointChangeProceeding(id);
if (debugBreakpoints)
qDebug("Changing %llu:\n %s\nTo %s\n", id, qPrintable(handler->response(id).toString()),
qPrintable(parameters.toString()));
if (parameters.enabled != handler->response(id).enabled) { if (parameters.enabled != handler->response(id).enabled) {
// Change enabled/disabled breakpoints without triggering update. // Change enabled/disabled breakpoints without triggering update.
postCommand((parameters.enabled ? "be " : "bd ") + QByteArray::number(id), 0); postCommand((parameters.enabled ? "be " : "bd ") + QByteArray::number(id), 0);
...@@ -2385,8 +2390,6 @@ void CdbEngine::attemptBreakpointSynchronization() ...@@ -2385,8 +2390,6 @@ void CdbEngine::attemptBreakpointSynchronization()
m_pendingBreakpointMap.insert(id, response); m_pendingBreakpointMap.insert(id, response);
} }
handler->notifyBreakpointChangeOk(id); handler->notifyBreakpointChangeOk(id);
if (debugBreakpoints)
qDebug("Changing %llu %s\n", id, qPrintable(response.toString()));
break; break;
case BreakpointRemoveRequested: case BreakpointRemoveRequested:
postCommand("bc " + QByteArray::number(id), 0); postCommand("bc " + QByteArray::number(id), 0);
...@@ -2639,6 +2642,8 @@ void CdbEngine::handleBreakPoints(const GdbMi &value) ...@@ -2639,6 +2642,8 @@ void CdbEngine::handleBreakPoints(const GdbMi &value)
currentResponse.pending = reportedResponse.pending; currentResponse.pending = reportedResponse.pending;
currentResponse.enabled = reportedResponse.enabled; currentResponse.enabled = reportedResponse.enabled;
formatCdbBreakPointResponse(id, currentResponse, str); formatCdbBreakPointResponse(id, currentResponse, str);
if (debugBreakpoints)
qDebug(" Setting for %llu: %s\n", id, qPrintable(currentResponse.toString()));
handler->setResponse(id, currentResponse); handler->setResponse(id, currentResponse);
m_pendingBreakpointMap.erase(it); m_pendingBreakpointMap.erase(it);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment