forked from qt-creator/qt-creator
DAP: Add run to line support
Note: "Run to line" feature is disabled for CMake. Change-Id: If8dc271fe51c6e5695f2544a71be544c7575bfa9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -115,4 +115,12 @@ void CMakeDapEngine::setupEngine()
|
||||
notifyEngineSetupOk();
|
||||
}
|
||||
|
||||
bool CMakeDapEngine::hasCapability(unsigned cap) const
|
||||
{
|
||||
return cap & (ReloadModuleCapability
|
||||
| BreakConditionCapability
|
||||
| ShowModuleSymbolsCapability
|
||||
/*| RunToLineCapability*/); // disable while the #25176 bug is not fixed
|
||||
}
|
||||
|
||||
} // namespace Debugger::Internal
|
||||
|
||||
@@ -15,6 +15,8 @@ public:
|
||||
private:
|
||||
void handleDapStarted() override;
|
||||
void setupEngine() override;
|
||||
|
||||
bool hasCapability(unsigned cap) const override;
|
||||
};
|
||||
|
||||
} // Debugger::Internal
|
||||
|
||||
@@ -305,8 +305,19 @@ void DapEngine::continueInferior()
|
||||
|
||||
void DapEngine::executeRunToLine(const ContextData &data)
|
||||
{
|
||||
Q_UNUSED(data)
|
||||
QTC_CHECK("FIXME: DapEngine::runToLineExec()" && false);
|
||||
// Add one-shot breakpoint
|
||||
BreakpointParameters bp;
|
||||
bp.oneShot = true;
|
||||
if (data.address) {
|
||||
bp.type = BreakpointByAddress;
|
||||
bp.address = data.address;
|
||||
} else {
|
||||
bp.type = BreakpointByFileAndLine;
|
||||
bp.fileName = data.fileName;
|
||||
bp.textPosition = data.textPosition;
|
||||
}
|
||||
|
||||
BreakpointManager::createBreakpointForEngine(bp, this);
|
||||
}
|
||||
|
||||
void DapEngine::executeRunToFunction(const QString &functionName)
|
||||
@@ -836,6 +847,8 @@ void DapEngine::handleStoppedEvent(const QJsonObject &event)
|
||||
if (bp) {
|
||||
const BreakpointParameters ¶ms = bp->requestedParameters();
|
||||
gotoLocation(Location(params.fileName, params.textPosition));
|
||||
if (params.oneShot)
|
||||
removeBreakpoint(bp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -860,6 +873,9 @@ void DapEngine::handleBreakpointEvent(const QJsonObject &event)
|
||||
if (body.value("reason").toString() == "new") {
|
||||
if (breakpoint.value("verified").toBool()) {
|
||||
notifyBreakpointInsertOk(bp);
|
||||
const BreakpointParameters ¶ms = bp->requestedParameters();
|
||||
if (params.oneShot)
|
||||
continueInferior();
|
||||
qCDebug(dapEngineLog) << "breakpoint inserted";
|
||||
} else {
|
||||
notifyBreakpointInsertFailed(bp);
|
||||
@@ -958,7 +974,8 @@ bool DapEngine::hasCapability(unsigned cap) const
|
||||
{
|
||||
return cap & (ReloadModuleCapability
|
||||
| BreakConditionCapability
|
||||
| ShowModuleSymbolsCapability);
|
||||
| ShowModuleSymbolsCapability
|
||||
| RunToLineCapability);
|
||||
}
|
||||
|
||||
void DapEngine::claimInitialBreakpoints()
|
||||
|
||||
Reference in New Issue
Block a user