Fix instruction tracing.
authorErik Verbruggen <erik.verbruggen@digia.com>
Tue, 18 Dec 2012 09:59:54 +0000 (10:59 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 18 Dec 2012 10:42:06 +0000 (11:42 +0100)
Change-Id: Ie2ff005e2914bc372e4c6d08dd28d34efdde8da3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
debugging.cpp
moth/qv4vme_moth.cpp

index 4376d0a..64fd940 100644 (file)
@@ -150,7 +150,7 @@ void Debugger::enterFunction(FunctionState *state)
 
 #ifdef DO_TRACE_INSTR
     QString n = name(_callStack[callIndex(state->context())].function);
-    std::cerr << "*** Entering \"" << qPrintable(n) << "\" with " << state->context()->variableEnvironment->argumentCount << " args" << std::endl;
+    std::cerr << "*** Entering \"" << qPrintable(n) << "\" with " << state->context()->argumentCount << " args" << std::endl;
 //    for (unsigned i = 0; i < state->context()->variableEnvironment->argumentCount; ++i)
 //        std::cerr << "        " << i << ": " << currentArg(i) << std::endl;
 #endif // DO_TRACE_INSTR
index b8404bc..2a1302f 100644 (file)
@@ -60,15 +60,15 @@ static inline VM::Value *tempValue(QQmlJS::VM::ExecutionContext *context, VM::Va
     if (index < 0) {
         kind = "arg";
         pos = -index - 1;
-    } else if (index < (int) varEnv->varCount) {
+    } else if (index < (int) context->variableCount()) {
         kind = "local";
         pos = index;
     } else {
         kind = "temp";
-        pos = index - varEnv->varCount;
+        pos = index - context->variableCount();
     }
-    fprintf(stderr, "    tempValue: index = %d : %s = %d, stack size = %d\n",
-          index, kind, pos, stack.size());
+    fprintf(stderr, "    tempValue: index = %d : %s = %d\n",
+          index, kind, pos);
 #endif // DO_TRACE_INSTR
 
     if (index < 0) {