forked from qt-creator/qt-creator
Debugger: Do not use deprecated bp model id to construct response ids
fixes breakpoint deletion Change-Id: Ie5bda4e2664338ad4210f275abca374c6918753c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -2492,7 +2492,7 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp)
|
||||
BreakpointParameters parameters = bp->requestedParameters();
|
||||
const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); };
|
||||
BreakpointParameters response = parameters;
|
||||
auto responseId = QString::number(breakPointIdToCdbId(bp));
|
||||
const QString responseId = breakPointCdbId(bp);
|
||||
QScopedPointer<BreakpointCorrectionContext> lineCorrection(
|
||||
new BreakpointCorrectionContext(m_codeModelSnapshot, CppTools::CppModelManager::instance()->workingCopy()));
|
||||
if (!m_autoBreakPointCorrection
|
||||
@@ -2539,7 +2539,7 @@ void CdbEngine::updateBreakpoint(const Breakpoint &bp)
|
||||
BreakpointParameters parameters = bp->requestedParameters();
|
||||
const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); };
|
||||
BreakpointParameters response = parameters;
|
||||
auto responseId = QString::number(breakPointIdToCdbId(bp));
|
||||
const QString responseId = breakPointCdbId(bp);
|
||||
notifyBreakpointChangeProceeding(bp);
|
||||
if (debugBreakpoints)
|
||||
qDebug("Changing %d:\n %s\nTo %s\n", bp->modelId(),
|
||||
|
@@ -128,25 +128,14 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
|
||||
return p;
|
||||
}
|
||||
|
||||
int breakPointIdToCdbId(const Breakpoint &bp)
|
||||
QString breakPointCdbId(const Breakpoint &bp)
|
||||
{
|
||||
// return cdbBreakPointStartId + bp.majorPart() * cdbBreakPointIdMinorPart + bp.minorPart();
|
||||
static int bpId = 1;
|
||||
if (!bp->responseId().isEmpty())
|
||||
return bp->responseId().toInt();
|
||||
return cdbBreakPointStartId + bp->modelId() * cdbBreakPointIdMinorPart;
|
||||
return bp->responseId();
|
||||
return QString::number(cdbBreakPointStartId + (bpId++) * cdbBreakPointIdMinorPart);
|
||||
}
|
||||
|
||||
//static int cdbIdToBreakpointModel(int cdbid)
|
||||
//{
|
||||
// if (cdbid >= cdbBreakPointStartId) {
|
||||
// int major = (cdbid - cdbBreakPointStartId) / cdbBreakPointIdMinorPart;
|
||||
// int minor = cdbid % cdbBreakPointIdMinorPart;
|
||||
// (void) minor;
|
||||
// return major;
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
|
||||
const QList<QPair<QString, QString> > &sourcePathMapping,
|
||||
const QString &responseId,
|
||||
@@ -212,11 +201,11 @@ QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
|
||||
QString cdbClearBreakpointCommand(const Breakpoint &bp)
|
||||
{
|
||||
// FIME: Check
|
||||
// const int firstBreakPoint = breakPointIdToCdbId(id);
|
||||
// const int firstBreakPoint = breakPointCdbId(id);
|
||||
// if (id.isMinor())
|
||||
// return "bc " + QString::number(firstBreakPoint);
|
||||
// If this is a major break point we also want to delete all sub break points
|
||||
const int firstBreakPoint = cdbBreakPointStartId + bp->modelId() * cdbBreakPointIdMinorPart;
|
||||
const int firstBreakPoint = bp->responseId().toInt();
|
||||
const int lastBreakPoint = firstBreakPoint + cdbBreakPointIdMinorPart - 1;
|
||||
return "bc " + QString::number(firstBreakPoint) + '-' + QString::number(lastBreakPoint);
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ QString cdbSourcePathMapping(QString fileName,
|
||||
enum { cdbBreakPointStartId = 100000,
|
||||
cdbBreakPointIdMinorPart = 100};
|
||||
|
||||
int breakPointIdToCdbId(const Breakpoint &bp);
|
||||
QString breakPointCdbId(const Breakpoint &bp);
|
||||
|
||||
// Convert breakpoint in CDB syntax (applying source path mappings using native paths).
|
||||
QString cdbAddBreakpointCommand(const BreakpointParameters &d,
|
||||
|
Reference in New Issue
Block a user