From b1ab5a6948510632c9f6a283651de9a930d008e3 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Fri, 5 Mar 2010 13:25:00 +0100
Subject: [PATCH] debugger: disable currently broken QAbstractItemModel dumper

---
 share/qtcreator/gdbmacros/dumper.py    | 12 +++---
 share/qtcreator/gdbmacros/gdbmacros.py | 60 +++++++++++++-------------
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py
index 3d89b117b44..5627c6d4fbc 100644
--- a/share/qtcreator/gdbmacros/dumper.py
+++ b/share/qtcreator/gdbmacros/dumper.py
@@ -606,12 +606,12 @@ class FrameCommand(gdb.Command):
             else:
                 # A "normal" local variable or parameter.
                 try:
-                    addr = cleanAddress(item.value.address)
-                    d.beginHash()
-                    d.put('iname="%s",' % item.iname)
-                    d.put('addr="%s",' % addr)
-                    d.safePutItemHelper(item)
-                    d.endHash()
+                   addr = cleanAddress(item.value.address)
+                   d.beginHash()
+                   d.put('iname="%s",' % item.iname)
+                   d.put('addr="%s",' % addr)
+                   d.safePutItemHelper(item)
+                   d.endHash()
                 except AttributeError:
                     # Thrown by cleanAddress with message "'NoneType' object
                     # has no attribute 'cast'" for optimized-out values.
diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py
index 0c5ccac0179..32411019191 100644
--- a/share/qtcreator/gdbmacros/gdbmacros.py
+++ b/share/qtcreator/gdbmacros/gdbmacros.py
@@ -77,36 +77,36 @@ def qdump__QAbstractItem(d, item):
         d.endChildren()
 
 
-def qdump__QAbstractItemModel(d, item):
-    rowCount = call(item.value, "rowCount()")
-    if rowCount < 0:
-        return
-    columnCount = call(item.valuem, "columnCount()")
-    if columnCount < 0:
-        return
-
-    d.putValue("(%s,%s)" % (rowCount, columnCount))
-    d.putNumChild(1)
-    if d.isExpanded(item):
-        d.beginChildren(1)
-        d.beginHash()
-        d.putNumChild(1)
-        d.putName(d.ns + "QObject")
-        d.putValue(call(item.value, "objectName()"), 2)
-        d.putType(d.ns + "QObject")
-        d.putField("displayedtype", call(item, "m.metaObject()->className()"))
-        d.endHash()
-        for row in xrange(rowCount):
-            for column in xrange(columnCount):
-                mi = call(m, "index(%s,%s)" % (row, column))
-                d.beginHash()
-                d.putName("[%s,%s]" % (row, column))
-                d.putValue("m.data(mi, Qt::DisplayRole).toString()", 6)
-                #d.putNumChild((m.hasChildren(mi) ? 1 : 0)
-                d.putNumChild(1) #m.rowCount(mi) * m.columnCount(mi))
-                d.putType(d.ns + "QAbstractItem")
-                d.endHash()
-        d.endChildren()
+#def qdump__QAbstractItemModel(d, item):
+#    # FIXME: This does not get the default argument right and ends up
+#    # returning 'None'.
+#    rowCount = call(item.value, "rowCount()")
+#    columnCount = call(item.value, "columnCount()")
+#    d.putValue("(%s,%s)" % (rowCount, columnCount))
+#    #if columnCount < 0 or rowCount < 0:
+#    #    d.putNumChild(0)
+#    #    return
+#    d.putNumChild(1)
+#    if d.isExpanded(item):
+#        d.beginChildren(1)
+#        d.beginHash()
+#        d.putNumChild(1)
+#        d.putName(d.ns + "QObject")
+#        d.putValue(call(item.value, "objectName()"), 2)
+#        d.putType(d.ns + "QObject")
+#        d.putField("displayedtype", call(item, "m.metaObject()->className()"))
+#        d.endHash()
+#        for row in xrange(rowCount):
+#            for column in xrange(columnCount):
+#                mi = call(m, "index(%s,%s)" % (row, column))
+#                d.beginHash()
+#                d.putName("[%s,%s]" % (row, column))
+#                d.putValue("m.data(mi, Qt::DisplayRole).toString()", 6)
+#                #d.putNumChild((m.hasChildren(mi) ? 1 : 0)
+#                d.putNumChild(1) #m.rowCount(mi) * m.columnCount(mi))
+#                d.putType(d.ns + "QAbstractItem")
+#                d.endHash()
+#        d.endChildren()
 
 
 def qdump__QDateTime(d, item):
-- 
GitLab