summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptcontext.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-09 06:48:34 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-09 06:58:33 (GMT)
commitf7906352b21b0634745094f7bb7966d5f6941192 (patch)
tree007ddee96637af9a5cfe82c72500a505f285414c /src/script/api/qscriptcontext.cpp
parenteb3d5a73148cd7206c6b3b6672ed47b44611f745 (diff)
downloadQt-f7906352b21b0634745094f7bb7966d5f6941192.zip
Qt-f7906352b21b0634745094f7bb7966d5f6941192.tar.gz
Qt-f7906352b21b0634745094f7bb7966d5f6941192.tar.bz2
Fix the bactkrace in the QScript Debugger
This patch remove the 'fake' context that appears in the debugger backtrace when there is a break point in the global context. This problem never appeared in the tests because the QScriptContext::backtrace has always at least two items in the backtrace as it needs the native 'bt' function to be called. Changed QScriptEnginePrivate::contextForFrame to skip the fake frame (instead of QScriptContext::parentContext). So we never have a QScriptContext pointing to that frame. The changes in QScriptContextInfo are for retreiving the right filename information for the global context when the global context is on top. Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/api/qscriptcontext.cpp')
-rw-r--r--src/script/api/qscriptcontext.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 7a09d91..2ca6d26 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -374,12 +374,7 @@ QScriptContext *QScriptContext::parentContext() const
{
const JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this);
JSC::CallFrame *callerFrame = frame->callerFrame()->removeHostCallFrameFlag();
- if (callerFrame && callerFrame->callerFrame()->hasHostCallFrameFlag()
- && callerFrame->callerFrame()->removeHostCallFrameFlag() == QScript::scriptEngineFromExec(frame)->globalExec()) {
- //skip the "fake" context created in Interpreter::execute.
- callerFrame = callerFrame->callerFrame()->removeHostCallFrameFlag();
- }
- return reinterpret_cast<QScriptContext *>(callerFrame);
+ return QScriptEnginePrivate::contextForFrame(callerFrame);
}
/*!