diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-10 10:50:37 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-12 12:13:20 +0100 |
commit | 73a8f5f4845d34d74470b5a524d655be9eaf6dfc (patch) | |
tree | b3ff01f6e3f7f8c51eaab36d868fbcff6fe5384b /src/qml/jsruntime/qv4debugging.cpp | |
parent | 943583ca408f5d419de03e54aab48557f5e5bebb (diff) | |
download | qtdeclarative-73a8f5f4845d34d74470b5a524d655be9eaf6dfc.tar.gz |
Cleanup debugger to be safe for the new GC
Added a bit of convenience to PersistentValue as well.
Change-Id: I5a858079543b41ce1ef48a84e9350a7d6fa64501
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4debugging.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4debugging.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index 7ef32a1c92..c906fb3581 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -152,7 +152,6 @@ public: Debugger::Debugger(QV4::ExecutionEngine *engine) : m_engine(engine) - , m_currentContext(0) , m_agent(0) , m_state(Running) , m_stepping(NotStepping) @@ -219,7 +218,7 @@ void Debugger::resume(Speed speed) if (!m_returnedValue.isUndefined()) m_returnedValue = Encode::undefined(); - m_currentContext = m_engine->currentContext(); + m_currentContext = m_engine->currentContext()->d(); m_stepping = speed; m_runningCondition.wakeAll(); } @@ -524,7 +523,7 @@ void Debugger::maybeBreakAtInstruction() switch (m_stepping) { case StepOver: - if (m_currentContext != m_engine->currentContext()) + if (m_currentContext.asManaged()->d() != m_engine->currentContext()->d()) break; // fall through case StepIn: @@ -550,7 +549,7 @@ void Debugger::enteringFunction() QMutexLocker locker(&m_lock); if (m_stepping == StepIn) { - m_currentContext = m_engine->currentContext(); + m_currentContext = m_engine->currentContext()->d(); } } @@ -563,8 +562,8 @@ void Debugger::leavingFunction(const ReturnedValue &retVal) QMutexLocker locker(&m_lock); Scope scope(m_engine); - if (m_stepping != NotStepping && m_currentContext == m_engine->currentContext()) { - m_currentContext = Scoped<ExecutionContext>(scope, m_engine->currentContext()->d()->parent).getPointer(); + if (m_stepping != NotStepping && m_currentContext.asManaged()->d() == m_engine->currentContext()->d()) { + m_currentContext = m_engine->currentContext()->d()->parent; m_stepping = StepOver; m_returnedValue = retVal; } |