aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-10-16 12:29:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-10 11:01:35 +0100
commit0910a577f4d12eea4a099c989bd58f1dee6c88db (patch)
tree53860b5debf08cef684da1eb387769dbe8ef2d42 /src/qml/jsruntime/qv4vme_moth.cpp
parent1738e4ee119bbcd20d33353e7018f04d92766639 (diff)
Debugging with V4
Currently missing, but coming in subsequent patches: - evaluating expressions - evaluating breakpoint conditions Change-Id: Ib43f2a3aaa252741ea7ce857a274480feb8741aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 3121f178a0..68f791c87d 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -64,8 +64,8 @@ using namespace QQmlJS::Moth;
#define MOTH_BEGIN_INSTR_COMMON(I) { \
const InstrMeta<(int)Instr::I>::DataType &instr = InstrMeta<(int)Instr::I>::data(*genericInstr); \
code += InstrMeta<(int)Instr::I>::Size; \
- if (context->engine->debugger && (instr.breakPoint || context->engine->debugger->pauseAtNextOpportunity())) \
- context->engine->debugger->maybeBreakAtInstruction(code, instr.breakPoint); \
+ if (debugger && (instr.breakPoint || debugger->pauseAtNextOpportunity())) \
+ debugger->maybeBreakAtInstruction(code, instr.breakPoint); \
Q_UNUSED(instr); \
TRACE_INSTR(I)
@@ -176,8 +176,6 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
#endif
)
{
- const uchar *exceptionHandler = 0;
-
#ifdef DO_TRACE_INSTR
qDebug("Starting VME with context=%p and code=%p", context, code);
#endif // DO_TRACE_INSTR
@@ -194,6 +192,14 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
}
#endif
+ const uchar *exceptionHandler = 0;
+
+ QV4::Debugging::Debugger *debugger = context->engine->debugger;
+
+#ifdef DO_TRACE_INSTR
+ qDebug("Starting VME with context=%p and code=%p", context, code);
+#endif // DO_TRACE_INSTR
+
QV4::SafeString * const runtimeStrings = context->compilationUnit->runtimeStrings;
context->interpreterInstructionPointer = &code;
@@ -695,5 +701,11 @@ void **VME::instructionJumpTable()
QV4::ReturnedValue VME::exec(QV4::ExecutionContext *ctxt, const uchar *code)
{
VME vme;
- return vme.run(ctxt, code);
+ QV4::Debugging::Debugger *debugger = ctxt->engine->debugger;
+ if (debugger)
+ debugger->enteringFunction();
+ QV4::ReturnedValue retVal = vme.run(ctxt, code);
+ if (debugger)
+ debugger->leavingFunction(retVal);
+ return retVal;
}