Commit 72019235 authored by hjk's avatar hjk Committed by hjk

debugger: move isCppBreakpoint to Breakpoint

Change-Id: I241401fa010166982e5a95a699c99fbaa87188ef
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 983a6ef5
......@@ -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;
......
......@@ -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
......
......@@ -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:
......
......@@ -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)
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment