aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-12-05 13:16:14 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2014-12-09 11:55:04 +0100
commit8397f640e81f0eff1f6f32ae4a35d40f115ea339 (patch)
tree2bb50bc6be262979cb9e7c49f02d96cbc5c50be5 /src/qml/jsruntime/qv4engine.cpp
parent4524856ae21f85d572155c8a399d43116143e25c (diff)
QML Debugging: Fix crash when stepping through try-catch block.
Also fix the stack-trace generation, otherwise the debugger engine would report a breakpoint hit on the wrong line. Task-number: QTBUG-42723 Change-Id: I1f655a5174b28a1c9c31c85bbe023fbce5ddbb96 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index ea075f9cbd..74b262e86d 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -700,19 +700,18 @@ QVector<StackFrame> ExecutionEngine::stackTrace(int frameLimit) const
QV4::ExecutionContext *c = currentContext();
while (c && frameLimit) {
- CallContext *callCtx = c->asCallContext();
- if (callCtx && callCtx->d()->function) {
+ if (FunctionObject *function = c->getFunctionObject()) {
StackFrame frame;
- if (callCtx->d()->function->function())
- frame.source = callCtx->d()->function->function()->sourceFile();
- name = callCtx->d()->function->name();
+ if (const Function *f = function->function())
+ frame.source = f->sourceFile();
+ name = function->name();
frame.function = name->toQString();
frame.line = -1;
frame.column = -1;
- if (callCtx->d()->function->function())
+ if (function->function())
// line numbers can be negative for places where you can't set a real breakpoint
- frame.line = qAbs(callCtx->d()->lineNumber);
+ frame.line = qAbs(c->d()->lineNumber);
stack.append(frame);
--frameLimit;
@@ -727,7 +726,6 @@ QVector<StackFrame> ExecutionEngine::stackTrace(int frameLimit) const
frame.line = rootContext->d()->lineNumber;
frame.column = -1;
-
stack.append(frame);
}
return stack;