diff options
author | Erik Verbruggen <erik.verbruggen@me.com> | 2013-11-14 14:16:50 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-14 14:43:38 +0100 |
commit | f0349e789a984de7646865b07c125a63406516bd (patch) | |
tree | 5985a6b19c14b72829dac4068d1c499a77478b4c /src/qml/jsruntime/qv4debugging_p.h | |
parent | 0ca8351e261055984f82b28bd65e4e15c9820e73 (diff) |
V4 debugging: fix step-over and step-out.
- step-out: only stop if we’re leaving the context for the function we
previously stopped at, so intermediate calls between the current
position and the end do not stop the engine
- step-over: set breakpoints on all lines in current function and
continue to run. When hitting a breakpoint, see if we are in the same
context, because recursive calls might happen. Breakpoints on all
lines are needed, because the (pure) next line might be jumped over
(like when doing step-over a single-line then clause, where the next
line might be in the else clause).
Change-Id: Idf35dc740ca64fae5079162162906490a96af2a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4debugging_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4debugging_p.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4debugging_p.h b/src/qml/jsruntime/qv4debugging_p.h index b6f39d86ba..98b549995e 100644 --- a/src/qml/jsruntime/qv4debugging_p.h +++ b/src/qml/jsruntime/qv4debugging_p.h @@ -181,9 +181,9 @@ private: // requires lock to be held void setTemporaryBreakPointOnNextLine(); // requires lock to be held - void clearTemporaryBreakPoint(); + void clearTemporaryBreakPoints(); // requires lock to be held - bool temporaryBreakPointInFunction() const; + bool temporaryBreakPointInFunction(ExecutionContext *context) const; void applyPendingBreakPoints(); static void setBreakOnInstruction(Function *function, qptrdiff codeOffset, bool onoff); @@ -220,11 +220,14 @@ private: struct TemporaryBreakPoint { Function *function; - qptrdiff codeOffset; - TemporaryBreakPoint(Function *function = 0, qptrdiff codeOffset = 0) - : function(function), codeOffset(codeOffset) + QVector<qptrdiff> codeOffsets; + ExecutionContext *context; + TemporaryBreakPoint(): function(0), context(0) {} + TemporaryBreakPoint(Function *function, ExecutionContext *context) + : function(function) + , context(context) {} - } m_temporaryBreakPoint; + } m_temporaryBreakPoints; bool m_breakOnThrow; |