Commit c6f49316 authored by hjk's avatar hjk
Browse files

Debugger: Search static meta objects recursively also with LLDB



Change-Id: I5e7eb59e971933fef8ef94c20333035188d33a57
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d40ee224
......@@ -856,12 +856,23 @@ class Dumper(DumperBase):
buf[i] = data.GetUnsignedInt8(error, i)
return Blob(bytes(buf))
def extractStaticMetaObjectHelper(self, typeobj):
if typeobj.GetTypeClass() in (lldb.eTypeClassStruct, lldb.eTypeClassClass):
needle = typeobj.GetUnqualifiedType().GetName() + "::staticMetaObject"
result = self.target.FindFirstGlobalVariable(needle)
if result is None:
result = 0
else:
result = 0
self.knownStaticMetaObjects[typeobj.GetName()] = result
return result
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
result = self.extractStaticMetaObjectHelper(typeobj)
if result:
return result
base = typeobj.GetDirectBaseClassAtIndex(0).GetType()
return self.extractStaticMetaObjectHelper(base)
def stripNamespaceFromType(self, typeName):
#type = stripClassTag(typeName)
......
......@@ -5040,10 +5040,14 @@ void tst_Dumpers::dumper_data()
" MyFile(const QString &fileName)\n"
" : QFile(fileName) {}\n"
"};\n",
"MyFile file(\"/tmp/tt\");\n"
"file.setObjectName(\"A file\");\n")
% CoreProfile()
% QtVersion(50000)
% UseDebugImage()
% Check("file", "\"A file\"", "MyFile")
% Check("file.@1", "[@QFile]", "\"/tmp/tt\"", "@QFile");
// FIXME: The classname in the iname is sub-optimal.
......
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