diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index f81a507987b27508b81b87b1ec1c1b3eab86f86a..a5bda190ef700fe25078927decdf696248426bf4 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -276,6 +276,21 @@ void BreakpointParameters::updateLocation(const QByteArray &location) } } +bool BreakpointParameters::isCppBreakpoint() const +{ + // Qml specific breakpoint types. + if (type == BreakpointAtJavaScriptThrow + || type == BreakpointOnQmlSignalHandler) + return false; + + // Qml is currently only file. + if (type == BreakpointByFileAndLine) + return !fileName.endsWith(QLatin1String(".qml"), Qt::CaseInsensitive) + && !fileName.endsWith(QLatin1String(".js"), Qt::CaseInsensitive); + + return true; +} + QString BreakpointParameters::toString() const { QString result; diff --git a/src/plugins/debugger/breakpoint.h b/src/plugins/debugger/breakpoint.h index 138894a348b1e156cdabfbddcc1163f4bf11eae1..4efb0444c300a283fc9fe12f4f133a6ee417d62e 100644 --- a/src/plugins/debugger/breakpoint.h +++ b/src/plugins/debugger/breakpoint.h @@ -211,6 +211,7 @@ public: // Enough for now. bool isBreakpoint() const { return !isWatchpoint() && !isTracepoint(); } bool isTracepoint() const { return tracepoint; } + bool isCppBreakpoint() const; QString toString() const; void updateLocation(const QByteArray &location); // file.cpp:42 diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 99bb44fc56385f9367ba65ec0acf39baf887d1f9..57f42b652d7be89512570f7f1a11daa3561c3d0c 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2542,7 +2542,7 @@ bool CdbEngine::stateAcceptsBreakpointChanges() const bool CdbEngine::acceptsBreakpoint(BreakpointModelId id) const { const BreakpointParameters &data = breakHandler()->breakpointData(id); - if (!DebuggerEngine::isCppBreakpoint(data)) + if (!data.isCppBreakpoint()) return false; switch (data.type) { case UnknownType: diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 6cfda09819930f53f8acf79dc81a2298c19d61ae..ff8471043456165703461a69178f3bd5c594bc48 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1634,20 +1634,6 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description showMessageBox(QMessageBox::Information, tr("Exception Triggered"), msg); } -bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p) -{ - //Qml specific breakpoint types - if (p.type == BreakpointAtJavaScriptThrow - || p.type == BreakpointOnQmlSignalHandler) - return false; - - // Qml is currently only file - if (p.type != BreakpointByFileAndLine) - return true; - return !p.fileName.endsWith(QLatin1String(".qml"), Qt::CaseInsensitive) - && !p.fileName.endsWith(QLatin1String(".js"), Qt::CaseInsensitive); -} - void DebuggerEngine::openMemoryView(quint64 startAddr, unsigned flags, const QList<MemoryMarkup> &ml, const QPoint &pos, const QString &title, QWidget *parent) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 389cb30dc804f4d86331af900b9362b30d21c10a..7a6e619031ad5c60f00691064d63274cbba35c90 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -383,8 +383,6 @@ protected: void showStoppedBySignalMessageBox(const QString meaning, QString name); void showStoppedByExceptionMessageBox(const QString &description); - static bool isCppBreakpoint(const Internal::BreakpointParameters &p); - bool isStateDebugging() const; void setStateDebugging(bool on); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 17362638a63f3dc66b9e1c8c15cd55befc380f81..8f41a77dd901e964b4979f825215ce1b66a282cb 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2932,7 +2932,7 @@ bool GdbEngine::stateAcceptsBreakpointChanges() const bool GdbEngine::acceptsBreakpoint(BreakpointModelId id) const { - return DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id)) + return breakHandler()->breakpointData(id).isCppBreakpoint() && startParameters().startMode != AttachCore; } diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index d402fcbf04a87e530a71500804b0baf6640ca140..55d43860e1b6d57b3bf14fa104b642b982ed4cd4 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -674,7 +674,7 @@ void QmlEngine::attemptBreakpointSynchronization() bool QmlEngine::acceptsBreakpoint(BreakpointModelId id) const { - if (!DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id))) + if (!breakHandler()->breakpointData(id).isCppBreakpoint()) return true; //If it is a Cpp Breakpoint query if the type can be also handled by the debugger client