Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QScriptEngineAgentPrivate Class Reference

#include <qscriptengineagent_p.h>

Inheritance diagram for QScriptEngineAgentPrivate:

Public Functions

virtual void atStatement (const JSC::DebuggerCallFrame &, intptr_t sourceID, int lineno)
 
void attach ()
 
virtual void callEvent (const JSC::DebuggerCallFrame &, intptr_t sourceID, int lineno)
 
void detach ()
 
virtual void didExecuteProgram (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
 
virtual void didReachBreakpoint (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
 
virtual void evaluateStart (intptr_t sourceID)
 
virtual void evaluateStop (const JSC::JSValue &returnValue, intptr_t sourceID)
 
virtual void exception (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno, bool hasHandler)
 
virtual void exceptionCatch (const JSC::DebuggerCallFrame &frame, intptr_t sourceID)
 
virtual void exceptionThrow (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, bool hasHandler)
 
virtual void functionExit (const JSC::JSValue &returnValue, intptr_t sourceID)
 
 QScriptEngineAgentPrivate ()
 
virtual void returnEvent (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
 
virtual void scriptLoad (qint64 id, const JSC::UString &program, const JSC::UString &fileName, int baseLineNumber)
 
virtual void scriptUnload (qint64 id)
 
virtual void sourceParsed (JSC::ExecState *, const JSC::SourceCode &, int, const JSC::UString &)
 
virtual void willExecuteProgram (const JSC::DebuggerCallFrame &frame, intptr_t sourceID, int lineno)
 
virtual ~QScriptEngineAgentPrivate ()
 

Static Public Functions

static QScriptEngineAgentget (QScriptEngineAgentPrivate *p)
 
static QScriptEngineAgentPrivateget (QScriptEngineAgent *p)
 

Public Variables

QScriptEnginePrivateengine
 
QScriptEngineAgentq_ptr
 

Detailed Description

Definition at line 52 of file qscriptengineagent_p.h.

Constructors and Destructors

◆ QScriptEngineAgentPrivate()

QScriptEngineAgentPrivate::QScriptEngineAgentPrivate ( )
inline

Definition at line 59 of file qscriptengineagent_p.h.

59 {}

◆ ~QScriptEngineAgentPrivate()

virtual QScriptEngineAgentPrivate::~QScriptEngineAgentPrivate ( )
inlinevirtual

Definition at line 60 of file qscriptengineagent_p.h.

60 {}

Functions

◆ atStatement()

void QScriptEngineAgentPrivate::atStatement ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno 
)
virtual

Definition at line 165 of file qscriptengineagent.cpp.

166 {
168  if (!source) {
169  // QTBUG-6108: We don't have the source for this script, so ignore.
170  return;
171  }
172 // column = source->columnNumberFromOffset(column);
173  int column = 1;
174  JSC::CallFrame *oldFrame = engine->currentFrame;
175  int oldAgentLineNumber = engine->agentLineNumber;
176  engine->currentFrame = frame.callFrame();
177  engine->agentLineNumber = lineno;
178  q_ptr->positionChange(sourceID, lineno, column);
179  engine->currentFrame = oldFrame;
180  engine->agentLineNumber = oldAgentLineNumber;
181 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
JSC::ExecState * currentFrame
QHash< intptr_t, QScript::UStringSourceProviderWithFeedback * > loadedScripts
QScriptEnginePrivate * engine
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 ...
ExecState CallFrame

◆ attach()

void QScriptEngineAgentPrivate::attach ( )

Definition at line 121 of file qscriptengineagent.cpp.

122 {
123  if (engine->originalGlobalObject()->debugger())
124  engine->originalGlobalObject()->setDebugger(0);
125  JSC::Debugger::attach(engine->originalGlobalObject());
126  if (!QScriptEnginePrivate::get(engine)->isEvaluating())
127  JSC::Debugger::recompileAllJSFunctions(engine->globalData);
128 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::JSGlobalObject * originalGlobalObject() const
QScriptEnginePrivate * engine
JSC::JSGlobalData * globalData

◆ callEvent()

virtual void QScriptEngineAgentPrivate::callEvent ( const JSC::DebuggerCallFrame &  ,
intptr_t  sourceID,
int  lineno 
)
inlinevirtual

Definition at line 90 of file qscriptengineagent_p.h.

91  {
92  Q_UNUSED(lineno);
93  q_ptr->contextPush();
94  q_ptr->functionEntry(sourceID);
95  }
virtual void functionEntry(qint64 scriptId)
This function is called when a script function is called in the engine.
virtual void contextPush()
This function is called when a new script context has been pushed.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ detach()

void QScriptEngineAgentPrivate::detach ( )

Definition at line 130 of file qscriptengineagent.cpp.

131 {
132  JSC::Debugger::detach(engine->originalGlobalObject());
133 }
JSC::JSGlobalObject * originalGlobalObject() const
QScriptEnginePrivate * engine

◆ didExecuteProgram()

virtual void QScriptEngineAgentPrivate::didExecuteProgram ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno 
)
inlinevirtual

Definition at line 103 of file qscriptengineagent_p.h.

104  {
105  Q_UNUSED(frame);
106  Q_UNUSED(sourceID);
107  Q_UNUSED(lineno);
108  }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ didReachBreakpoint()

void QScriptEngineAgentPrivate::didReachBreakpoint ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno 
)
virtual

Definition at line 196 of file qscriptengineagent.cpp.

198 {
201  if (!source) {
202  // QTBUG-6108: We don't have the source for this script, so ignore.
203  return;
204  }
205 // column = source->columnNumberFromOffset(column);
206  int column = 1;
207  JSC::CallFrame *oldFrame = engine->currentFrame;
208  int oldAgentLineNumber = engine->agentLineNumber;
209  engine->currentFrame = frame.callFrame();
210  engine->agentLineNumber = lineno;
211  QList<QVariant> args;
212  args << qint64(sourceID) << lineno << column;
214  engine->currentFrame = oldFrame;
215  engine->agentLineNumber = oldAgentLineNumber;
216  }
217 };
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
JSC::ExecState * currentFrame
virtual QVariant extension(Extension extension, const QVariant &argument=QVariant())
This virtual function can be reimplemented in a QScriptEngineAgent subclass to provide support for ex...
QHash< intptr_t, QScript::UStringSourceProviderWithFeedback * > loadedScripts
__int64 qint64
Definition: qglobal.h:942
virtual bool supportsExtension(Extension extension) const
Returns true if the QScriptEngineAgent supports the given extension; otherwise, false is returned...
QScriptEnginePrivate * engine
ExecState CallFrame

◆ evaluateStart()

virtual void QScriptEngineAgentPrivate::evaluateStart ( intptr_t  sourceID)
inlinevirtual

Definition at line 113 of file qscriptengineagent_p.h.

114  {
115  q_ptr->functionEntry(sourceID);
116  }
virtual void functionEntry(qint64 scriptId)
This function is called when a script function is called in the engine.

◆ evaluateStop()

void QScriptEngineAgentPrivate::evaluateStop ( const JSC::JSValue &  returnValue,
intptr_t  sourceID 
)
virtual

Definition at line 190 of file qscriptengineagent.cpp.

191 {
192  QScriptValue result = engine->scriptValueFromJSCValue(returnValue);
193  q_ptr->functionExit(sourceID, result);
194 }
QScriptEnginePrivate * engine
QScriptValue scriptValueFromJSCValue(JSC::JSValue value)
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.

◆ exception()

virtual void QScriptEngineAgentPrivate::exception ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno,
bool  hasHandler 
)
inlinevirtual

Definition at line 78 of file qscriptengineagent_p.h.

79  {
80  Q_UNUSED(frame);
81  Q_UNUSED(sourceID);
82  Q_UNUSED(lineno);
83  Q_UNUSED(hasHandler);
84  }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ exceptionCatch()

void QScriptEngineAgentPrivate::exceptionCatch ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID 
)
virtual

Definition at line 155 of file qscriptengineagent.cpp.

156 {
157  JSC::CallFrame *oldFrame = engine->currentFrame;
158  engine->currentFrame = frame.callFrame();
159  QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
160  q_ptr->exceptionCatch(sourceID, value);
161  engine->currentFrame = oldFrame;
163 }
JSC::ExecState * currentFrame
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...
QScriptEnginePrivate * engine
QScriptValue scriptValueFromJSCValue(JSC::JSValue value)
ExecState CallFrame
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

◆ exceptionThrow()

void QScriptEngineAgentPrivate::exceptionThrow ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
bool  hasHandler 
)
virtual

Definition at line 142 of file qscriptengineagent.cpp.

143 {
144  JSC::CallFrame *oldFrame = engine->currentFrame;
145  int oldAgentLineNumber = engine->agentLineNumber;
146  engine->currentFrame = frame.callFrame();
147  QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
148  engine->agentLineNumber = value.property(QLatin1String("lineNumber")).toInt32();
149  q_ptr->exceptionThrow(sourceID, value, hasHandler);
150  engine->agentLineNumber = oldAgentLineNumber;
151  engine->currentFrame = oldFrame;
152  engine->setCurrentException(value);
153 };
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
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...
void setCurrentException(QScriptValue exception)
JSC::ExecState * currentFrame
QScriptEnginePrivate * engine
QScriptValue scriptValueFromJSCValue(JSC::JSValue value)
ExecState CallFrame
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57

◆ functionExit()

void QScriptEngineAgentPrivate::functionExit ( const JSC::JSValue &  returnValue,
intptr_t  sourceID 
)
virtual

Definition at line 183 of file qscriptengineagent.cpp.

184 {
185  QScriptValue result = engine->scriptValueFromJSCValue(returnValue);
186  q_ptr->functionExit(sourceID, result);
187  q_ptr->contextPop();
188 }
virtual void contextPop()
This function is called when the current script context is about to be popped.
QScriptEnginePrivate * engine
QScriptValue scriptValueFromJSCValue(JSC::JSValue value)
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.

◆ get() [1/2]

static QScriptEngineAgent* QScriptEngineAgentPrivate::get ( QScriptEngineAgentPrivate p)
inlinestatic

Definition at line 56 of file qscriptengineagent_p.h.

Referenced by QScriptEnginePrivate::agentDeleted(), and QScriptEngine::setAgent().

56 {return p->q_func();}

◆ get() [2/2]

static QScriptEngineAgentPrivate* QScriptEngineAgentPrivate::get ( QScriptEngineAgent p)
inlinestatic

Definition at line 57 of file qscriptengineagent_p.h.

57 {return p->d_func();}

◆ returnEvent()

void QScriptEngineAgentPrivate::returnEvent ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno 
)
virtual

Definition at line 135 of file qscriptengineagent.cpp.

136 {
137  Q_UNUSED(frame);
138  Q_UNUSED(lineno);
139  Q_UNUSED(sourceID);
140 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ scriptLoad()

virtual void QScriptEngineAgentPrivate::scriptLoad ( qint64  id,
const JSC::UString &  program,
const JSC::UString &  fileName,
int  baseLineNumber 
)
inlinevirtual

Definition at line 71 of file qscriptengineagent_p.h.

73  {
74  q_ptr->scriptLoad(id,program, fileName, baseLineNumber);
75  }
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...
static QString fileName(const QString &fileUrl)

◆ scriptUnload()

virtual void QScriptEngineAgentPrivate::scriptUnload ( qint64  id)
inlinevirtual

Definition at line 67 of file qscriptengineagent_p.h.

68  {
69  q_ptr->scriptUnload(id);
70  }
virtual void scriptUnload(qint64 id)
This function is called when the engine has discarded the script identified by the given id...

◆ sourceParsed()

virtual void QScriptEngineAgentPrivate::sourceParsed ( JSC::ExecState *  ,
const JSC::SourceCode &  ,
int  ,
const JSC::UString &   
)
inlinevirtual

Definition at line 66 of file qscriptengineagent_p.h.

66 {}

◆ willExecuteProgram()

virtual void QScriptEngineAgentPrivate::willExecuteProgram ( const JSC::DebuggerCallFrame &  frame,
intptr_t  sourceID,
int  lineno 
)
inlinevirtual

Definition at line 97 of file qscriptengineagent_p.h.

98  {
99  Q_UNUSED(frame);
100  Q_UNUSED(sourceID);
101  Q_UNUSED(lineno);
102  }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

Properties

◆ engine

QScriptEnginePrivate* QScriptEngineAgentPrivate::engine

◆ q_ptr

QScriptEngineAgent* QScriptEngineAgentPrivate::q_ptr

The documentation for this class was generated from the following files: