Commit 9c035bb6 authored by hjk's avatar hjk

Debugger: Handle namespaced Qt in LLDB dumper auto tests

Change-Id: Ib81b82d81dd821be7161eef6515ae1f08091d5e3
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent ae34bfd6
......@@ -432,14 +432,26 @@ class Dumper(DumperBase):
coreExpression = re.compile(r"(lib)?Qt5?Core")
for n in range(0, self.target.GetNumModules()):
module = self.target.GetModuleAtIndex(n)
if coreExpression.match(module.GetFileSpec().GetFilename()):
fileName = module.GetFileSpec().GetFilename()
if coreExpression.match(fileName):
# Extract version.
reverseVersion = module.GetVersion()
reverseVersion.reverse()
shift = 0
for v in reverseVersion:
self.cachedQtVersion += v << shift
shift += 8
if len(reverseVersion):
# Mac, Clang?
reverseVersion.reverse()
shift = 0
for v in reverseVersion:
self.cachedQtVersion += v << shift
shift += 8
else:
# Linux, gcc?
if fileName.endswith(".5"):
self.cachedQtVersion = 0x50000
elif fileName.endswith(".4"):
self.cachedQtVersion = 0x40800
else:
warn("CANNOT GUESS QT VERSION")
# Look for some Qt symbol to extract namespace.
for symbol in module.symbols:
......@@ -461,7 +473,7 @@ class Dumper(DumperBase):
return self.cachedQtNamespace
def qtVersion(self):
self.extraceqtVersionAndNamespace()
self.qtVersionAndNamespace()
return self.cachedQtVersion
def intSize(self):
......@@ -840,7 +852,7 @@ class Dumper(DumperBase):
def putItem(self, value, tryDynamic=True):
#value = value.GetDynamicValue(lldb.eDynamicCanRunTarget)
typeName = value.GetTypeName()
typeName = value.GetType().GetUnqualifiedType().GetName()
value.SetPreferDynamicValue(tryDynamic)
typeClass = value.GetType().GetTypeClass()
......@@ -1509,7 +1521,9 @@ def testit():
None, None, 0, False, error)
db.report = savedReport
ns = db.qtNamespace()
db.reportVariables()
db.report("@NS@%s@" % ns)
#db.report("DUMPER=%s" % qqDumpers)
if __name__ == "__main__":
......
......@@ -1147,12 +1147,14 @@ void tst_Dumpers::dumper()
output = output.mid(pos);
contents = output;
//int posNameSpaceStart = output.indexOf("@NS@");
//QVERIFY(posNameSpaceStart != -1);
//posNameSpaceStart += sizeof("@NS@") - 1;
//int posNameSpaceEnd = output.indexOf("@", posNameSpaceStart);
//QVERIFY(posNameSpaceEnd != -1);
//context.nameSpace = output.mid(posNameSpaceStart, posNameSpaceEnd - posNameSpaceStart);
int posNameSpaceStart = output.indexOf("@NS@");
if (posNameSpaceStart == -1)
qDebug() << "OUTPUT: " << output;
QVERIFY(posNameSpaceStart != -1);
posNameSpaceStart += sizeof("@NS@") - 1;
int posNameSpaceEnd = output.indexOf("@", posNameSpaceStart);
QVERIFY(posNameSpaceEnd != -1);
context.nameSpace = output.mid(posNameSpaceStart, posNameSpaceEnd - posNameSpaceStart);
//qDebug() << "FOUND NS: " << context.nameSpace;
if (context.nameSpace == "::")
context.nameSpace.clear();
......
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