forked from qt-creator/qt-creator
debugger: start on integrated combined c++/qml debugging
This commit is contained in:
@@ -1928,3 +1928,35 @@ class ThreadNamesCommand(gdb.Command):
|
||||
ThreadNamesCommand()
|
||||
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Mixed C++/Qml debugging
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
def qmlb():
|
||||
# gdb.execute(command, to_string=True).split("\n")
|
||||
warm("RUNNING: break -f QScript::FunctionWrapper::proxyCall")
|
||||
output = catchCliOutput("rbreak -f QScript::FunctionWrapper::proxyCall")
|
||||
warn("OUTPUT: %s " % output)
|
||||
bp = output[0]
|
||||
warn("BP: %s " % bp)
|
||||
# BP: ['Breakpoint 3 at 0xf166e7: file .../qscriptfunction.cpp, line 75.\\n'] \n"
|
||||
pos = bp.find(' ') + 1
|
||||
warn("POS: %s " % pos)
|
||||
nr = bp[bp.find(' ') + 1 : bp.find(' at ')]
|
||||
warn("NR: %s " % nr)
|
||||
return bp
|
||||
|
||||
|
||||
class SetQmlBreakpoint(gdb.Command):
|
||||
"""Set helper breakpoint Script::FunctionWrapper::proxyCall"""
|
||||
|
||||
def __init__(self):
|
||||
super(SetQmlBreakpoint, self).__init__("qmlb", gdb.COMMAND_OBSCURE)
|
||||
|
||||
def invoke(self, arg, from_tty):
|
||||
qmlb()
|
||||
|
||||
SetQmlBreakpoint()
|
||||
|
||||
@@ -1094,6 +1094,7 @@ public slots:
|
||||
|
||||
void handleExecStep()
|
||||
{
|
||||
qDebug() << "CURRENT: " << currentEngine();
|
||||
currentEngine()->resetLocation();
|
||||
if (boolSetting(OperateByInstruction))
|
||||
currentEngine()->executeStepI();
|
||||
@@ -1964,6 +1965,7 @@ void DebuggerPluginPrivate::startDebugger(RunControl *rc)
|
||||
|
||||
void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
|
||||
{
|
||||
qDebug() << "CONNECT: " << engine;
|
||||
if (!engine)
|
||||
engine = dummyEngine();
|
||||
|
||||
|
||||
@@ -76,6 +76,10 @@ void AbstractPlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &respon
|
||||
if (m_engine->m_gdbVersion < 70000)
|
||||
m_engine->postCommand("info target", CB(handleInfoTarget));
|
||||
}
|
||||
//if (m_engine->isSlaveEngine())
|
||||
//m_engine->postCommand("qmlb", GdbEngine::ConsoleCommand);
|
||||
//m_engine->postCommand("rbreak QScript::FunctionWrapper::proxyCall");
|
||||
// m_engine->postCommand("-break-insert -f 'myns::QScript::FunctionWrapper::proxyCall'");
|
||||
m_engine->handleInferiorPrepared();
|
||||
} else {
|
||||
QByteArray ba = response.data.findChild("msg").data();
|
||||
|
||||
@@ -70,6 +70,7 @@ class CoreGdbAdapter;
|
||||
class LocalPlainGdbAdapter;
|
||||
class RemoteGdbServerAdapter;
|
||||
class TrkGdbAdapter;
|
||||
class QmlCppEngine;
|
||||
|
||||
enum DebuggingHelperState
|
||||
{
|
||||
@@ -100,6 +101,7 @@ private:
|
||||
friend class RemotePlainGdbAdapter;
|
||||
friend class TrkGdbAdapter;
|
||||
friend class TcfTrkGdbAdapter;
|
||||
friend class QmlCppEngine;
|
||||
|
||||
private: ////////// General Interface //////////
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "debuggermainwindow.h"
|
||||
#include "debuggercore.h"
|
||||
|
||||
#include "gdb/gdbengine.h"
|
||||
|
||||
#include <qmljseditor/qmljseditorconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
@@ -23,6 +25,7 @@ DebuggerEngine *createQmlEngine(const DebuggerStartParameters &);
|
||||
|
||||
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp)
|
||||
{
|
||||
qDebug() << "CREATING QMLCPPENGINE";
|
||||
QmlCppEngine *newEngine = new QmlCppEngine(sp);
|
||||
if (newEngine->cppEngine())
|
||||
return newEngine;
|
||||
@@ -119,7 +122,7 @@ void QmlCppEngine::setActiveEngine(DebuggerLanguage language)
|
||||
}
|
||||
if (previousEngine != d->m_activeEngine) {
|
||||
showStatusMessage(tr("%1 debugger activated").arg(engineName));
|
||||
debuggerCore()->displayDebugger(d->m_activeEngine, updateEngine);
|
||||
//debuggerCore()->displayDebugger(d->m_activeEngine, updateEngine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +310,18 @@ void QmlCppEngine::detachDebugger()
|
||||
|
||||
void QmlCppEngine::executeStep()
|
||||
{
|
||||
d->m_activeEngine->executeStep();
|
||||
qDebug() << "CPP ENGINE: " << d->m_cppEngine;
|
||||
if (d->m_activeEngine == d->m_cppEngine) {
|
||||
d->m_cppEngine->executeStep();
|
||||
} else {
|
||||
QByteArray ba =
|
||||
"-break-insert -f 'myns::QScript::FunctionWrapper::proxyCall'";
|
||||
GdbEngine *cppEngine = qobject_cast<GdbEngine *>(d->m_cppEngine);
|
||||
qDebug() << "CPP ENGINE: " << cppEngine << d->m_cppEngine;
|
||||
if (cppEngine)
|
||||
cppEngine->postCommand(ba);
|
||||
d->m_qmlEngine->executeStep();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlCppEngine::executeStepOut()
|
||||
@@ -317,12 +331,14 @@ void QmlCppEngine::executeStepOut()
|
||||
|
||||
void QmlCppEngine::executeNext()
|
||||
{
|
||||
qDebug() << "NEXT";
|
||||
d->m_activeEngine->executeNext();
|
||||
}
|
||||
|
||||
void QmlCppEngine::executeStepI()
|
||||
{
|
||||
d->m_activeEngine->executeStepI();
|
||||
qDebug() << "STEP I";
|
||||
d->m_activeEngine->executeStep();
|
||||
}
|
||||
|
||||
void QmlCppEngine::executeNextI()
|
||||
|
||||
Reference in New Issue
Block a user