forked from qt-creator/qt-creator
DAP: Remove redundant source field in breakpoint structure
Change-Id: I30c952971353ab316791cd68cf91f192bd398b84 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -232,21 +232,16 @@ bool DapEngine::acceptsBreakpoint(const BreakpointParameters &) const
|
|||||||
return true; // FIXME: Too bold.
|
return true; // FIXME: Too bold.
|
||||||
}
|
}
|
||||||
|
|
||||||
static QJsonObject createBreakpoint(const Breakpoint &breakpoint)
|
static QJsonObject createBreakpoint(const BreakpointParameters ¶ms)
|
||||||
{
|
{
|
||||||
const BreakpointParameters ¶ms = breakpoint->requestedParameters();
|
|
||||||
|
|
||||||
if (params.fileName.isEmpty())
|
if (params.fileName.isEmpty())
|
||||||
return QJsonObject();
|
return QJsonObject();
|
||||||
|
|
||||||
QJsonObject bp;
|
QJsonObject bp;
|
||||||
bp["line"] = params.textPosition.line;
|
bp["line"] = params.textPosition.line;
|
||||||
bp["source"] = QJsonObject{{"name", params.fileName.fileName()},
|
|
||||||
{"path", params.fileName.path()}};
|
|
||||||
return bp;
|
return bp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DapEngine::insertBreakpoint(const Breakpoint &bp)
|
void DapEngine::insertBreakpoint(const Breakpoint &bp)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(bp, return);
|
QTC_ASSERT(bp, return);
|
||||||
@@ -263,9 +258,9 @@ void DapEngine::dapInsertBreakpoint(const Breakpoint &bp)
|
|||||||
|
|
||||||
QJsonArray breakpoints;
|
QJsonArray breakpoints;
|
||||||
for (const auto &breakpoint : breakHandler()->breakpoints()) {
|
for (const auto &breakpoint : breakHandler()->breakpoints()) {
|
||||||
QJsonObject jsonBp = createBreakpoint(breakpoint);
|
const BreakpointParameters &bpParams = breakpoint->requestedParameters();
|
||||||
if (!jsonBp.isEmpty()
|
QJsonObject jsonBp = createBreakpoint(bpParams);
|
||||||
&& params.fileName.path() == jsonBp["source"].toObject()["path"].toString()) {
|
if (!jsonBp.isEmpty() && params.fileName.path() == bpParams.fileName.path()) {
|
||||||
breakpoints.append(jsonBp);
|
breakpoints.append(jsonBp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,9 +299,9 @@ void DapEngine::dapRemoveBreakpoint(const Breakpoint &bp)
|
|||||||
|
|
||||||
QJsonArray breakpoints;
|
QJsonArray breakpoints;
|
||||||
for (const auto &breakpoint : breakHandler()->breakpoints()) {
|
for (const auto &breakpoint : breakHandler()->breakpoints()) {
|
||||||
if (breakpoint->responseId() != bp->responseId()
|
const BreakpointParameters &bpParams = breakpoint->requestedParameters();
|
||||||
&& params.fileName == breakpoint->requestedParameters().fileName) {
|
if (breakpoint->responseId() != bp->responseId() && params.fileName == bpParams.fileName) {
|
||||||
QJsonObject jsonBp = createBreakpoint(breakpoint);
|
QJsonObject jsonBp = createBreakpoint(bpParams);
|
||||||
breakpoints.append(jsonBp);
|
breakpoints.append(jsonBp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user