2010-06-09 16:13:47 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
|
|
|
|
** Commercial Usage
|
|
|
|
|
**
|
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
|
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUGGER_QMLENGINE_H
|
|
|
|
|
#define DEBUGGER_QMLENGINE_H
|
|
|
|
|
|
2010-06-25 14:08:53 +02:00
|
|
|
#include "debuggerengine.h"
|
|
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
#include <QtCore/QByteArray>
|
|
|
|
|
#include <QtCore/QHash>
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
#include <QtCore/QPoint>
|
2010-07-01 11:48:43 +02:00
|
|
|
#include <QtCore/QProcess>
|
2010-06-09 16:13:47 +02:00
|
|
|
#include <QtCore/QQueue>
|
|
|
|
|
#include <QtCore/QTimer>
|
|
|
|
|
#include <QtCore/QVariant>
|
|
|
|
|
|
|
|
|
|
#include <QtNetwork/QAbstractSocket>
|
2010-07-01 11:48:43 +02:00
|
|
|
#include <QtNetwork/QTcpSocket>
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-08-13 14:18:10 +02:00
|
|
|
#include <projectexplorer/applicationlauncher.h>
|
2010-07-05 11:28:38 +02:00
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class ScriptAgent;
|
|
|
|
|
class WatchData;
|
2010-08-13 14:18:10 +02:00
|
|
|
class QmlAdapter;
|
2010-06-09 16:13:47 +02:00
|
|
|
class QmlResponse;
|
2010-07-01 11:48:43 +02:00
|
|
|
class QmlDebuggerClient;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-06-25 14:08:53 +02:00
|
|
|
class DEBUGGER_EXPORT QmlEngine : public DebuggerEngine
|
2010-06-09 16:13:47 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-06-16 11:08:54 +02:00
|
|
|
explicit QmlEngine(const DebuggerStartParameters &startParameters);
|
2010-06-09 16:13:47 +02:00
|
|
|
~QmlEngine();
|
|
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
void setAttachToRunningExternalApp(bool value);
|
|
|
|
|
void shutdownInferiorAsSlave();
|
|
|
|
|
void shutdownEngineAsSlave();
|
|
|
|
|
void pauseConnection();
|
2010-09-08 13:31:12 +02:00
|
|
|
void gotoLocation(const QString &fileName, int lineNumber, bool setMarker);
|
|
|
|
|
void gotoLocation(const StackFrame &frame, bool setMarker);
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2010-08-10 14:42:44 +02:00
|
|
|
public slots:
|
2010-06-25 14:08:53 +02:00
|
|
|
void messageReceived(const QByteArray &message);
|
2010-08-10 14:42:44 +02:00
|
|
|
void disconnected();
|
2010-06-25 14:08:53 +02:00
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
private:
|
2010-06-16 11:08:54 +02:00
|
|
|
// DebuggerEngine implementation
|
2010-08-30 07:52:41 +02:00
|
|
|
bool isSynchronous() const { return false; }
|
2010-06-09 16:13:47 +02:00
|
|
|
void executeStep();
|
|
|
|
|
void executeStepOut();
|
|
|
|
|
void executeNext();
|
|
|
|
|
void executeStepI();
|
|
|
|
|
void executeNextI();
|
|
|
|
|
|
2010-07-08 18:10:50 +02:00
|
|
|
void setupEngine();
|
2010-07-09 17:07:59 +02:00
|
|
|
void setupInferior();
|
|
|
|
|
void runEngine();
|
|
|
|
|
void shutdownInferior();
|
|
|
|
|
void shutdownEngine();
|
|
|
|
|
|
|
|
|
|
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
2010-06-09 16:13:47 +02:00
|
|
|
|
|
|
|
|
void continueInferior();
|
|
|
|
|
void interruptInferior();
|
|
|
|
|
|
|
|
|
|
void executeRunToLine(const QString &fileName, int lineNumber);
|
|
|
|
|
void executeRunToFunction(const QString &functionName);
|
|
|
|
|
void executeJumpToLine(const QString &fileName, int lineNumber);
|
|
|
|
|
|
|
|
|
|
void activateFrame(int index);
|
|
|
|
|
void selectThread(int index);
|
|
|
|
|
|
|
|
|
|
void attemptBreakpointSynchronization();
|
|
|
|
|
|
|
|
|
|
void assignValueInDebugger(const QString &expr, const QString &value);
|
|
|
|
|
void loadSymbols(const QString &moduleName);
|
|
|
|
|
void loadAllSymbols();
|
|
|
|
|
void requestModuleSymbols(const QString &moduleName);
|
|
|
|
|
void reloadModules();
|
|
|
|
|
void reloadRegisters() {}
|
|
|
|
|
void reloadSourceFiles() {}
|
|
|
|
|
void reloadFullStack() {}
|
|
|
|
|
|
2010-08-06 13:48:43 +02:00
|
|
|
bool supportsThreads() const { return false; }
|
2010-06-09 16:13:47 +02:00
|
|
|
void updateWatchData(const WatchData &data);
|
2010-08-26 16:02:41 +02:00
|
|
|
void executeDebuggerCommand(const QString& command);
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-06-25 14:08:53 +02:00
|
|
|
unsigned int debuggerCapabilities() const;
|
|
|
|
|
|
2010-07-08 17:27:23 +02:00
|
|
|
signals:
|
2010-07-01 11:48:43 +02:00
|
|
|
void sendMessage(const QByteArray &msg);
|
|
|
|
|
|
2010-08-13 14:18:10 +02:00
|
|
|
private slots:
|
|
|
|
|
void connectionEstablished();
|
|
|
|
|
void connectionStartupFailed();
|
2010-08-27 13:11:55 +02:00
|
|
|
void connectionError(QAbstractSocket::SocketError error);
|
2010-08-13 14:18:10 +02:00
|
|
|
|
2010-08-25 16:48:35 +02:00
|
|
|
void slotMessage(QString, bool);
|
|
|
|
|
void slotAddToOutputWindow(QString, bool);
|
2010-07-01 11:48:43 +02:00
|
|
|
private:
|
2010-07-22 14:58:37 +02:00
|
|
|
void expandObject(const QByteArray &iname, quint64 objectId);
|
2010-07-23 11:30:07 +02:00
|
|
|
void sendPing();
|
2010-08-13 14:18:10 +02:00
|
|
|
|
2010-09-08 13:31:12 +02:00
|
|
|
bool isShadowBuildProject() const;
|
|
|
|
|
QString fromShadowBuildFilename(const QString &filename) const;
|
|
|
|
|
QString mangleFilenamePaths(const QString &filename, const QString &oldBasePath, const QString &newBasePath) const;
|
|
|
|
|
QString toShadowBuildFilename(const QString &filename) const;
|
|
|
|
|
QString qmlImportPath() const;
|
|
|
|
|
|
2010-08-13 14:18:10 +02:00
|
|
|
private:
|
2010-08-18 13:54:12 +02:00
|
|
|
friend class QmlCppEngine;
|
|
|
|
|
|
2010-08-13 14:18:10 +02:00
|
|
|
int m_ping;
|
|
|
|
|
QmlAdapter *m_adapter;
|
|
|
|
|
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
|
|
|
|
bool m_addedAdapterToObjectPool;
|
2010-08-18 13:54:12 +02:00
|
|
|
bool m_attachToRunningExternalApp;
|
|
|
|
|
bool m_hasShutdown;
|
2010-06-09 16:13:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGER_QMLENGINE_H
|