bool isMasterEngine() const;
DebuggerEngine *masterEngine() const;
+ virtual bool prepareForQmlBreak() { return false; }
+ virtual void handlePrepareForQmlBreak() {}
+
signals:
void stateChanged(const DebuggerState &state);
void updateViewsRequested();
m_gdbAdapter->handleRemoteSetupFailed(message);
}
+bool GdbEngine::prepareForQmlBreak()
+{
+ QTC_ASSERT(isSlaveEngine(), return false);
+ postCommand("-break-insert -t qscriptfunction.cpp:82",
+ NeedsStop, CB(handleQmlBreakpoint));
+ return true;
+}
+
+void GdbEngine::handleQmlBreakpoint(const GdbResponse &response)
+{
+ if (response.resultClass == GdbResultDone) {
+ qDebug() << "RESPONSE: " << response.toString();
+ }
+ QTC_ASSERT(masterEngine(), return);
+ masterEngine()->handlePrepareForQmlBreak();
+}
+
+
//
// Factory
//
-#include "qmlcppengine.h"
-#include "debuggerstartparameters.h"
-#include "qmlengine.h"
-#include "debuggermainwindow.h"
-#include "debuggercore.h"
-#include <qmljseditor/qmljseditorconstants.h>
+#include "qmlcppengine.h"
-#include <coreplugin/editormanager/editormanager.h>
-#include <coreplugin/editormanager/ieditor.h>
+#include "debuggercore.h"
+#include "debuggerstartparameters.h"
#include <utils/qtcassert.h>
-#include <QtCore/QTimer>
namespace Debugger {
namespace Internal {
d->m_cppEngine = createGdbEngine(sp, this);
} else {
QString errorMessage;
- d->m_cppEngine = Debugger::Internal::createCdbEngine(sp, this, &errorMessage);
+ d->m_cppEngine = createCdbEngine(sp, this, &errorMessage);
if (!d->m_cppEngine) {
qWarning("%s", qPrintable(errorMessage));
return;
void QmlCppEngine::executeStep()
{
+ if (d->m_activeEngine == d->m_qmlEngine) {
+ QTC_ASSERT(d->m_cppEngine->state() == InferiorRunOk, /**/);
+ if (d->m_cppEngine->prepareForQmlBreak())
+ return; // Wait for call back.
+ }
+
+ notifyInferiorRunRequested();
+ d->m_activeEngine->executeStep();
+}
+
+void QmlCppEngine::handlePrepareForQmlBreak()
+{
notifyInferiorRunRequested();
d->m_activeEngine->executeStep();
}