2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-18 10:36:52 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-18 10:36:52 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-18 10:36:52 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-02-18 10:36:52 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-02-18 10:36:52 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2011-01-14 17:08:59 +01:00
|
|
|
#include "qmlcppengine.h"
|
2011-02-21 17:01:40 +01:00
|
|
|
#include "qmlengine.h"
|
2015-01-10 01:07:01 +01:00
|
|
|
|
2017-05-05 14:45:36 +02:00
|
|
|
#include <debugger/debuggercore.h>
|
2014-10-17 13:40:04 +02:00
|
|
|
#include <debugger/debuggerruncontrol.h>
|
2015-03-06 13:36:42 +01:00
|
|
|
#include <debugger/debuggertooltipmanager.h>
|
2015-01-10 01:07:01 +01:00
|
|
|
#include <debugger/breakhandler.h>
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/stackhandler.h>
|
2015-02-26 17:19:57 +01:00
|
|
|
#include <debugger/threaddata.h>
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/watchhandler.h>
|
2015-11-10 16:59:02 +01:00
|
|
|
#include <debugger/console/console.h>
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2012-03-30 15:30:46 +02:00
|
|
|
#include <qmljseditor/qmljseditorconstants.h>
|
|
|
|
|
#include <cppeditor/cppeditorconstants.h>
|
2011-01-14 14:25:02 +01:00
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
namespace Debugger {
|
2011-01-11 11:06:15 +01:00
|
|
|
namespace Internal {
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2011-01-19 10:48:39 +01:00
|
|
|
enum { debug = 0 };
|
|
|
|
|
|
|
|
|
|
#define EDEBUG(s) do { if (debug) qDebug() << s; } while (0)
|
|
|
|
|
|
2015-09-11 16:51:11 +02:00
|
|
|
#define CHECK_STATE(s) do { checkState(s, __FILE__, __LINE__); } while (0)
|
2015-03-05 09:16:17 +01:00
|
|
|
|
2017-09-26 16:24:05 +02:00
|
|
|
DebuggerEngine *createQmlCppEngine(DebuggerEngine *cppEngine)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2017-09-26 16:24:05 +02:00
|
|
|
return new QmlCppEngine(cppEngine);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
2010-10-27 15:23:30 +02:00
|
|
|
|
2011-01-19 17:34:28 +01:00
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// QmlCppEngine
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-09-26 16:24:05 +02:00
|
|
|
QmlCppEngine::QmlCppEngine(DebuggerEngine *cppEngine)
|
2017-05-05 14:45:36 +02:00
|
|
|
{
|
|
|
|
|
setObjectName("QmlCppEngine");
|
2017-09-26 16:24:05 +02:00
|
|
|
m_qmlEngine = new QmlEngine;
|
2017-05-05 14:45:36 +02:00
|
|
|
m_qmlEngine->setMasterEngine(this);
|
|
|
|
|
m_cppEngine = cppEngine;
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->setMasterEngine(this);
|
2017-05-19 11:54:13 +02:00
|
|
|
m_activeEngine = m_cppEngine;
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QmlCppEngine::~QmlCppEngine()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
delete m_qmlEngine;
|
|
|
|
|
delete m_cppEngine;
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-03-30 15:30:46 +02:00
|
|
|
bool QmlCppEngine::canDisplayTooltip() const
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip();
|
2012-03-30 15:30:46 +02:00
|
|
|
}
|
|
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
bool QmlCppEngine::canHandleToolTip(const DebuggerToolTipContext &ctx) const
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2012-03-30 15:30:46 +02:00
|
|
|
bool success = false;
|
2015-03-06 13:36:42 +01:00
|
|
|
if (ctx.isCppEditor)
|
2015-06-08 18:07:11 +02:00
|
|
|
success = m_cppEngine->canHandleToolTip(ctx);
|
2015-03-06 13:36:42 +01:00
|
|
|
else
|
2015-06-08 18:07:11 +02:00
|
|
|
success = m_qmlEngine->canHandleToolTip(ctx);
|
2012-03-30 15:30:46 +02:00
|
|
|
return success;
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void QmlCppEngine::updateItem(const QString &iname)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2015-06-08 18:07:11 +02:00
|
|
|
if (iname.startsWith("inspect."))
|
2015-07-15 17:14:29 +02:00
|
|
|
m_qmlEngine->updateItem(iname);
|
2012-05-10 14:26:31 +02:00
|
|
|
else
|
2015-07-15 17:14:29 +02:00
|
|
|
m_activeEngine->updateItem(iname);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void QmlCppEngine::expandItem(const QString &iname)
|
2015-07-16 13:45:43 +02:00
|
|
|
{
|
|
|
|
|
if (iname.startsWith("inspect."))
|
|
|
|
|
m_qmlEngine->expandItem(iname);
|
|
|
|
|
else
|
|
|
|
|
m_activeEngine->expandItem(iname);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void QmlCppEngine::selectWatchData(const QString &iname)
|
2012-11-23 13:35:44 +01:00
|
|
|
{
|
2015-06-08 18:07:11 +02:00
|
|
|
if (iname.startsWith("inspect."))
|
|
|
|
|
m_qmlEngine->selectWatchData(iname);
|
2012-11-23 13:35:44 +01:00
|
|
|
}
|
|
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
void QmlCppEngine::watchPoint(const QPoint &point)
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->watchPoint(point);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
void QmlCppEngine::fetchMemory(MemoryAgent *agent, quint64 addr, quint64 length)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2016-07-14 10:00:15 +02:00
|
|
|
m_cppEngine->fetchMemory(agent, addr, length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::changeMemory(MemoryAgent *agent, quint64 addr, const QByteArray &data)
|
|
|
|
|
{
|
|
|
|
|
m_cppEngine->changeMemory(agent, addr, data);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2010-12-14 12:29:32 +01:00
|
|
|
void QmlCppEngine::fetchDisassembler(DisassemblerAgent *da)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->fetchDisassembler(da);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::activateFrame(int index)
|
|
|
|
|
{
|
2011-10-17 17:45:15 +02:00
|
|
|
if (state() != InferiorStopOk && state() != InferiorUnrunnable)
|
|
|
|
|
return;
|
|
|
|
|
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->activateFrame(index);
|
2012-02-23 17:14:46 +01:00
|
|
|
|
2011-02-02 13:35:42 +01:00
|
|
|
stackHandler()->setCurrentIndex(index);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::reloadModules()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->reloadModules();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::examineModules()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->examineModules();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::loadSymbols(const QString &moduleName)
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->loadSymbols(moduleName);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::loadAllSymbols()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->loadAllSymbols();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::requestModuleSymbols(const QString &moduleName)
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->requestModuleSymbols(moduleName);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::reloadRegisters()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->reloadRegisters();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::reloadSourceFiles()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->reloadSourceFiles();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::reloadFullStack()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->reloadFullStack();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void QmlCppEngine::setRegisterValue(const QString &name, const QString &value)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-12-17 13:14:29 +01:00
|
|
|
m_cppEngine->setRegisterValue(name, value);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-12 20:28:17 +01:00
|
|
|
|
|
|
|
|
bool QmlCppEngine::hasCapability(unsigned cap) const
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
|
|
|
|
// ### this could also be an OR of both engines' capabilities
|
2014-06-05 23:03:06 +02:00
|
|
|
bool hasCap = m_cppEngine->hasCapability(cap);
|
|
|
|
|
if (m_activeEngine != m_cppEngine) {
|
2012-03-29 11:03:54 +02:00
|
|
|
//Some capabilities cannot be handled by QML Engine
|
|
|
|
|
//Expand this list as and when required
|
2012-01-12 20:28:17 +01:00
|
|
|
if (cap == AddWatcherWhileRunningCapability)
|
2014-06-05 23:03:06 +02:00
|
|
|
hasCap = hasCap || m_qmlEngine->hasCapability(cap);
|
2012-03-29 11:03:54 +02:00
|
|
|
if (cap == WatchWidgetsCapability ||
|
|
|
|
|
cap == DisassemblerCapability ||
|
|
|
|
|
cap == OperateByInstructionCapability ||
|
|
|
|
|
cap == ReverseSteppingCapability)
|
2014-06-05 23:03:06 +02:00
|
|
|
hasCap = hasCap && m_qmlEngine->hasCapability(cap);
|
2011-08-04 14:25:38 +02:00
|
|
|
}
|
2012-01-12 20:28:17 +01:00
|
|
|
return hasCap;
|
2011-02-28 10:58:21 +01:00
|
|
|
}
|
|
|
|
|
|
2010-08-30 07:52:41 +02:00
|
|
|
bool QmlCppEngine::isSynchronous() const
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
return m_activeEngine->isSynchronous();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QString QmlCppEngine::qtNamespace() const
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
return m_cppEngine->qtNamespace();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::createSnapshot()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->createSnapshot();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::updateAll()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->updateAll();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::attemptBreakpointSynchronization()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->attemptBreakpointSynchronization();
|
2011-09-29 16:49:18 +02:00
|
|
|
|
2014-06-05 23:03:06 +02:00
|
|
|
switch (m_qmlEngine->state()) {
|
2011-09-29 16:49:18 +02:00
|
|
|
case InferiorRunOk:
|
|
|
|
|
case InferiorRunRequested:
|
|
|
|
|
case InferiorStopOk: // fall through
|
|
|
|
|
case InferiorStopRequested:
|
2014-06-05 23:03:06 +02:00
|
|
|
m_qmlEngine->attemptBreakpointSynchronization();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-08-03 14:48:56 +02:00
|
|
|
}
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-21 14:50:19 +01:00
|
|
|
void QmlCppEngine::doUpdateLocals(const UpdateParameters &up)
|
|
|
|
|
{
|
|
|
|
|
m_activeEngine->doUpdateLocals(up);
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-10 01:07:01 +01:00
|
|
|
bool QmlCppEngine::acceptsBreakpoint(Breakpoint bp) const
|
2010-10-05 11:01:14 +02:00
|
|
|
{
|
2015-01-10 01:07:01 +01:00
|
|
|
return m_cppEngine->acceptsBreakpoint(bp)
|
|
|
|
|
|| m_qmlEngine->acceptsBreakpoint(bp);
|
2010-10-05 11:01:14 +02:00
|
|
|
}
|
|
|
|
|
|
2012-10-19 16:37:57 +02:00
|
|
|
void QmlCppEngine::selectThread(ThreadId threadId)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->selectThread(threadId);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2015-03-19 12:42:53 +01:00
|
|
|
void QmlCppEngine::assignValueInDebugger(WatchItem *item,
|
2010-11-26 10:10:00 +01:00
|
|
|
const QString &expr, const QVariant &value)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2015-03-19 12:42:53 +01:00
|
|
|
if (item->isInspect())
|
|
|
|
|
m_qmlEngine->assignValueInDebugger(item, expr, value);
|
2012-06-07 14:27:38 +02:00
|
|
|
else
|
2015-03-19 12:42:53 +01:00
|
|
|
m_activeEngine->assignValueInDebugger(item, expr, value);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-02-23 12:33:04 +01:00
|
|
|
void QmlCppEngine::notifyInferiorIll()
|
|
|
|
|
{
|
|
|
|
|
//Call notifyInferiorIll of cpp engine
|
|
|
|
|
//as qml engine will follow state transitions
|
|
|
|
|
//of cpp engine
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->notifyInferiorIll();
|
2012-02-23 12:33:04 +01:00
|
|
|
}
|
|
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
void QmlCppEngine::detachDebugger()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_qmlEngine->detachDebugger();
|
|
|
|
|
m_cppEngine->detachDebugger();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeStep()
|
2011-01-14 17:08:59 +01:00
|
|
|
{
|
2011-10-13 11:06:07 +02:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeStep();
|
2011-01-14 17:08:59 +01:00
|
|
|
}
|
|
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
void QmlCppEngine::executeStepOut()
|
|
|
|
|
{
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeStepOut();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeNext()
|
|
|
|
|
{
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeNext();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeStepI()
|
|
|
|
|
{
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeStepI();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeNextI()
|
|
|
|
|
{
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeNextI();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeReturn()
|
|
|
|
|
{
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeReturn();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::continueInferior()
|
|
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER CONTINUE INFERIOR"
|
2014-06-05 23:03:06 +02:00
|
|
|
<< state() << m_qmlEngine->state());
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorRunRequested();
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_cppEngine->state() == InferiorStopOk) {
|
|
|
|
|
m_cppEngine->continueInferior();
|
|
|
|
|
} else if (m_qmlEngine->state() == InferiorStopOk) {
|
|
|
|
|
m_qmlEngine->continueInferior();
|
2010-11-15 17:09:28 +01:00
|
|
|
} else {
|
2011-01-14 14:25:02 +01:00
|
|
|
QTC_ASSERT(false, qDebug() << "MASTER CANNOT CONTINUE INFERIOR"
|
2014-06-05 23:03:06 +02:00
|
|
|
<< m_cppEngine->state() << m_qmlEngine->state());
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyEngineIll();
|
2010-11-15 17:09:28 +01:00
|
|
|
}
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::interruptInferior()
|
|
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER INTERRUPT INFERIOR");
|
2017-10-16 13:30:53 +02:00
|
|
|
m_activeEngine->interruptInferior();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
void QmlCppEngine::executeRunToLine(const ContextData &data)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeRunToLine(data);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlCppEngine::executeRunToFunction(const QString &functionName)
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeRunToFunction(functionName);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
void QmlCppEngine::executeJumpToLine(const ContextData &data)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine->executeJumpToLine(data);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-04-10 09:36:15 +02:00
|
|
|
void QmlCppEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_qmlEngine->executeDebuggerCommand(command, languages);
|
|
|
|
|
m_cppEngine->executeDebuggerCommand(command, languages);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2010-11-15 17:09:28 +01:00
|
|
|
/////////////////////////////////////////////////////////
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::setupEngine()
|
2010-11-15 17:09:28 +01:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER SETUP ENGINE");
|
2017-05-19 11:54:13 +02:00
|
|
|
m_activeEngine = m_cppEngine;
|
2014-06-05 23:03:06 +02:00
|
|
|
m_qmlEngine->setupSlaveEngine();
|
|
|
|
|
m_cppEngine->setupSlaveEngine();
|
2011-01-14 14:25:02 +01:00
|
|
|
}
|
2010-11-15 17:09:28 +01:00
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::setupInferior()
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER SETUP INFERIOR");
|
2017-10-16 09:51:11 +02:00
|
|
|
m_qmlEngine->setupInferior();
|
|
|
|
|
m_cppEngine->setupInferior();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::runEngine()
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER RUN ENGINE");
|
2014-06-05 23:03:06 +02:00
|
|
|
m_qmlEngine->runSlaveEngine();
|
|
|
|
|
m_cppEngine->runSlaveEngine();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::shutdownInferior()
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER SHUTDOWN INFERIOR");
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->shutdownInferior();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2010-11-15 17:09:28 +01:00
|
|
|
void QmlCppEngine::shutdownEngine()
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("\nMASTER SHUTDOWN ENGINE");
|
2017-01-05 15:23:44 +01:00
|
|
|
m_qmlEngine->shutdownSlaveEngine();
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->shutdownSlaveEngine();
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-19 14:42:16 +01:00
|
|
|
void QmlCppEngine::quitDebugger()
|
|
|
|
|
{
|
|
|
|
|
EDEBUG("\nMASTER QUIT DEBUGGER");
|
2014-06-05 23:03:06 +02:00
|
|
|
m_cppEngine->quitDebugger();
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
|
2017-09-19 12:31:19 +02:00
|
|
|
void QmlCppEngine::abortDebuggerProcess()
|
2012-01-18 14:58:01 +01:00
|
|
|
{
|
|
|
|
|
EDEBUG("\nMASTER ABORT DEBUGGER");
|
2017-09-19 12:31:19 +02:00
|
|
|
m_cppEngine->abortDebuggerProcess();
|
2012-01-18 14:58:01 +01:00
|
|
|
}
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::setState(DebuggerState newState, bool forced)
|
2010-08-18 13:54:12 +02:00
|
|
|
{
|
2011-01-19 10:48:39 +01:00
|
|
|
EDEBUG("SET MASTER STATE: " << newState);
|
2014-06-05 23:03:06 +02:00
|
|
|
EDEBUG(" CPP STATE: " << m_cppEngine->state());
|
|
|
|
|
EDEBUG(" QML STATE: " << m_qmlEngine->state());
|
2011-01-14 14:25:02 +01:00
|
|
|
DebuggerEngine::setState(newState, forced);
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
void QmlCppEngine::slaveEngineStateChanged
|
|
|
|
|
(DebuggerEngine *slaveEngine, const DebuggerState newState)
|
2010-11-15 17:09:28 +01:00
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
DebuggerEngine *otherEngine = (slaveEngine == m_cppEngine)
|
2017-05-19 13:58:17 +02:00
|
|
|
? m_qmlEngine.data() : m_cppEngine.data();
|
2012-01-31 13:23:05 +01:00
|
|
|
|
2017-05-19 11:54:13 +02:00
|
|
|
QTC_ASSERT(otherEngine, return);
|
2012-01-31 13:23:05 +01:00
|
|
|
QTC_CHECK(otherEngine != slaveEngine);
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2012-01-31 13:23:05 +01:00
|
|
|
if (debug) {
|
2011-10-20 18:37:38 +02:00
|
|
|
EDEBUG("GOT SLAVE STATE: " << slaveEngine << newState);
|
|
|
|
|
EDEBUG(" OTHER ENGINE: " << otherEngine << otherEngine->state());
|
|
|
|
|
EDEBUG(" COMBINED ENGINE: " << this << state() << isDying());
|
|
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
|
2015-03-05 15:21:00 +01:00
|
|
|
if (state() == DebuggerFinished) {
|
|
|
|
|
// We are done and don't care about slave state changes anymore.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-19 14:42:16 +01:00
|
|
|
// Idea is to follow the state of the cpp engine, except where we are stepping in QML.
|
|
|
|
|
// That is, when the QmlEngine moves between InferiorStopOk, and InferiorRunOk, InferiorStopOk ...
|
|
|
|
|
//
|
|
|
|
|
// Accordingly, the 'active engine' is the cpp engine until the qml engine enters the
|
|
|
|
|
// InferiorStopOk state. The cpp engine becomes the active one again as soon as it itself enters
|
|
|
|
|
// the InferiorStopOk state.
|
2011-01-14 14:25:02 +01:00
|
|
|
|
2014-06-05 23:03:06 +02:00
|
|
|
if (slaveEngine == m_cppEngine) {
|
2011-09-29 16:49:18 +02:00
|
|
|
switch (newState) {
|
2012-01-19 14:42:16 +01:00
|
|
|
case DebuggerNotReady: {
|
2011-09-29 16:49:18 +02:00
|
|
|
// Can this ever happen?
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineSetupRequested: {
|
2015-03-05 09:16:17 +01:00
|
|
|
// Set by queueSetupEngine()
|
|
|
|
|
CHECK_STATE(EngineSetupRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineSetupFailed: {
|
2011-09-29 16:49:18 +02:00
|
|
|
qmlEngine()->quitDebugger();
|
|
|
|
|
notifyEngineSetupFailed();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineSetupOk: {
|
2010-11-15 17:09:28 +01:00
|
|
|
notifyEngineSetupOk();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorSetupRequested: {
|
2015-03-05 09:16:17 +01:00
|
|
|
// Set by queueSetupInferior()
|
|
|
|
|
CHECK_STATE(InferiorSetupRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorSetupFailed: {
|
2011-09-29 16:49:18 +02:00
|
|
|
qmlEngine()->quitDebugger();
|
2011-02-02 10:42:32 +01:00
|
|
|
notifyInferiorSetupFailed();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorSetupOk: {
|
2011-01-14 14:25:02 +01:00
|
|
|
notifyInferiorSetupOk();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineRunRequested: {
|
|
|
|
|
// set by queueRunEngine()
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineRunFailed: {
|
2011-09-29 16:49:18 +02:00
|
|
|
qmlEngine()->quitDebugger();
|
2011-02-02 10:42:32 +01:00
|
|
|
notifyEngineRunFailed();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorUnrunnable: {
|
|
|
|
|
qmlEngine()->quitDebugger();
|
2015-02-26 15:21:43 +01:00
|
|
|
notifyEngineRunOkAndInferiorUnrunnable();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorRunRequested: {
|
2015-03-05 09:16:17 +01:00
|
|
|
// Might be set already by notifyInferiorRunRequested()
|
|
|
|
|
if (state() != InferiorRunRequested) {
|
|
|
|
|
CHECK_STATE(InferiorStopOk);
|
2012-01-19 14:42:16 +01:00
|
|
|
notifyInferiorRunRequested();
|
2015-03-05 09:16:17 +01:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorRunOk: {
|
2011-09-29 16:49:18 +02:00
|
|
|
if (state() == EngineRunRequested)
|
2011-01-14 18:47:44 +01:00
|
|
|
notifyEngineRunAndInferiorRunOk();
|
2011-09-29 16:49:18 +02:00
|
|
|
else if (state() == InferiorRunRequested)
|
2011-01-14 18:47:44 +01:00
|
|
|
notifyInferiorRunOk();
|
2015-03-05 09:16:17 +01:00
|
|
|
else
|
|
|
|
|
QTC_ASSERT(false, qDebug() << state());
|
2012-04-10 11:57:00 +02:00
|
|
|
|
|
|
|
|
if (qmlEngine()->state() == InferiorStopOk) {
|
|
|
|
|
// track qml engine again
|
|
|
|
|
setState(InferiorStopRequested);
|
|
|
|
|
notifyInferiorStopOk();
|
2014-06-05 23:03:06 +02:00
|
|
|
setActiveEngine(m_qmlEngine);
|
2012-04-10 11:57:00 +02:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorRunFailed: {
|
2011-09-29 16:49:18 +02:00
|
|
|
qmlEngine()->quitDebugger();
|
|
|
|
|
notifyInferiorRunFailed();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorStopRequested: {
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_activeEngine == cppEngine()) {
|
2015-03-05 09:16:17 +01:00
|
|
|
if (state() == InferiorRunOk) {
|
2012-01-19 14:42:16 +01:00
|
|
|
setState(InferiorStopRequested);
|
2015-03-05 09:16:17 +01:00
|
|
|
} else {
|
|
|
|
|
// Might be set by doInterruptInferior()
|
|
|
|
|
CHECK_STATE(InferiorStopRequested);
|
|
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
} else {
|
2015-03-05 09:16:17 +01:00
|
|
|
// We're debugging qml, but got an interrupt, or abort
|
2012-01-19 14:42:16 +01:00
|
|
|
if (state() == InferiorRunOk) {
|
|
|
|
|
setState(InferiorStopRequested);
|
|
|
|
|
} else if (state() == InferiorStopOk) {
|
2017-05-19 11:54:13 +02:00
|
|
|
if (!isDying()) {
|
|
|
|
|
notifyInferiorRunRequested();
|
|
|
|
|
notifyInferiorRunOk();
|
|
|
|
|
setState(InferiorStopRequested);
|
|
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
} else if (state() == InferiorRunRequested) {
|
|
|
|
|
notifyInferiorRunOk();
|
|
|
|
|
setState(InferiorStopRequested);
|
2015-03-05 09:16:17 +01:00
|
|
|
} else {
|
|
|
|
|
QTC_ASSERT(false, qDebug() << state());
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
2012-04-10 11:57:00 +02:00
|
|
|
// now track cpp engine
|
2014-06-05 23:03:06 +02:00
|
|
|
setActiveEngine(m_cppEngine);
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
2012-04-10 11:57:00 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorStopOk: {
|
2011-09-29 16:49:18 +02:00
|
|
|
if (isDying()) {
|
|
|
|
|
EDEBUG("... CPP ENGINE STOPPED DURING SHUTDOWN ");
|
2012-01-19 14:42:16 +01:00
|
|
|
QTC_ASSERT(state() == InferiorStopRequested
|
|
|
|
|
|| state() == InferiorRunOk
|
|
|
|
|
|| state() == InferiorStopOk, qDebug() << state());
|
|
|
|
|
|
|
|
|
|
// Just to make sure, we're shutting down anyway ...
|
2017-05-19 11:54:13 +02:00
|
|
|
m_activeEngine = m_cppEngine;
|
2012-01-19 14:42:16 +01:00
|
|
|
|
2011-09-29 16:49:18 +02:00
|
|
|
if (state() == InferiorStopRequested)
|
2012-01-19 14:42:16 +01:00
|
|
|
setState(InferiorStopOk);
|
|
|
|
|
// otherwise we're probably inside notifyInferiorStopOk already
|
2011-01-14 14:25:02 +01:00
|
|
|
} else {
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_activeEngine != cppEngine()) {
|
2011-10-06 17:05:38 +02:00
|
|
|
showStatusMessage(tr("C++ debugger activated"));
|
2014-06-05 23:03:06 +02:00
|
|
|
setActiveEngine(m_cppEngine);
|
2011-09-29 16:49:18 +02:00
|
|
|
}
|
|
|
|
|
switch (state()) {
|
|
|
|
|
case InferiorStopRequested:
|
|
|
|
|
EDEBUG("... CPP ENGINE STOPPED EXPECTEDLY");
|
|
|
|
|
notifyInferiorStopOk();
|
|
|
|
|
break;
|
|
|
|
|
case EngineRunRequested:
|
|
|
|
|
EDEBUG("... CPP ENGINE STOPPED ON STARTUP");
|
|
|
|
|
notifyEngineRunAndInferiorStopOk();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
case InferiorRunOk:
|
2011-09-29 16:49:18 +02:00
|
|
|
EDEBUG("... CPP ENGINE STOPPED SPONTANEOUSLY");
|
|
|
|
|
notifyInferiorSpontaneousStop();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
case InferiorRunRequested:
|
|
|
|
|
// can happen if qml engine was active
|
|
|
|
|
notifyInferiorRunFailed();
|
2017-06-02 16:12:39 +03:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
default:
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(InferiorStopOk);
|
2012-01-19 14:42:16 +01:00
|
|
|
break;
|
2011-09-29 16:49:18 +02:00
|
|
|
}
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorStopFailed: {
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(InferiorStopRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
notifyInferiorStopFailed();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorShutdownRequested: {
|
2015-03-05 09:16:17 +01:00
|
|
|
if (state() == InferiorStopOk) {
|
2012-01-19 14:42:16 +01:00
|
|
|
setState(InferiorShutdownRequested);
|
2015-03-05 09:16:17 +01:00
|
|
|
} else {
|
|
|
|
|
// might be set by queueShutdownInferior() already
|
|
|
|
|
CHECK_STATE(InferiorShutdownRequested);
|
|
|
|
|
}
|
2012-04-10 11:51:48 +02:00
|
|
|
qmlEngine()->quitDebugger();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorShutdownFailed: {
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(InferiorShutdownRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
notifyInferiorShutdownFailed();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case InferiorShutdownOk: {
|
2013-07-17 00:01:45 +03:00
|
|
|
if (state() == InferiorShutdownRequested) {
|
2011-01-14 19:32:47 +01:00
|
|
|
notifyInferiorShutdownOk();
|
2013-07-17 00:01:45 +03:00
|
|
|
} else {
|
2012-03-02 11:32:53 +01:00
|
|
|
// we got InferiorExitOk before, but ignored it ...
|
|
|
|
|
notifyInferiorExited();
|
|
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineShutdownRequested: {
|
|
|
|
|
// set by queueShutdownEngine()
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(EngineShutdownRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
case EngineShutdownFailed: {
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(EngineShutdownRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
notifyEngineShutdownFailed();
|
|
|
|
|
break;
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
case EngineShutdownOk: {
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(EngineShutdownRequested);
|
2011-01-14 17:34:42 +01:00
|
|
|
notifyEngineShutdownOk();
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
case DebuggerFinished: {
|
|
|
|
|
// set by queueFinishDebugger()
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(DebuggerFinished);
|
2011-09-29 16:49:18 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
} else {
|
|
|
|
|
// QML engine state change
|
|
|
|
|
if (newState == InferiorStopOk) {
|
2012-01-19 14:42:16 +01:00
|
|
|
if (isDying()) {
|
|
|
|
|
EDEBUG("... QML ENGINE STOPPED DURING SHUTDOWN ");
|
|
|
|
|
|
|
|
|
|
// Just to make sure, we're shutting down anyway ...
|
2014-06-05 23:03:06 +02:00
|
|
|
setActiveEngine(m_cppEngine);
|
2012-01-19 14:42:16 +01:00
|
|
|
|
|
|
|
|
if (state() == InferiorStopRequested)
|
|
|
|
|
notifyInferiorStopOk();
|
|
|
|
|
// otherwise we're probably inside notifyInferiorStopOk already
|
|
|
|
|
} else {
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_activeEngine != qmlEngine()) {
|
2012-01-19 14:42:16 +01:00
|
|
|
showStatusMessage(tr("QML debugger activated"));
|
2014-06-05 23:03:06 +02:00
|
|
|
setActiveEngine(m_qmlEngine);
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (state() == InferiorRunOk)
|
|
|
|
|
notifyInferiorSpontaneousStop();
|
2012-04-10 11:51:48 +02:00
|
|
|
else if (state() == InferiorStopRequested)
|
2012-01-19 14:42:16 +01:00
|
|
|
notifyInferiorStopOk();
|
2015-03-05 09:16:17 +01:00
|
|
|
else
|
|
|
|
|
CHECK_STATE(InferiorShutdownRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
}
|
2012-01-19 14:42:16 +01:00
|
|
|
|
2011-09-29 16:49:18 +02:00
|
|
|
} else if (newState == InferiorRunOk) {
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_activeEngine == qmlEngine()) {
|
2015-03-05 09:16:17 +01:00
|
|
|
CHECK_STATE(InferiorRunRequested);
|
2011-09-29 16:49:18 +02:00
|
|
|
notifyInferiorRunOk();
|
2012-01-19 14:42:16 +01:00
|
|
|
}
|
2011-09-29 16:49:18 +02:00
|
|
|
}
|
2010-08-18 13:54:12 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-10-12 17:26:18 +02:00
|
|
|
void QmlCppEngine::resetLocation()
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
if (m_qmlEngine)
|
|
|
|
|
m_qmlEngine->resetLocation();
|
|
|
|
|
if (m_cppEngine)
|
|
|
|
|
m_cppEngine->resetLocation();
|
2011-10-17 17:45:15 +02:00
|
|
|
|
|
|
|
|
DebuggerEngine::resetLocation();
|
2011-10-12 17:26:18 +02:00
|
|
|
}
|
|
|
|
|
|
2014-10-14 21:13:22 +02:00
|
|
|
void QmlCppEngine::reloadDebuggingHelpers()
|
|
|
|
|
{
|
|
|
|
|
if (m_cppEngine)
|
|
|
|
|
m_cppEngine->reloadDebuggingHelpers();
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-01 15:25:06 +01:00
|
|
|
void QmlCppEngine::debugLastCommand()
|
|
|
|
|
{
|
|
|
|
|
if (m_cppEngine)
|
|
|
|
|
m_cppEngine->debugLastCommand();
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-21 16:39:45 +02:00
|
|
|
DebuggerEngine *QmlCppEngine::qmlEngine() const
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
return m_qmlEngine;
|
2011-09-21 16:39:45 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-05 14:45:36 +02:00
|
|
|
void QmlCppEngine::setRunTool(DebuggerRunTool *runTool)
|
|
|
|
|
{
|
|
|
|
|
DebuggerEngine::setRunTool(runTool);
|
|
|
|
|
m_qmlEngine->setRunTool(runTool);
|
|
|
|
|
m_cppEngine->setRunTool(runTool);
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-13 17:14:10 +02:00
|
|
|
void QmlCppEngine::setActiveEngine(DebuggerEngine *engine)
|
|
|
|
|
{
|
2014-06-05 23:03:06 +02:00
|
|
|
m_activeEngine = engine;
|
2012-04-13 17:14:10 +02:00
|
|
|
updateViews();
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 14:58:55 +02:00
|
|
|
void QmlCppEngine::loadAdditionalQmlStack()
|
|
|
|
|
{
|
|
|
|
|
if (m_cppEngine)
|
|
|
|
|
m_cppEngine->loadAdditionalQmlStack();
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-03 12:07:32 +01:00
|
|
|
} // namespace Internal
|
2010-08-18 13:54:12 +02:00
|
|
|
} // namespace Debugger
|