2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://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
|
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.
|
2010-06-09 16:13:47 +02: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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
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>
|
2012-05-09 14:56:04 +02:00
|
|
|
#include <qmldebug/qmloutputparser.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 WatchItem;
|
|
|
|
|
class QmlEnginePrivate;
|
2015-08-26 11:51:56 +02:00
|
|
|
class QmlInspectorAgent;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2015-11-10 16:59:02 +01:00
|
|
|
class QmlEngine : public DebuggerEngine
|
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
|
|
|
|
2016-04-19 16:43:30 +02:00
|
|
|
void tryToConnect(Utils::Port port = Utils::Port());
|
|
|
|
|
void beginConnection(Utils::Port port = Utils::Port());
|
2012-05-09 14:56:04 +02:00
|
|
|
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:
|
2016-06-07 17:04:53 +02:00
|
|
|
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
|
2015-09-10 11:01:09 +02:00
|
|
|
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
|
|
|
|
2016-04-14 10:38:35 +02:00
|
|
|
void resetLocation() override;
|
|
|
|
|
|
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;
|
2016-06-07 17:04:53 +02:00
|
|
|
void updateItem(const QString &iname) override;
|
|
|
|
|
void expandItem(const QString &iname) override;
|
|
|
|
|
void selectWatchData(const QString &iname) override;
|
2015-09-10 11:01:09 +02:00
|
|
|
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) 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-11-16 17:29:17 +01:00
|
|
|
void connectionErrorOccurred(QAbstractSocket::SocketError socketError);
|
|
|
|
|
void connectionStateChanged(QAbstractSocket::SocketState socketState);
|
|
|
|
|
|
2015-07-08 13:14:03 +02:00
|
|
|
void checkConnectionState();
|
|
|
|
|
void showConnectionStateMessage(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
|