Debugging fixes.
authorErik Verbruggen <erik.verbruggen@digia.com>
Tue, 18 Dec 2012 12:53:32 +0000 (13:53 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 18 Dec 2012 14:18:29 +0000 (15:18 +0100)
Change-Id: I53b7301c28314210f96acc358744ff7e2a65546d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
debugging.cpp
debugging.h
moth/qv4isel_moth.cpp

index 64fd940..8033f36 100644 (file)
@@ -123,9 +123,7 @@ FunctionDebugInfo *Debugger::debugInfo(VM::FunctionObject *function) const
 QString Debugger::name(VM::FunctionObject *function) const
 {
     if (FunctionDebugInfo *i = debugInfo(function))
-        if (i->function)
-            if (const QString *n = i->function->name)
-                return *n;
+        return i->name;
 
     return QString();
 }
index e283314..e6626c5 100644 (file)
@@ -47,9 +47,15 @@ namespace Debugging {
 class Debugger;
 
 struct FunctionDebugInfo { // TODO: use opaque d-pointers here
-    IR::Function *function;
+    QString name;
     unsigned startLine, startColumn;
- FunctionDebugInfo(IR::Function *function): function(function), startLine(0), startColumn(0) {}
+
+    FunctionDebugInfo(IR::Function *function):
+        startLine(0), startColumn(0)
+    {
+        if (function->name)
+            name = *function->name;
+    }
 
     void setSourceLocation(unsigned line, unsigned column)
     { startLine = line; startColumn = column; }
index ed70b42..0277fc6 100644 (file)
@@ -29,6 +29,10 @@ class CompressTemps: public IR::StmtVisitor, IR::ExprVisitor
 public:
     void run(IR::Function *function)
     {
+#ifdef DEBUG_TEMP_COMPRESSION
+        qDebug() << "starting on function" << (*function->name) << "with" << function->tempCount << "temps.";
+#endif // DEBUG_TEMP_COMPRESSION
+
         _seenTemps.clear();
         _nextFree = 0;
         _active.reserve(function->tempCount);