MCPcopy Create free account
hub / github.com/KDE/kdevelop / clearExecutionPoint

Method clearExecutionPoint

kdevplatform/shell/debugcontroller.cpp:343–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void DebugController::clearExecutionPoint()
344{
345 const auto* const documentController = KDevelop::ICore::self()->documentController();
346 if (!documentController) {
347 qCDebug(SHELL) << "Cannot clear execution point without the document controller. "
348 "KDevelop must be exiting and the document controller already destroyed.";
349 return;
350 }
351
352 auto* const document = m_lastExecMarkDocument.data();
353 // Do we even have a document with execution mark?
354 if (!document) {
355 return;
356 }
357 m_lastExecMarkDocument = nullptr;
358
359 constexpr auto markTypeToRemove = executionMark;
360
361 // Is the execution mark still at the line it was added to?
362 if (document->mark(m_lastExecMarkLine) & markTypeToRemove) {
363 document->removeMark(m_lastExecMarkLine, markTypeToRemove);
364 return;
365 }
366
367 // The execution mark is on some other line (probably because the document was edited
368 // during the current debug session). Iterate over all marks in the document to find and remove it.
369 const auto& marks = document->marks();
370 const auto it = std::find_if(marks.begin(), marks.end(), [](const KTextEditor::Mark* mark) -> bool {
371 // TODO: remove the following line once building KDevelop with Visual Studio 2019 is no longer supported.
372 constexpr auto markTypeToRemove = executionMark;
373 return mark->type & markTypeToRemove;
374 });
375
376 if (it != marks.end()) {
377 document->removeMark(it.key(), markTypeToRemove);
378 return;
379 }
380
381 qCWarning(SHELL) << "failed to remove execution mark from" << document->url().toString(QUrl::PreferLocalFile);
382}
383
384void DebugController::showStepInSource(const QUrl& originalUrl, int originalLine)
385{

Callers

nothing calls this directly

Calls 7

documentControllerMethod · 0.80
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
keyMethod · 0.45
toStringMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected