From 33cafa0dcf5a931482f1da47b4b740ce0350ea2f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 4 Mar 2021 12:52:22 +0100 Subject: [PATCH] LLDB: Drop secondary lookup of native types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although already tried to lookup a native type with an lldb internal mechanism we still tried to do it "manually" again. This secondary approach was needed at some point when lldb had no integrated way to lookup a type inside all modules. Lookups done manually will not provide a better result than the lldb internal one. The error output generated with this blocks debugging which makes QC unusable at this state. So, remove the secondary lookup completely. Fixes: QTCREATORBUG-25185 Fixes: QTCREATORBUG-25217 Change-Id: Ibd8a125a89633c611bf750e0f1759c639717e1d2 Reviewed-by: Tor Arne Vestbø Reviewed-by: hjk --- share/qtcreator/debugger/lldbbridge.py | 38 +------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index ababe4a362c..022d766fbf8 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -844,39 +844,7 @@ class Dumper(DumperBase): if typeobj is not None: return typeobj - return self.lookupNativeTypeInAllModules(name) - - def lookupNativeTypeInAllModules(self, name): - needle = self.canonicalTypeName(name) - #DumperBase.warn('NEEDLE: %s ' % needle) - DumperBase.warn('Searching for type %s across all target modules, this could be very slow' % name) - for i in range(self.target.GetNumModules()): - module = self.target.GetModuleAtIndex(i) - # SBModule.GetType is new somewhere after early 300.x - # So this may fail. - for t in module.GetTypes(): - n = self.canonicalTypeName(t.GetName()) - #DumperBase.warn('N: %s' % n) - if n == needle: - #DumperBase.warn('FOUND TYPE DIRECT 2: %s ' % t) - self.typeCache[name] = t - return t - if n == needle + '*': - res = t.GetPointeeType() - self.typeCache[name] = res - x = self.fromNativeType(res) # Register under both names - self.registerTypeAlias(x.typeId, name) - #DumperBase.warn('FOUND TYPE BY POINTER: %s ' % res.name) - return res - if n == needle + '&': - res = t.GetDereferencedType().GetUnqualifiedType() - self.typeCache[name] = res - x = self.fromNativeType(res) # Register under both names - self.registerTypeAlias(x.typeId, name) - #DumperBase.warn('FOUND TYPE BY REFERENCE: %s ' % res.name) - return res - #DumperBase.warn('NOT FOUND: %s ' % needle) - return None + return lldb.SBType() def setupInferior(self, args): """ Set up SBTarget instance """ @@ -2086,10 +2054,6 @@ class SummaryDumper(Dumper, LogMixin): def report(self, stuff): return # Don't mess up lldb output - def lookupNativeTypeInAllModules(self, name): - self.warn('Failed to resolve type %s' % name) - return None - def dump_summary(self, valobj, expanded=False): try: from pygdbmi import gdbmiparser