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).
|
|
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2010-06-09 16:13:47 +02:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUGGER_QMLENGINE_H
|
|
|
|
|
#define DEBUGGER_QMLENGINE_H
|
|
|
|
|
|
2010-06-25 14:08:53 +02:00
|
|
|
#include "debuggerengine.h"
|
|
|
|
|
|
2011-04-15 12:59:44 +02:00
|
|
|
#include <utils/outputformat.h>
|
2011-01-07 18:04:38 +01:00
|
|
|
|
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 {
|
2011-10-06 17:38:28 +02:00
|
|
|
|
|
|
|
|
class QmlAdapter;
|
|
|
|
|
|
2010-11-22 10:20:31 +01:00
|
|
|
namespace Internal {
|
2010-12-03 12:07:32 +01:00
|
|
|
|
2010-11-15 17:47:21 +01:00
|
|
|
class QmlEnginePrivate;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-12-03 12:07:32 +01:00
|
|
|
class QmlEngine : public DebuggerEngine
|
2010-06-09 16:13:47 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2011-07-26 16:22:49 +02:00
|
|
|
enum LogDirection {
|
|
|
|
|
LogSend,
|
|
|
|
|
LogReceive
|
|
|
|
|
};
|
|
|
|
|
|
2011-01-12 12:10:12 +01:00
|
|
|
QmlEngine(const DebuggerStartParameters &startParameters,
|
|
|
|
|
DebuggerEngine *masterEngine);
|
2010-12-03 12:07:32 +01:00
|
|
|
~QmlEngine();
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2011-02-11 16:02:41 +01:00
|
|
|
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
|
2010-09-16 17:08:07 +02:00
|
|
|
void handleRemoteSetupFailed(const QString &message);
|
|
|
|
|
|
2011-01-24 16:58:35 +01:00
|
|
|
bool canDisplayTooltip() const;
|
2010-11-15 17:09:28 +01:00
|
|
|
|
2011-02-21 17:01:40 +01:00
|
|
|
void showMessage(const QString &msg, int channel = LogDebug,
|
|
|
|
|
int timeout = -1) const;
|
2011-11-30 15:23:02 +01:00
|
|
|
void gotoLocation(const Internal::Location &location);
|
|
|
|
|
|
2011-02-21 17:01:40 +01:00
|
|
|
void filterApplicationMessage(const QString &msg, int channel);
|
2011-07-26 16:22:49 +02:00
|
|
|
QString toFileInProject(const QUrl &fileUrl);
|
|
|
|
|
void inferiorSpontaneousStop();
|
|
|
|
|
|
2011-12-07 10:23:26 +01:00
|
|
|
void logMessage(const QString &service, LogDirection direction, const QString &str);
|
2011-02-21 17:01:40 +01:00
|
|
|
|
2011-11-30 15:23:02 +01:00
|
|
|
void setSourceFiles(const QStringList &fileNames);
|
|
|
|
|
void updateScriptSource(const QString &fileName, int lineOffset, int columnOffset, const QString &source);
|
|
|
|
|
|
2011-10-06 17:38:28 +02:00
|
|
|
QmlAdapter *adapter() const;
|
|
|
|
|
|
2010-08-10 14:42:44 +02:00
|
|
|
public slots:
|
|
|
|
|
void disconnected();
|
2010-06-25 14:08:53 +02:00
|
|
|
|
2011-02-21 17:01:40 +01:00
|
|
|
private slots:
|
2011-02-24 10:03:44 +01:00
|
|
|
void retryMessageBoxFinished(int result);
|
2011-10-31 16:42:31 +01:00
|
|
|
void wrongSetupMessageBox(const QString &errorMessage);
|
2011-02-24 10:03:44 +01:00
|
|
|
void wrongSetupMessageBoxFinished(int result);
|
2011-02-21 17:01:40 +01:00
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
private:
|
2010-12-03 12:07:32 +01: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();
|
|
|
|
|
|
2011-02-17 10:08:57 +01:00
|
|
|
bool setToolTipExpression(const QPoint &mousePos,
|
2011-02-11 15:00:13 +01:00
|
|
|
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
|
2010-06-09 16:13:47 +02:00
|
|
|
|
|
|
|
|
void continueInferior();
|
|
|
|
|
void interruptInferior();
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
void executeRunToLine(const ContextData &data);
|
2010-06-09 16:13:47 +02:00
|
|
|
void executeRunToFunction(const QString &functionName);
|
2011-02-23 10:16:11 +01:00
|
|
|
void executeJumpToLine(const ContextData &data);
|
2010-06-09 16:13:47 +02:00
|
|
|
|
|
|
|
|
void activateFrame(int index);
|
|
|
|
|
void selectThread(int index);
|
|
|
|
|
|
|
|
|
|
void attemptBreakpointSynchronization();
|
2011-08-17 11:47:42 +02:00
|
|
|
void insertBreakpoint(BreakpointModelId id);
|
|
|
|
|
void removeBreakpoint(BreakpointModelId id);
|
|
|
|
|
void changeBreakpoint(BreakpointModelId id);
|
2011-06-24 16:25:30 +02:00
|
|
|
bool acceptsBreakpoint(BreakpointModelId id) const;
|
2010-06-09 16:13:47 +02:00
|
|
|
|
2010-12-03 12:07:32 +01:00
|
|
|
void assignValueInDebugger(const WatchData *data,
|
2010-11-10 16:33:11 +01:00
|
|
|
const QString &expr, const QVariant &value);
|
2011-11-30 15:23:02 +01:00
|
|
|
|
|
|
|
|
|
2010-06-09 16:13:47 +02:00
|
|
|
void loadSymbols(const QString &moduleName);
|
|
|
|
|
void loadAllSymbols();
|
|
|
|
|
void requestModuleSymbols(const QString &moduleName);
|
|
|
|
|
void reloadModules();
|
|
|
|
|
void reloadRegisters() {}
|
2011-11-30 15:23:02 +01:00
|
|
|
void reloadSourceFiles();
|
2010-06-09 16:13:47 +02:00
|
|
|
void reloadFullStack() {}
|
|
|
|
|
|
2010-08-06 13:48:43 +02:00
|
|
|
bool supportsThreads() const { return false; }
|
2010-12-03 12:07:32 +01:00
|
|
|
void updateWatchData(const WatchData &data,
|
|
|
|
|
const WatchUpdateFlags &flags);
|
2010-10-27 15:23:30 +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-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:
|
2011-07-28 10:38:39 +02:00
|
|
|
void beginConnection();
|
2010-08-13 14:18:10 +02:00
|
|
|
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);
|
2011-04-15 12:59:44 +02:00
|
|
|
void appendMessage(const QString &msg, Utils::OutputFormat);
|
2010-08-13 14:18:10 +02:00
|
|
|
|
2011-04-21 12:25:06 +02:00
|
|
|
void synchronizeWatchers();
|
|
|
|
|
|
2010-07-01 11:48:43 +02:00
|
|
|
private:
|
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 qmlImportPath() const;
|
|
|
|
|
|
2010-08-13 14:18:10 +02:00
|
|
|
private:
|
2010-08-18 13:54:12 +02:00
|
|
|
friend class QmlCppEngine;
|
2011-07-06 19:07:38 +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
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGER_QMLENGINE_H
|