Commit 1aef962e authored by hjk's avatar hjk
Browse files

debugger: first shot at combined cpp/qml stepping

parent 349ff0f1
......@@ -244,6 +244,9 @@ public:
bool isMasterEngine() const;
DebuggerEngine *masterEngine() const;
virtual bool prepareForQmlBreak() { return false; }
virtual void handlePrepareForQmlBreak() {}
signals:
void stateChanged(const DebuggerState &state);
void updateViewsRequested();
......
......@@ -4502,6 +4502,24 @@ void GdbEngine::handleRemoteSetupFailed(const QString &message)
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
//
......
......@@ -517,6 +517,9 @@ private: ////////// View & Data Stuff //////////
void setLocals(const QList<GdbMi> &locals);
void handleStackListArgumentsClassic(const GdbResponse &response);
bool prepareForQmlBreak();
void handleQmlBreakpoint(const GdbResponse &response);
QSet<QByteArray> m_processedNames;
//
......
#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 {
......@@ -63,7 +57,7 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
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;
......@@ -219,6 +213,18 @@ void QmlCppEngine::detachDebugger()
}
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();
......
......@@ -94,6 +94,8 @@ private:
void setState(DebuggerState newState, bool forced = false);
void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state);
virtual void handlePrepareForQmlBreak();
private:
QScopedPointer<QmlCppEnginePrivate> d;
};
......
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