diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 8f8d077f90ad69fbe9c07f9b0266b585eb683a03..e7ac916d4618bbb1831c51f553e9e6610a3f0d19 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -1197,6 +1197,23 @@ void CdbEngine::selectThread(int index) } } +bool CdbEngine::stateAcceptsBreakpointChanges() const +{ + switch (state()) { + case InferiorRunOk: + case InferiorStopOk: + return true; + default: + break; + } + return false; +} + +bool CdbEngine::acceptsBreakpoint(BreakpointId id) const +{ + return DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id)); +} + void CdbEngine::attemptBreakpointSynchronization() { if (!m_d->m_hDebuggeeProcess) // Sometimes called from the breakpoint Window @@ -1751,7 +1768,7 @@ void CdbEnginePrivate::updateStackTrace() void CdbEnginePrivate::updateModules() { - QList<Module> modules; + Modules modules; QString errorMessage; if (!getModuleList(interfaces().debugSymbols, &modules, &errorMessage)) m_engine->warning(msgFunctionFailed(Q_FUNC_INFO, errorMessage)); diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 9fd5208cea61d7dcc88ca778537aef34f4c1093c..24fab492a853b6817026b54ce60bce9f83335a4b 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -83,6 +83,8 @@ public: virtual void activateFrame(int index); virtual void selectThread(int index); + virtual bool stateAcceptsBreakpointChanges() const; + virtual bool acceptsBreakpoint(BreakpointId id) const; virtual void attemptBreakpointSynchronization(); virtual void setRegisterValue(int regnr, const QString &value); diff --git a/src/plugins/debugger/cdb2/cdbengine2.cpp b/src/plugins/debugger/cdb2/cdbengine2.cpp index 2ca9a82602b3af9b8dc575a136c08daa0622a12d..06e7e0f8d55fbba21710b5f3dc135c561751955c 100644 --- a/src/plugins/debugger/cdb2/cdbengine2.cpp +++ b/src/plugins/debugger/cdb2/cdbengine2.cpp @@ -1669,6 +1669,23 @@ static inline BreakPointSyncType breakPointSyncType(const BreakHandler *handler, return added ? BreakpointsAdded : BreakpointsUnchanged; } +bool CdbEngine::stateAcceptsBreakpointChanges() const +{ + switch (state()) { + case InferiorRunOk: + case InferiorStopOk: + return true; + default: + break; + } + return false; +} + +bool CdbEngine::acceptsBreakpoint(BreakpointId id) const +{ + return DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id)); +} + void CdbEngine::attemptBreakpointSynchronization() { // Check if there is anything to be done at all. diff --git a/src/plugins/debugger/cdb2/cdbengine2.h b/src/plugins/debugger/cdb2/cdbengine2.h index 669805b825956a661c52facccd53ae6e56990aef..fb18021005e432127e1c5bacd53676faac863150 100644 --- a/src/plugins/debugger/cdb2/cdbengine2.h +++ b/src/plugins/debugger/cdb2/cdbengine2.h @@ -101,6 +101,8 @@ public: virtual void activateFrame(int index); virtual void selectThread(int index); + virtual bool stateAcceptsBreakpointChanges() const; + virtual bool acceptsBreakpoint(BreakpointId id) const; virtual void attemptBreakpointSynchronization(); virtual void fetchDisassembler(Debugger::Internal::DisassemblerViewAgent *agent); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index d198a9a72566a8e1e9261255b78ba1460f78edb6..5a2e147f07a71d9282f896caf74f4809bab23aa0 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1403,6 +1403,15 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description showMessageBox(QMessageBox::Information, tr("Exception Triggered"), msg); } +bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p) +{ + // 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); +} + } // namespace Debugger #include "debuggerengine.moc" diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index af29b47277010e78b9a04f0fda9f7b53388889ef..a659a235fc69b0228cfe722e1b863fcedd6099cd 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -345,6 +345,8 @@ protected: void showStoppedBySignalMessageBox(const QString meaning, QString name); void showStoppedByExceptionMessageBox(const QString &description); + static bool isCppBreakpoint(const Internal::BreakpointParameters &p); + private: // Wrapper engine needs access to state of its subengines. friend class QmlCppEngine; diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 35d66861590bee1d22723c6cfd089d01055f8a70..18cdc89ed301546245cd72ffef8fa3f757bf9f6e 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -344,7 +344,7 @@ DebuggerEngineType DebuggerRunControlPrivate::engineForExecutable // We need the CDB debugger in order to be able to debug VS // executables. - if (d->checkDebugConfiguration(ProjectExplorer::ToolChain_MSVC, + if (DebuggerRunControl::checkDebugConfiguration(ProjectExplorer::ToolChain_MSVC, &m_errorMessage, 0, &m_settingsIdHint)) { if (enabledEngineTypes & CdbEngineType) return CdbEngineType; @@ -372,7 +372,7 @@ DebuggerEngineType DebuggerRunControlPrivate::engineForMode if (startMode != AttachToRemote && (enabledEngineTypes & CdbEngineType)) return CdbEngineType; if (startMode == AttachCrashedExternal) { - m_errorMessage = tr("There is no debugging engine available for post-mortem debugging."); + m_errorMessage = DebuggerRunControl::tr("There is no debugging engine available for post-mortem debugging."); return NoEngineType; } return GdbEngineType; diff --git a/src/plugins/debugger/gdb/abstractgdbadapter.cpp b/src/plugins/debugger/gdb/abstractgdbadapter.cpp index 2454dde0edcd7c9e8e76eabf758d6d15add38cec..fa9dbbc39cdb6a388e47174b09baba0edaf6da3f 100644 --- a/src/plugins/debugger/gdb/abstractgdbadapter.cpp +++ b/src/plugins/debugger/gdb/abstractgdbadapter.cpp @@ -87,7 +87,7 @@ bool AbstractGdbAdapter::prepareWinCommand() if (perr != Utils::QtcProcess::SplitOk) { // perr == BadQuoting is never returned on Windows // FIXME? QTCREATORBUG-2809 - m_engine->handleAdapterStartFailed(QApplication::translate("DebuggerEngine", // Same message in CdbEngine + m_engine->handleAdapterStartFailed(QCoreApplication::translate("DebuggerEngine", // Same message in CdbEngine "Debugging complex command lines is currently not supported under Windows"), QString()); return false; } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 4a9620c934b489d8b6589191adff458eac8887da..9d5ebfff357c9607dc350fe1f7e2db1f37811711 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2568,9 +2568,7 @@ void GdbEngine::attemptBreakpointSynchronization() bool GdbEngine::acceptsBreakpoint(BreakpointId id) const { - const QString fileName = breakHandler()->fileName(id); - return !fileName.endsWith(QLatin1String("js")) - && !fileName.endsWith(QLatin1String("qml")); + return DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id)); } void GdbEngine::insertBreakpoint(BreakpointId id) @@ -2733,7 +2731,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response) foreach (const QByteArray &line, file.readAll().split('\n')) { if (line.isEmpty()) continue; - if (!line.at(0) == '[') + if (line.at(0) != '[') continue; int posCode = line.indexOf(']') + 2; int posAddress = line.indexOf("0x", posCode); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 0bd66f02ed769213f6c5dbcb836bd8e479df6e37..11476be3002964726130bfebde2a26db82076e0d 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -496,9 +496,7 @@ void QmlEngine::attemptBreakpointSynchronization() bool QmlEngine::acceptsBreakpoint(BreakpointId id) const { - const QString fileName = breakHandler()->fileName(id); - return fileName.endsWith(QLatin1String(".qml")) - || fileName.endsWith(QLatin1String(".js")); + return !DebuggerEngine::isCppBreakpoint(breakHandler()->breakpointData(id)); } void QmlEngine::loadSymbols(const QString &moduleName)