Commit 652d071e authored by hjk's avatar hjk Committed by hjk

debugger: don't let gdb look up dummy types

Sometimes " " is used as type data to make the Locals and Expressions
view show an "empty" field. This should use a better mechanism in the
long term, but for now at least don't ask gdb to look up type " ".

Change-Id: I6617f68affd66116529460b7c3df68b4a0be422e
Reviewed-By: Friedemann Kleint
Reviewed-on: http://codereview.qt.nokia.com/1417Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 58faedc4
......@@ -291,7 +291,7 @@ class SubItem:
if len(type) > 0 and type != self.d.currentChildType:
self.d.put('type="%s",' % type) # str(type.unqualified()) ?
if not type in typeInfoCache:
if not type in typeInfoCache and type != " ": # FIXME: Move to lookupType
typeObj = lookupType(type)
if not typeObj is None:
typeInfoCache[type] = TypeInfo(typeObj)
......@@ -1081,7 +1081,7 @@ class Dumper:
try:
list = eval(exp)
self.putValue("")
self.putType(" ")
self.putNoType()
self.putNumChild(len(list))
# This is a list of expressions to evaluate
with Children(self, len(list)):
......@@ -1092,7 +1092,7 @@ class Dumper:
except RuntimeError, error:
warn("EVAL: ERROR CAUGHT %s" % error)
self.putValue("<syntax error>")
self.putType(" ")
self.putNoType()
self.putNumChild(0)
with Children(self, 0):
pass
......@@ -1104,7 +1104,7 @@ class Dumper:
handled = False
if len(exp) == 0: # The <Edit> case
self.putValue(" ")
self.putType(" ")
self.putNoType()
self.putNumChild(0)
else:
try:
......@@ -1147,6 +1147,11 @@ class Dumper:
self.currentType = type
self.currentTypePriority = priority
def putNoType(self):
# FIXME: replace with something that does not need special handling
# in SubItem.__exit__().
self.putBetterType(" ")
def putBetterType(self, type, priority = 0):
self.currentType = type
self.currentTypePriority = self.currentTypePriority + 1
......
......@@ -509,7 +509,7 @@ def qdump__QImage(d, item):
with Children(d):
with SubItem(d):
d.putName("data")
d.putType(" ");
d.putNoType()
d.putNumChild(0)
d.putValue("size: %s bytes" % nbytes);
format = d.itemFormat(item)
......@@ -721,7 +721,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("data")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
iname = item.iname + ".data"
if d.isExpandedIName(iname):
......@@ -761,7 +761,7 @@ def qdump__QObject(d, item):
propertyCount = staticPropertyCount + dynamicPropertyCount
d.putName("properties")
d.putType(" ")
d.putNoType()
d.putItemCount(propertyCount)
d.putNumChild(propertyCount)
......@@ -874,7 +874,7 @@ def qdump__QObject(d, item):
# Connections.
with SubItem(d):
d.putName("connections")
d.putType(" ")
d.putNoType()
connections = d_ptr["connectionLists"]
connectionListCount = 0
if not isNull(connections):
......@@ -906,7 +906,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("signals")
d.putItemCount(signalCount)
d.putType(" ")
d.putNoType()
d.putNumChild(signalCount)
if signalCount:
# FIXME: empty type does not work for childtype
......@@ -920,7 +920,7 @@ def qdump__QObject(d, item):
d.putField("iname", "%s.signals.%d"
% (item.iname, signal))
d.putName("signal %d" % signal)
d.putType(" ")
d.putNoType()
d.putValue(extractCString(metaStringData, offset))
d.putNumChild(0) # FIXME: List the connections here.
......@@ -929,7 +929,7 @@ def qdump__QObject(d, item):
slotCount = metaData[4] - signalCount
d.putName("slots")
d.putItemCount(slotCount)
d.putType(" ")
d.putNoType()
d.putNumChild(slotCount)
if slotCount:
#d.putField("childtype", ".")
......@@ -941,14 +941,14 @@ def qdump__QObject(d, item):
offset = metaData[14 + 5 * (signalCount + slot)]
d.putField("iname", "%s.slots.%d" % (item.iname, slot))
d.putName("slot %d" % slot)
d.putType(" ")
d.putNoType()
d.putValue(extractCString(metaStringData, offset))
d.putNumChild(0) # FIXME: List the connections here.
# Active connection
with SubItem(d):
d.putName("currentSender")
d.putType(" ")
d.putNoType()
sender = d_ptr["currentSender"]
d.putValue(cleanAddress(sender))
if isNull(sender):
......@@ -964,7 +964,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("signal")
d.putValue(sender["signal"])
d.putType(" ");
d.putNoType()
d.putNumChild(0)
# QObject
......@@ -2200,7 +2200,7 @@ def qdump__QTJSC__JSValue(d, item):
with SubItem(d):
d.putName("tag")
d.putValue(jstagAsString(long(tag)))
d.putType(" ")
d.putNoType()
d.putNumChild(0)
d.putIntItem("payload", long(payload))
......@@ -2435,7 +2435,7 @@ if False:
d.putField("iname", iname)
d.putName("tree")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
if d.isExpandedIName(iname):
with Children(d):
......@@ -2446,7 +2446,7 @@ if False:
d.putField("iname", iname)
d.putName("data")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
if d.isExpandedIName(iname):
with Children(d):
......@@ -2504,7 +2504,7 @@ if False:
else:
d.putName("type")
d.putValue(item.value["type"])
d.putType(" ")
d.putNoType()
......@@ -2512,5 +2512,5 @@ if False:
def qdump__bug5106__A5106(d, item):
d.putName("a")
d.putValue("This is the value: %s" % item.value["m_a"])
d.putType(" ")
d.putNoType()
d.putNumChild(0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment