1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
28 **************************************************************************/
30 #ifndef DEBUGGER_QMLENGINE_H
31 #define DEBUGGER_QMLENGINE_H
33 #include "debuggerengine.h"
35 #include <QtCore/QByteArray>
36 #include <QtCore/QHash>
37 #include <QtCore/QObject>
38 #include <QtCore/QPoint>
39 #include <QtCore/QProcess>
40 #include <QtCore/QQueue>
41 #include <QtCore/QTimer>
42 #include <QtCore/QVariant>
44 #include <QtNetwork/QAbstractSocket>
45 #include <QtNetwork/QTcpSocket>
47 #include <projectexplorer/applicationlauncher.h>
56 class QmlDebuggerClient;
58 class DEBUGGER_EXPORT QmlEngine : public DebuggerEngine
63 explicit QmlEngine(const DebuggerStartParameters &startParameters);
66 void setAttachToRunningExternalApp(bool value);
67 void shutdownInferiorAsSlave();
68 void shutdownEngineAsSlave();
69 void pauseConnection();
72 void messageReceived(const QByteArray &message);
76 // DebuggerEngine implementation
77 bool isSynchronous() const { return false; }
79 void executeStepOut();
87 void shutdownInferior();
88 void shutdownEngine();
90 void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
92 void continueInferior();
93 void interruptInferior();
95 void executeRunToLine(const QString &fileName, int lineNumber);
96 void executeRunToFunction(const QString &functionName);
97 void executeJumpToLine(const QString &fileName, int lineNumber);
99 void activateFrame(int index);
100 void selectThread(int index);
102 void attemptBreakpointSynchronization();
104 void assignValueInDebugger(const QString &expr, const QString &value);
105 void loadSymbols(const QString &moduleName);
106 void loadAllSymbols();
107 void requestModuleSymbols(const QString &moduleName);
108 void reloadModules();
109 void reloadRegisters() {}
110 void reloadSourceFiles() {}
111 void reloadFullStack() {}
113 bool supportsThreads() const { return false; }
114 void updateWatchData(const WatchData &data);
115 void executeDebuggerCommand(const QString& command);
117 unsigned int debuggerCapabilities() const;
120 void sendMessage(const QByteArray &msg);
123 void connectionEstablished();
124 void connectionStartupFailed();
125 void connectionError(QAbstractSocket::SocketError error);
127 void slotMessage(QString, bool);
128 void slotAddToOutputWindow(QString, bool);
130 void expandObject(const QByteArray &iname, quint64 objectId);
134 friend class QmlCppEngine;
137 QmlAdapter *m_adapter;
138 ProjectExplorer::ApplicationLauncher m_applicationLauncher;
139 bool m_addedAdapterToObjectPool;
140 bool m_attachToRunningExternalApp;
144 } // namespace Internal
145 } // namespace Debugger
147 #endif // DEBUGGER_QMLENGINE_H