[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[2] | 6 | **
|
---|
| 7 | ** This file is part of the QtSCriptTools module of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 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.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
[561] | 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
[2] | 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
[561] | 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
[2] | 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | #ifndef QSCRIPTDEBUGGERBACKEND_P_H
|
---|
| 43 | #define QSCRIPTDEBUGGERBACKEND_P_H
|
---|
| 44 |
|
---|
| 45 | //
|
---|
| 46 | // W A R N I N G
|
---|
| 47 | // -------------
|
---|
| 48 | //
|
---|
| 49 | // This file is not part of the Qt API. It exists purely as an
|
---|
| 50 | // implementation detail. This header file may change from version to
|
---|
| 51 | // version without notice, or even be removed.
|
---|
| 52 | //
|
---|
| 53 | // We mean it.
|
---|
| 54 | //
|
---|
| 55 |
|
---|
| 56 | #include <QtCore/qobjectdefs.h>
|
---|
| 57 |
|
---|
| 58 | #include <QtCore/qpair.h>
|
---|
| 59 |
|
---|
| 60 | #include "qscriptbreakpointdata_p.h"
|
---|
| 61 | #include "qscriptscriptdata_p.h"
|
---|
| 62 |
|
---|
| 63 | QT_BEGIN_NAMESPACE
|
---|
| 64 |
|
---|
| 65 | class QScriptContext;
|
---|
| 66 | class QScriptEngine;
|
---|
| 67 | class QScriptDebuggerCommandExecutor;
|
---|
| 68 | class QScriptDebuggerEvent;
|
---|
| 69 | class QScriptValue;
|
---|
| 70 | class QScriptValueIterator;
|
---|
| 71 | class QScriptObjectSnapshot;
|
---|
| 72 | class QStringList;
|
---|
| 73 |
|
---|
| 74 | typedef QPair<QList<qint64>, QList<qint64> > QScriptScriptsDelta;
|
---|
| 75 | typedef QPair<QList<qint64>, QList<qint64> > QScriptContextsDelta;
|
---|
| 76 |
|
---|
| 77 | class QScriptDebuggerBackendPrivate;
|
---|
| 78 | class Q_AUTOTEST_EXPORT QScriptDebuggerBackend
|
---|
| 79 | {
|
---|
| 80 | public:
|
---|
| 81 | QScriptDebuggerBackend();
|
---|
| 82 | virtual ~QScriptDebuggerBackend();
|
---|
| 83 |
|
---|
| 84 | void attachTo(QScriptEngine *engine);
|
---|
| 85 | void detach();
|
---|
| 86 |
|
---|
| 87 | QScriptEngine *engine() const;
|
---|
| 88 |
|
---|
| 89 | void stepInto(int count = 1);
|
---|
| 90 | void stepOver(int count = 1);
|
---|
| 91 | void stepOut();
|
---|
| 92 | void continueEvalution();
|
---|
| 93 | void interruptEvaluation();
|
---|
| 94 | void runToLocation(const QString &fileName, int lineNumber);
|
---|
| 95 | void runToLocation(qint64 scriptId, int lineNumber);
|
---|
| 96 | void returnToCaller(int contextIndex, const QScriptValue &value);
|
---|
| 97 | void evaluate(int contextIndex, const QString &program,
|
---|
| 98 | const QString &fileName, int lineNumber);
|
---|
| 99 |
|
---|
| 100 | int setBreakpoint(const QScriptBreakpointData &data);
|
---|
| 101 | bool deleteBreakpoint(int id);
|
---|
| 102 | void deleteAllBreakpoints();
|
---|
| 103 | QScriptBreakpointData breakpointData(int id) const;
|
---|
| 104 | bool setBreakpointData(int id, const QScriptBreakpointData &data);
|
---|
| 105 | QScriptBreakpointMap breakpoints() const;
|
---|
| 106 |
|
---|
| 107 | QScriptScriptMap scripts() const;
|
---|
| 108 | QScriptScriptData scriptData(qint64 id) const;
|
---|
| 109 | void scriptsCheckpoint();
|
---|
| 110 | QScriptScriptsDelta scriptsDelta() const;
|
---|
| 111 | qint64 resolveScript(const QString &fileName) const;
|
---|
| 112 |
|
---|
| 113 | int contextCount() const;
|
---|
| 114 | QScriptContext *context(int index) const;
|
---|
| 115 | QStringList backtrace() const;
|
---|
| 116 | QList<qint64> contextIds() const;
|
---|
| 117 | QScriptContextsDelta contextsCheckpoint();
|
---|
| 118 |
|
---|
| 119 | int newScriptObjectSnapshot();
|
---|
| 120 | QScriptObjectSnapshot *scriptObjectSnapshot(int id) const;
|
---|
| 121 | void deleteScriptObjectSnapshot(int id);
|
---|
| 122 |
|
---|
| 123 | int newScriptValueIterator(const QScriptValue &object);
|
---|
| 124 | QScriptValueIterator *scriptValueIterator(int id) const;
|
---|
| 125 | void deleteScriptValueIterator(int id);
|
---|
| 126 |
|
---|
| 127 | QScriptValue traceFunction() const;
|
---|
| 128 | QScriptValue assertFunction() const;
|
---|
| 129 | QScriptValue fileNameFunction() const;
|
---|
| 130 | QScriptValue lineNumberFunction() const;
|
---|
| 131 |
|
---|
| 132 | void doPendingEvaluate(bool postEvent);
|
---|
| 133 |
|
---|
| 134 | bool ignoreExceptions() const;
|
---|
| 135 | void setIgnoreExceptions(bool ignore);
|
---|
| 136 |
|
---|
| 137 | QScriptDebuggerCommandExecutor *commandExecutor() const;
|
---|
| 138 | void setCommandExecutor(QScriptDebuggerCommandExecutor *executor);
|
---|
| 139 |
|
---|
| 140 | virtual void resume() = 0;
|
---|
| 141 |
|
---|
| 142 | protected:
|
---|
| 143 | virtual void event(const QScriptDebuggerEvent &event) = 0;
|
---|
| 144 |
|
---|
| 145 | protected:
|
---|
| 146 | QScriptDebuggerBackend(QScriptDebuggerBackendPrivate &dd);
|
---|
[561] | 147 | QScopedPointer<QScriptDebuggerBackendPrivate> d_ptr;
|
---|
[2] | 148 |
|
---|
| 149 | private:
|
---|
| 150 | Q_DECLARE_PRIVATE(QScriptDebuggerBackend)
|
---|
| 151 | Q_DISABLE_COPY(QScriptDebuggerBackend)
|
---|
| 152 | };
|
---|
| 153 |
|
---|
| 154 | QT_END_NAMESPACE
|
---|
| 155 |
|
---|
| 156 | #endif
|
---|