From ff6736fade8974fa2d6b2f516592d7046a29be7b Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Mon, 12 Jul 2010 17:13:58 +0200
Subject: [PATCH] debugger: work aroung gdb/python type lookup for arrays

---
 share/qtcreator/gdbmacros/dumper.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py
index af7ff85a4b6..7786adca1b0 100644
--- a/share/qtcreator/gdbmacros/dumper.py
+++ b/share/qtcreator/gdbmacros/dumper.py
@@ -124,6 +124,10 @@ def lookupType(typestring):
         #if not type is None:
         #    warn("  FIELDS: '%s'" % type.fields())
         typeCache[typestring] = type
+    if type is None:
+        # could be gdb.lookup_type("char[3]") generating
+        # "RuntimeError: No type named char[3]"
+        pass
     return type
 
 def cleanType(type):
@@ -805,7 +809,10 @@ def extractFields(type):
     #warn("TYPE 0: %s" % type)
     type = stripTypedefs(type)
     #warn("TYPE 1: %s" % type)
-    type = lookupType(str(type))
+    # This fails for arrays. See comment in lookupType.
+    type2 = lookupType(str(type))
+    if not type2 is None:
+        type = type2
     #warn("TYPE 2: %s" % type)
     fields = type.fields()
     #warn("FIELDS: %s" % fields)
-- 
GitLab