Commit 3e4cc086 authored by hjk's avatar hjk
Browse files

Debugger: Yet another way to extract metaobjects



FindFirstGlobalVariable seems to return bogus values.
EvaluateExpression might be more reliable.

Change-Id: Ic84155688e0e9bbe0d45cde20563929b7370695d
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent b2874f3b
......@@ -862,8 +862,14 @@ class Dumper(DumperBase):
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:
options = lldb.SBExpressionOptions()
result = self.target.EvaluateExpression(needle, options)
# Surprising results include:
# (lldb) script print lldb.target.FindFirstGlobalVariable(
# '::QSharedDataPointer<QDirPrivate>::staticMetaObject')
# (const QMetaObject) QAbstractAnimation::staticMetaObject = { d = { ... } }
#if result.GetName() != needle:
if result is None or not result.IsValid():
result = 0
else:
result = 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