summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-07-27 08:31:21 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-07-27 10:30:23 (GMT)
commitab7c405ac2e528eb23b2c56ef02bd33c42bc3256 (patch)
treef6e90a9ede2252deb4a948c1a8dba52ebc6966e1 /src/script
parent39097c5d652efd3eb0946e5a215d82573a46dbf9 (diff)
downloadQt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.zip
Qt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.tar.gz
Qt-ab7c405ac2e528eb23b2c56ef02bd33c42bc3256.tar.bz2
QScriptEngineAgent: recompile all the function when installing a debugger.
Recompile all the function is necessary to ger the debug opcode that notifies us when the position changes. The change in CollectorHeapIterator.h is nessesary to get it work as Debugger::recompileAllJSFunctions uses LiveObjectIterator, LiveObjectIterator initialied m_cell to -1 and to ++(*this) in its constructor. But as m_cell is of type size_t (unsigned) then the < comparison will always fail as it is an unsigned comparison. This was already fixed upstream in r54672 Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp1
-rw-r--r--src/script/api/qscriptengineagent.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 7bccffe..26673f4 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -4196,6 +4196,7 @@ void QScriptEngine::setAgent(QScriptEngineAgent *agent)
"cannot set agent belonging to different engine");
return;
}
+ QScript::APIShim shim(d);
if (d->activeAgent)
QScriptEngineAgentPrivate::get(d->activeAgent)->detach();
d->activeAgent = agent;
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 0b5828a..c3d1566 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -117,6 +117,8 @@ void QScriptEngineAgentPrivate::attach()
if (engine->originalGlobalObject()->debugger())
engine->originalGlobalObject()->setDebugger(0);
JSC::Debugger::attach(engine->originalGlobalObject());
+ if (!QScriptEnginePrivate::get(engine)->isEvaluating())
+ JSC::Debugger::recompileAllJSFunctions(engine->globalData);
}
void QScriptEngineAgentPrivate::detach()