Debugger: Simplify Qt namespace guessing code

We get proper notification when QtCore is loaded now, and we either
got it, or not.

Change-Id: I9485126d9b15b8d859ba440f3ba1623f03527ef8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-03-15 10:05:05 +01:00
parent 68a4a3db94
commit 61501042bc
2 changed files with 8 additions and 24 deletions
+8 -17
View File
@@ -959,10 +959,8 @@ class Dumper(DumperBase):
self.importPlainDumper(printer)
def qtNamespace(self):
self.preping('qtNamespace')
res = self.qtNamespaceX()
self.ping('qtNamespace')
return res
# This function is replaced by handleQtCoreLoaded()
return ''
def findSymbol(self, symbolName):
try:
@@ -1003,6 +1001,12 @@ class Dumper(DumperBase):
strns = ('%d%s' % (lenns - 2, ns[:lenns - 2])) if lenns else ''
if lenns:
# This might be wrong, but we can't do better: We found
# a libQt5Core and could not extract a namespace.
# The best guess is that there isn't any.
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
sym = '_ZN%s7QObject11customEventEPNS_6QEventE' % strns
else:
sym = '_ZN7QObject11customEventEP6QEvent'
@@ -1014,19 +1018,6 @@ class Dumper(DumperBase):
sym = '_ZNK%s7QObject8propertyEPKc' % strns
self.qtPropertyFunc = self.findSymbol(sym)
# This might be wrong, but we can't do better: We found
# a libQt5Core and could not extract a namespace.
# The best guess is that there isn't any.
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
def qtNamespaceX(self):
if not self.currentQtNamespaceGuess is None:
return self.currentQtNamespaceGuess
self.currentQtNamespaceGuess = ''
return ''
def assignValue(self, args):
typeName = self.hexdecode(args['type'])
expr = self.hexdecode(args['expr'])