Dumper: Fix QObject detection when using procedure linkage tables

Change-Id: I3ac9889b822cb30d2ccdb6a7e2452e753cc3f2df
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2016-12-02 13:07:58 +01:00
committed by hjk
parent dc2724a3f7
commit 983936f975
2 changed files with 9 additions and 2 deletions

View File

@@ -254,6 +254,7 @@ class DumperBase:
self.typesToReport = {}
self.qtNamespaceToReport = None
self.qtCustomEventFunc = 0
self.qtCustomEventPltFunc = 0
self.qtPropertyFunc = 0
self.passExceptions = False
self.isTesting = False
@@ -1472,7 +1473,7 @@ class DumperBase:
self.bump('nostruct-3')
return False
return self.qtCustomEventFunc == customEventFunc
return customEventFunc in (self.qtCustomEventFunc, self.qtCustomEventPltFunc)
def extractQObjectProperty(objectPtr):
vtablePtr = self.extractPointer(objectPtr)

View File

@@ -1012,7 +1012,7 @@ class Dumper(DumperBase):
def findSymbol(self, symbolName):
try:
return toInteger(gdb.parse_and_eval('(size_t)&%s' % symbolName))
return toInteger(gdb.parse_and_eval("(size_t)&'%s'" % symbolName))
except:
return 0
@@ -1054,6 +1054,12 @@ class Dumper(DumperBase):
sym = '_ZN7QObject11customEventEP6QEvent'
self.qtCustomEventFunc = self.findSymbol(sym)
if lenns:
sym = '_ZN%s7QObject11customEventEPNS_6QEventE@plt' % strns
else:
sym = '_ZN7QObject11customEventEP6QEvent@plt'
self.qtCustomEventPltFunc = self.findSymbol(sym)
sym = '_ZNK7%sQObject8propertyEPKc' % strns
self.qtPropertyFunc = self.findSymbol(sym)