From bb31da3937b5c7ad7f980e90a54e77758843e793 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 16 Dec 2020 16:18:54 +0100 Subject: [PATCH] Debugger: Give some hint on what to change if QML breakpoints fail Fixes: QTCREATORBUG-8200 Change-Id: I464a577f14f1e0e03355b2f176e4f6e67cc8459b Reviewed-by: Leena Miettinen Reviewed-by: David Schulz --- src/plugins/debugger/debuggerruncontrol.cpp | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 37da6b26648..e983e41f90d 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -694,17 +694,30 @@ void DebuggerRunTool::start() if (m_runParameters.startMode == StartInternal) { QStringList unhandledIds; -// for (const GlobalBreakpoint &bp : BreakpointManager::globalBreakpoints()) { -// if (bp->isEnabled() && !m_engine->acceptsBreakpoint(bp)) -// unhandledIds.append(bp.id().toString()); -// } + bool hasQmlBreakpoints = false; + for (const GlobalBreakpoint &gbp : BreakpointManager::globalBreakpoints()) { + if (gbp->isEnabled()) { + const BreakpointParameters &bp = gbp->requestedParameters(); + hasQmlBreakpoints = hasQmlBreakpoints || bp.isQmlFileAndLineBreakpoint(); + if (!m_engine->acceptsBreakpoint(bp)) { + if (!m_engine2 || !m_engine2->acceptsBreakpoint(bp)) + unhandledIds.append(gbp->displayName()); + } + } + } if (!unhandledIds.isEmpty()) { QString warningMessage = DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger " - "languages currently active, and will be ignored.\n" + "languages currently active, and will be ignored.

" "Affected are breakpoints %1") .arg(unhandledIds.join(", ")); + if (hasQmlBreakpoints) { + warningMessage += "

" + + DebuggerPlugin::tr("QML debugging needs to be enabled both in the Build " + "and the Run settings."); + } + showMessage(warningMessage, LogWarning); static bool checked = true;