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-09-13 13:30:35 +02:00
|
|
|
#include <QtCore/QScopedPointer>
|
2010-06-09 16:13:47 +02:00
|
|
|
#include <QtNetwork/QAbstractSocket>
|
2010-09-08 16:44:42 +02:00
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
namespace Debugger {
|
2010-08-13 14:18:10 +02:00
|
|
|
class QmlAdapter;
|
2010-09-13 13:30:35 +02:00
|
|
|
|
2010-11-15 17:47:21 +01:00
|
|
|
class QmlEnginePrivate;
|
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-09-13 13:30:35 +02:00
|
|
|
virtual ~QmlEngine();
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-11-02 10:24:50 +01:00
|
|
|
void handleRemoteSetupDone(int port);
|
2010-09-16 17:08:07 +02:00
|
|
|
void handleRemoteSetupFailed(const QString &message);
|
|
|
|
|
|
2010-09-08 13:31:12 +02:00
|
|
|
void gotoLocation(const QString &fileName, int lineNumber, bool setMarker);
|
2010-09-13 13:30:35 +02:00
|
|
|
void gotoLocation(const Internal::StackFrame &frame, bool setMarker);
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2010-11-15 17:09:28 +01:00
|
|
|
void pauseConnection();
|
|
|
|
|
|
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-09-16 17:08:07 +02:00
|
|
|
signals:
|
|
|
|
|
void remoteStartupRequested();
|
|
|
|
|
|
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();
|
|
|
|
|
|
2010-10-27 15:23:30 +02:00
|
|
|
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();
|
2010-11-10 16:33:11 +01:00
|
|
|
bool acceptsBreakpoint(BreakpointId id);
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-11-10 16:33:11 +01:00
|
|
|
void assignValueInDebugger(const Internal::WatchData *data,
|
|
|
|
|
const QString &expr, const QVariant &value);
|
2010-06-09 16:13:47 +02:00
|
|
|
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-10-27 15:23:30 +02:00
|
|
|
void updateWatchData(const Internal::WatchData &data,
|
|
|
|
|
const Internal::WatchUpdateFlags &flags);
|
|
|
|
|
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-10-27 15:23:30 +02:00
|
|
|
void tooltipRequested(const QPoint &mousePos,
|
|
|
|
|
TextEditor::ITextEditor *editor, int cursorPos);
|
2010-07-01 11:48:43 +02:00
|
|
|
|
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-09-30 14:05:20 +02:00
|
|
|
void serviceConnectionError(const QString &service);
|
2010-08-13 14:18:10 +02:00
|
|
|
|
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-11-15 17:09:28 +01:00
|
|
|
void closeConnection();
|
|
|
|
|
void startApplicationLauncher();
|
|
|
|
|
void stopApplicationLauncher();
|
|
|
|
|
|
2010-09-08 13:31:12 +02:00
|
|
|
bool isShadowBuildProject() const;
|
|
|
|
|
QString fromShadowBuildFilename(const QString &filename) const;
|
2010-10-27 15:23:30 +02:00
|
|
|
QString mangleFilenamePaths(const QString &filename,
|
|
|
|
|
const QString &oldBasePath, const QString &newBasePath) const;
|
2010-09-08 13:31:12 +02:00
|
|
|
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-09-13 13:30:35 +02:00
|
|
|
QScopedPointer<QmlEnginePrivate> d;
|
2010-06-09 16:13:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGER_QMLENGINE_H
|