Qt 4.8
qscriptdebuggeragent_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtSCriptTools module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** 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.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QSCRIPTDEBUGGERAGENT_P_H
43 #define QSCRIPTDEBUGGERAGENT_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 <QtScript/qscriptengineagent.h>
57 
58 #include <QtCore/qpair.h>
59 
61 #include "qscriptscriptdata_p.h"
62 
64 
66 
69 {
70 public:
72  QScriptEngine *engine);
74 
75  void enterStepIntoMode(int count = 1);
76  void enterStepOverMode(int count = 1);
77  void enterStepOutMode();
78  void enterContinueMode();
79  void enterInterruptMode();
80  void enterRunToLocationMode(const QString &fileName, int lineNumber);
81  void enterRunToLocationMode(qint64 scriptId, int lineNumber);
82  void enterReturnByForceMode(int contextIndex, const QScriptValue &value);
83 
84  int setBreakpoint(const QScriptBreakpointData &data);
85  bool deleteBreakpoint(int id);
86  void deleteAllBreakpoints();
87  QScriptBreakpointData breakpointData(int id) const;
88  bool setBreakpointData(int id, const QScriptBreakpointData &data);
89  QScriptBreakpointMap breakpoints() const;
90 
91  QScriptScriptMap scripts() const;
92  QScriptScriptData scriptData(qint64 id) const;
93  void scriptsCheckpoint();
94  QPair<QList<qint64>, QList<qint64> > scriptsDelta() const;
95  qint64 resolveScript(const QString &fileName) const;
96 
97  QList<qint64> contextIds() const;
98  QPair<QList<qint64>, QList<qint64> > contextsCheckpoint();
99 
100  void nullifyBackendPointer();
101 
102  // reimplemented
103  void scriptLoad(qint64 id, const QString &program,
104  const QString &fileName, int baseLineNumber);
105  void scriptUnload(qint64 id);
106 
107  void contextPush();
108  void contextPop();
109 
110  void functionEntry(qint64 scriptId);
111  void functionExit(qint64 scriptId,
112  const QScriptValue &returnValue);
113 
114  void positionChange(qint64 scriptId,
115  int lineNumber, int columnNumber);
116 
117  void exceptionThrow(qint64 scriptId,
118  const QScriptValue &exception,
119  bool hasHandler);
120  void exceptionCatch(qint64 scriptId,
121  const QScriptValue &exception);
122 
123  bool supportsExtension(Extension extension) const;
124  QVariant extension(Extension extension,
125  const QVariant &argument = QVariant());
126 
127 private:
131 };
132 
134 
135 #endif
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
virtual void scriptUnload(qint64 id)
This function is called when the engine has discarded the script identified by the given id...
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual void exceptionThrow(qint64 scriptId, const QScriptValue &exception, bool hasHandler)
This function is called when the given exception has occurred in the engine, in the script identified...
virtual void scriptLoad(qint64 id, const QString &program, const QString &fileName, int baseLineNumber)
This function is called when the engine has parsed a script and has associated it with the given id...
The QScriptScriptData class holds data associated with a script.
The QScriptEngine class provides an environment for evaluating Qt Script code.
This class implements a state machine that uses the low-level events reported by the QScriptEngineAge...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual QVariant extension(Extension extension, const QVariant &argument=QVariant())
This virtual function can be reimplemented in a QScriptEngineAgent subclass to provide support for ex...
virtual void exceptionCatch(qint64 scriptId, const QScriptValue &exception)
This function is called when the given exception is about to be caught, in the script identified by s...
QScriptDebuggerAgentPrivate * d_ptr
static const char * data(const QByteArray &arr)
__int64 qint64
Definition: qglobal.h:942
The QScriptBreakpointData class contains data associated with a breakpoint.
virtual bool supportsExtension(Extension extension) const
Returns true if the QScriptEngineAgent supports the given extension; otherwise, false is returned...
virtual void functionEntry(qint64 scriptId)
This function is called when a script function is called in the engine.
virtual void contextPop()
This function is called when the current script context is about to be popped.
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
virtual void positionChange(qint64 scriptId, int lineNumber, int columnNumber)
This function is called when the engine is about to execute a new statement in the script identified ...
virtual void contextPush()
This function is called when a new script context has been pushed.
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
Extension
This enum specifies the possible extensions to a QScriptEngineAgent.
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57
virtual void functionExit(qint64 scriptId, const QScriptValue &returnValue)
This function is called when the currently executing script function is about to return.
static QString fileName(const QString &fileUrl)
The QScriptEngineAgent class provides an interface to report events pertaining to QScriptEngine execu...