Debugger: Object name display needs debug image on Mac

This should be avoided if possible...

Change-Id: I4c95ab4ab7f765ad42bf6bd35c6f790de5f03668
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-01-29 16:14:10 +01:00
parent b39de8919e
commit 8cf01f81c1
2 changed files with 17 additions and 19 deletions
+13 -19
View File
@@ -862,10 +862,12 @@ class Dumper(DumperBase):
buf[i] = data.GetUnsignedInt8(error, i)
return Blob(bytes(buf))
def isQObject(self, value):
needle = value.GetType().GetName() + "::staticMetaObject"
value = self.target.FindFirstGlobalVariable(needle)
return value.IsValid()
def extractStaticMetaObject(self, typeobj):
if typeobj.GetTypeClass() not in (lldb.eTypeClassStruct, lldb.eTypeClassClass):
return 0
needle = typeobj.GetUnqualifiedType().GetName() + "::staticMetaObject"
result = self.target.FindFirstGlobalVariable(needle)
return result if result else 0
def stripNamespaceFromType(self, typeName):
#type = stripClassTag(typeName)
@@ -993,31 +995,23 @@ class Dumper(DumperBase):
#numchild = 1 if value.MightHaveChildren() else 0
numchild = value.GetNumChildren()
self.putType(typeName)
isQObject = False
if typeClass == lldb.eTypeClassStruct or typeClass == lldb.eTypeClassClass:
if self.isQObject(value):
isQObject = True
self.context = value
if not self.putQObjectNameValue(value): # Is this too expensive?
self.putEmptyValue()
else:
self.putEmptyValue()
self.putEmptyValue(-1)
staticMetaObject = self.extractStaticMetaObject(value.GetType())
if staticMetaObject:
self.context = value
self.putQObjectNameValue(value)
else:
v = value.GetValue()
if v:
self.putValue(v)
else:
self.putEmptyValue()
self.put('numchild="%s",' % numchild)
if self.currentIName in self.expandedINames:
with Children(self):
self.putFields(value)
if isQObject:
needle = value.GetType().GetName() + "::staticMetaObject"
smo = self.target.FindFirstGlobalVariable(needle)
self.putQObjectGuts(value, smo)
if staticMetaObject:
self.putQObjectGuts(value, staticMetaObject)
def warn(self, msg):
self.put('{name="%s",value="",type=""},' % msg)