CDB: Start all CDB breakpoint IDs at 1000.

Avoid clashes with breakpoints resulting from options
(break at functions from options, potentially using bm).

Change-Id: I3746f5a246d7bbeea36df412460edf3f2a90e2c0
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2012-12-20 15:24:32 +01:00
parent 2764ed4f51
commit 278c0fef74
3 changed files with 45 additions and 18 deletions

View File

@@ -1186,7 +1186,7 @@ void CdbEngine::executeRunToLine(const ContextData &data)
bp.fileName = data.fileName;
bp.lineNumber = data.lineNumber;
}
postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings, BreakpointModelId(quint16(-1)), true), 0);
postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings, BreakpointModelId(), true), 0);
continueInferior();
}
@@ -1196,7 +1196,7 @@ void CdbEngine::executeRunToFunction(const QString &functionName)
BreakpointParameters bp(BreakpointByFunction);
bp.functionName = functionName;
postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings, BreakpointModelId(quint16(-1)), true), 0);
postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings, BreakpointModelId(), true), 0);
continueInferior();
}
@@ -2043,12 +2043,10 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
if (reason == "breakpoint") {
// Note: Internal breakpoints (run to line) are reported with id=0.
// Step out creates temporary breakpoints with id 10000.
BreakpointModelId id;
int number = 0;
const GdbMi breakpointIdG = stopReason.findChild("breakpointId");
if (breakpointIdG.isValid()) {
id = BreakpointModelId(breakpointIdG.data().toInt());
if (id && breakHandler()->engineBreakpointIds(this).contains(id)) {
BreakpointModelId id = cdbIdToBreakpointModelId(stopReason.findChild("breakpointId"));
if (id.isValid()) {
if (breakHandler()->engineBreakpointIds(this).contains(id)) {
const BreakpointResponse parameters = breakHandler()->response(id);
if (!parameters.message.isEmpty()) {
showMessage(parameters.message + QLatin1Char('\n'), AppOutput);
@@ -2757,21 +2755,21 @@ void CdbEngine::attemptBreakpointSynchronization()
if (parameters.enabled != handler->response(id).enabled) {
// Change enabled/disabled breakpoints without triggering update.
postCommand((parameters.enabled ? "be " : "bd ")
+ QByteArray::number(id.majorPart()), 0);
+ QByteArray::number(breakPointIdToCdbId(id)), 0);
response.pending = false;
response.enabled = parameters.enabled;
handler->setResponse(id, response);
} else {
// Delete and re-add, triggering update
addedChanged = true;
postCommand("bc " + QByteArray::number(id.majorPart()), 0);
postCommand("bc " + QByteArray::number(breakPointIdToCdbId(id)), 0);
postCommand(cdbAddBreakpointCommand(parameters, m_sourcePathMappings, id, false), 0);
m_pendingBreakpointMap.insert(id, response);
}
handler->notifyBreakpointChangeOk(id);
break;
case BreakpointRemoveRequested:
postCommand("bc " + QByteArray::number(id.majorPart()), 0);
postCommand("bc " + QByteArray::number(breakPointIdToCdbId(id)), 0);
handler->notifyBreakpointRemoveProceeding(id);
handler->notifyBreakpointRemoveOk(id);
m_pendingBreakpointMap.remove(id);