summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2019-05-03 10:57:09 +0200
committerDavid Schulz <david.schulz@qt.io>2019-05-03 09:18:48 +0000
commit56a1b499b554fbabc0ae6a7f85d3fa5862e961f1 (patch)
tree6574935eded98aa287b758dc4258762580d8f913 /src/plugins
parentccb5f2302db7269592aaa0a2952d69bac8303737 (diff)
downloadqt-creator-56a1b499b554fbabc0ae6a7f85d3fa5862e961f1.tar.gz
Debugger: use oneshot of BreakpointParameters in cdbAddBreakpointCommand
Change-Id: I5167c4d11708694b488cfa6d6b5ec806255e8719 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp14
-rw-r--r--src/plugins/debugger/cdb/cdbparsehelpers.cpp5
-rw-r--r--src/plugins/debugger/cdb/cdbparsehelpers.h2
3 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 287a4cded6..947eaf242d 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -866,6 +866,7 @@ void CdbEngine::executeRunToLine(const ContextData &data)
{
// Add one-shot breakpoint
BreakpointParameters bp;
+ bp.oneShot = true;
if (data.address) {
bp.type =BreakpointByAddress;
bp.address = data.address;
@@ -875,7 +876,7 @@ void CdbEngine::executeRunToLine(const ContextData &data)
bp.lineNumber = data.lineNumber;
}
- runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings, {}, true), BuiltinCommand,
+ runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings), BuiltinCommand,
[this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); }});
continueInferior();
}
@@ -885,7 +886,8 @@ void CdbEngine::executeRunToFunction(const QString &functionName)
// Add one-shot breakpoint
BreakpointParameters bp(BreakpointByFunction);
bp.functionName = functionName;
- runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings, {}, true), BuiltinCommand,
+ bp.oneShot = true;
+ runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings), BuiltinCommand,
[this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); }});
continueInferior();
}
@@ -1946,7 +1948,7 @@ void CdbEngine::handleBreakInsert(const DebuggerResponse &response, const Breakp
functionName = functionName.mid(functionStart);
sub->params.functionName = functionName;
sub->displayName = bp->displayName() + '.' + QString::number(subBreakPointID);
- runCommand({cdbAddBreakpointCommand(sub->params, m_sourcePathMappings, sub->responseId, false), NoFlags});
+ runCommand({cdbAddBreakpointCommand(sub->params, m_sourcePathMappings, sub->responseId), NoFlags});
}
}
@@ -2505,10 +2507,10 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp)
&& boolSetting(CdbBreakPointCorrection)) {
response.lineNumber = int(lineCorrection->fixLineNumber(
parameters.fileName, unsigned(parameters.lineNumber)));
- QString cmd = cdbAddBreakpointCommand(response, m_sourcePathMappings, responseId, false);
+ QString cmd = cdbAddBreakpointCommand(response, m_sourcePathMappings, responseId);
runCommand({cmd, BuiltinCommand, handleBreakInsertCB});
} else {
- QString cmd = cdbAddBreakpointCommand(parameters, m_sourcePathMappings, responseId, false);
+ QString cmd = cdbAddBreakpointCommand(parameters, m_sourcePathMappings, responseId);
runCommand({cmd, BuiltinCommand, handleBreakInsertCB});
}
if (!parameters.enabled)
@@ -2563,7 +2565,7 @@ void CdbEngine::updateBreakpoint(const Breakpoint &bp)
} else {
// Delete and re-add, triggering update
runCommand({cdbClearBreakpointCommand(bp), NoFlags});
- QString cmd = cdbAddBreakpointCommand(parameters, m_sourcePathMappings, responseId, false);
+ QString cmd = cdbAddBreakpointCommand(parameters, m_sourcePathMappings, responseId);
runCommand({cmd, BuiltinCommand, handleBreakInsertCB});
m_pendingBreakpointMap.insert(bp);
listBreakpoints();
diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.cpp b/src/plugins/debugger/cdb/cdbparsehelpers.cpp
index 58047ce12f..690304e711 100644
--- a/src/plugins/debugger/cdb/cdbparsehelpers.cpp
+++ b/src/plugins/debugger/cdb/cdbparsehelpers.cpp
@@ -138,8 +138,7 @@ QString breakPointCdbId(const Breakpoint &bp)
QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
const QList<QPair<QString, QString> > &sourcePathMapping,
- const QString &responseId,
- bool oneshot)
+ const QString &responseId)
{
const BreakpointParameters params = fixWinMSVCBreakpoint(bpIn);
QString rc;
@@ -154,7 +153,7 @@ QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
str << (params.type == WatchpointAtAddress ? "ba" : "bu")
<< responseId
<< ' ';
- if (oneshot)
+ if (params.oneShot)
str << "/1 ";
switch (params.type) {
case BreakpointAtFork:
diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.h b/src/plugins/debugger/cdb/cdbparsehelpers.h
index 6bf0efa160..5053a6de7e 100644
--- a/src/plugins/debugger/cdb/cdbparsehelpers.h
+++ b/src/plugins/debugger/cdb/cdbparsehelpers.h
@@ -58,7 +58,7 @@ QString breakPointCdbId(const Breakpoint &bp);
// Convert breakpoint in CDB syntax (applying source path mappings using native paths).
QString cdbAddBreakpointCommand(const BreakpointParameters &d,
const QList<QPair<QString, QString> > &sourcePathMapping,
- const QString &responseId = QString(), bool oneshot = false);
+ const QString &responseId = QString());
QString cdbClearBreakpointCommand(const Breakpoint &bp);
// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded