2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-06-09 16:13:47 +02: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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2012-05-09 14:56:04 +02:00
|
|
|
#ifndef QMLENGINE_H
|
|
|
|
|
#define QMLENGINE_H
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/debuggerengine.h>
|
2012-05-09 14:56:04 +02:00
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
#include <qmldebug/qdebugmessageclient.h>
|
2015-07-08 13:14:03 +02:00
|
|
|
#include <qmldebug/qmldebugclient.h>
|
2012-05-09 14:56:04 +02:00
|
|
|
#include <qmldebug/qmloutputparser.h>
|
2012-10-08 13:17:10 +02:00
|
|
|
#include <qmljs/iscriptevaluator.h>
|
2015-03-16 14:48:13 +01:00
|
|
|
#include <qmljs/qmljsdocument.h>
|
2011-01-07 18:04:38 +01:00
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
namespace Debugger {
|
2010-11-22 10:20:31 +01:00
|
|
|
namespace Internal {
|
2010-12-03 12:07:32 +01:00
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
class WatchData;
|
|
|
|
|
class WatchItem;
|
|
|
|
|
class QmlEnginePrivate;
|
2015-08-26 11:51:56 +02:00
|
|
|
class QmlInspectorAgent;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2012-10-08 13:17:10 +02:00
|
|
|
class QmlEngine : public DebuggerEngine, QmlJS::IScriptEvaluator
|
2010-06-09 16:13:47 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2015-05-27 13:59:56 +02:00
|
|
|
explicit QmlEngine(const DebuggerRunParameters &runParameters,
|
2015-09-10 11:01:09 +02:00
|
|
|
DebuggerEngine *masterEngine = nullptr);
|
2010-12-03 12:07:32 +01:00
|
|
|
~QmlEngine();
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
void filterApplicationMessage(const QString &msg, int channel) const;
|
2011-02-21 17:01:40 +01:00
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
void logServiceStateChange(const QString &service, float version,
|
|
|
|
|
QmlDebug::QmlDebugClient::State newState);
|
|
|
|
|
void logServiceActivity(const QString &service, const QString &logMessage);
|
2012-03-09 09:06:21 +01:00
|
|
|
|
2015-08-26 11:51:56 +02:00
|
|
|
void expressionEvaluated(quint32 queryId, const QVariant &result);
|
|
|
|
|
|
2012-05-09 14:56:04 +02:00
|
|
|
private slots:
|
2010-08-10 14:42:44 +02:00
|
|
|
void disconnected();
|
2012-02-23 13:03:22 +01:00
|
|
|
void errorMessageBoxFinished(int result);
|
2012-02-15 12:35:43 +01:00
|
|
|
void updateCurrentContext();
|
2011-02-21 17:01:40 +01:00
|
|
|
|
2012-05-09 14:56:04 +02:00
|
|
|
void tryToConnect(quint16 port = 0);
|
|
|
|
|
void beginConnection(quint16 port = 0);
|
|
|
|
|
void connectionEstablished();
|
|
|
|
|
void connectionStartupFailed();
|
|
|
|
|
void appStartupFailed(const QString &errorMessage);
|
|
|
|
|
void appendMessage(const QString &msg, Utils::OutputFormat);
|
|
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
private:
|
2015-09-10 11:01:09 +02:00
|
|
|
void notifyEngineRemoteServerRunning(const QByteArray &, int pid) override;
|
|
|
|
|
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
|
2015-07-08 13:14:03 +02:00
|
|
|
|
|
|
|
|
void showMessage(const QString &msg, int channel = LogDebug,
|
2015-09-10 11:01:09 +02:00
|
|
|
int timeout = -1) const override;
|
|
|
|
|
void gotoLocation(const Internal::Location &location) override;
|
|
|
|
|
void insertBreakpoint(Breakpoint bp) override;
|
2015-07-08 13:14:03 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
bool isSynchronous() const override { return false; }
|
|
|
|
|
bool canDisplayTooltip() const override { return false; }
|
2015-07-08 13:14:03 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void executeStep() override;
|
|
|
|
|
void executeStepOut() override;
|
|
|
|
|
void executeNext() override;
|
|
|
|
|
void executeStepI() override;
|
|
|
|
|
void executeNextI() override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void setupEngine() override;
|
|
|
|
|
void setupInferior() override;
|
|
|
|
|
void runEngine() override;
|
|
|
|
|
void shutdownInferior() override;
|
|
|
|
|
void shutdownEngine() override;
|
2010-07-09 17:07:59 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
bool canHandleToolTip(const DebuggerToolTipContext &) const override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void continueInferior() override;
|
|
|
|
|
void interruptInferior() override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void executeRunToLine(const ContextData &data) override;
|
|
|
|
|
void executeRunToFunction(const QString &functionName) override;
|
|
|
|
|
void executeJumpToLine(const ContextData &data) override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void activateFrame(int index) override;
|
|
|
|
|
void selectThread(ThreadId threadId) override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void attemptBreakpointSynchronization() override;
|
|
|
|
|
void removeBreakpoint(Breakpoint bp) override;
|
|
|
|
|
void changeBreakpoint(Breakpoint bp) override;
|
|
|
|
|
bool acceptsBreakpoint(Breakpoint bp) const override;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-03-19 12:42:53 +01:00
|
|
|
void assignValueInDebugger(WatchItem *item,
|
2015-09-10 11:01:09 +02:00
|
|
|
const QString &expr, const QVariant &value) override;
|
|
|
|
|
|
|
|
|
|
void loadSymbols(const QString &moduleName) override;
|
|
|
|
|
void loadAllSymbols() override;
|
|
|
|
|
void requestModuleSymbols(const QString &moduleName) override;
|
|
|
|
|
void reloadModules() override;
|
|
|
|
|
void reloadRegisters() override {}
|
|
|
|
|
void reloadSourceFiles() override;
|
|
|
|
|
void reloadFullStack() override {}
|
|
|
|
|
|
|
|
|
|
void updateAll() override;
|
|
|
|
|
void updateItem(const QByteArray &iname) override;
|
|
|
|
|
void expandItem(const QByteArray &iname) override;
|
|
|
|
|
void selectWatchData(const QByteArray &iname) override;
|
|
|
|
|
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) override;
|
|
|
|
|
bool evaluateScript(const QString &expression) override;
|
|
|
|
|
|
|
|
|
|
bool hasCapability(unsigned) const override;
|
|
|
|
|
void quitDebugger() override;
|
2010-06-25 14:08:53 +02:00
|
|
|
|
2010-11-15 17:09:28 +01:00
|
|
|
void closeConnection();
|
|
|
|
|
void startApplicationLauncher();
|
|
|
|
|
void stopApplicationLauncher();
|
|
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
void connectionErrorOccurred(QDebugSupport::Error socketError);
|
|
|
|
|
void clientStateChanged(QmlDebug::QmlDebugClient::State state);
|
|
|
|
|
void checkConnectionState();
|
|
|
|
|
void showConnectionStateMessage(const QString &message);
|
|
|
|
|
void showConnectionErrorMessage(const QString &message);
|
|
|
|
|
bool isConnected() const;
|
2012-05-09 14:56:04 +02:00
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
private:
|
2010-08-18 13:54:12 +02:00
|
|
|
friend class QmlCppEngine;
|
2015-07-08 13:14:03 +02:00
|
|
|
friend class QmlEnginePrivate;
|
2015-08-26 11:51:56 +02:00
|
|
|
friend class QmlInspectorAgent;
|
2015-07-08 13:14:03 +02:00
|
|
|
QmlEnginePrivate *d;
|
2010-06-09 16:13:47 +02:00
|
|
|
};
|
|
|
|
|
|
2010-12-03 12:07:32 +01:00
|
|
|
} // namespace Internal
|
2010-06-09 16:13:47 +02:00
|
|
|
} // namespace Debugger
|
|
|
|
|
|
2012-05-09 14:56:04 +02:00
|
|
|
#endif // QMLENGINE_H
|