forked from qt-creator/qt-creator
Debugger: More robust Qt namespace extraction for LLDB
Change-Id: I3964f15cb4295a64f91e0eb6035d365ee2b9f9bd Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -432,19 +432,27 @@ class Dumper(DumperBase):
|
|||||||
def qtVersionAndNamespace(self):
|
def qtVersionAndNamespace(self):
|
||||||
for func in self.target.FindFunctions('qVersion'):
|
for func in self.target.FindFunctions('qVersion'):
|
||||||
name = func.GetSymbol().GetName()
|
name = func.GetSymbol().GetName()
|
||||||
|
if name.endswith('()'):
|
||||||
|
name = name[:-2]
|
||||||
if name.count(':') > 2:
|
if name.count(':') > 2:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
version = str(self.parseAndEvaluate('((const char*())%s)()' % name))
|
|
||||||
version.replace("'", '"') # Both seem possible
|
|
||||||
version = version[version.find('"')+1:version.rfind('"')]
|
|
||||||
|
|
||||||
if version.count('.') != 2:
|
|
||||||
continue
|
|
||||||
|
|
||||||
qtNamespace = name[:name.find('qVersion')]
|
qtNamespace = name[:name.find('qVersion')]
|
||||||
self.qtNamespace = lambda: qtNamespace
|
self.qtNamespace = lambda: qtNamespace
|
||||||
|
|
||||||
|
res = ""
|
||||||
|
try:
|
||||||
|
res = self.parseAndEvaluate(name + '()')
|
||||||
|
except:
|
||||||
|
res = self.parseAndEvaluate('((const char*())%s)()' % name)
|
||||||
|
version = str(res)
|
||||||
|
|
||||||
|
if version.count('.') != 2:
|
||||||
|
continue
|
||||||
|
|
||||||
|
version.replace("'", '"') # Both seem possible
|
||||||
|
version = version[version.find('"')+1:version.rfind('"')]
|
||||||
|
|
||||||
(major, minor, patch) = version.split('.')
|
(major, minor, patch) = version.split('.')
|
||||||
qtVersion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
|
qtVersion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
|
||||||
self.qtVersion = lambda: qtVersion
|
self.qtVersion = lambda: qtVersion
|
||||||
|
Reference in New Issue
Block a user