diff options
| author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-09-20 00:19:59 +0200 |
|---|---|---|
| committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-09-23 03:38:52 +0200 |
| commit | fe3e0fc6572b544b543e01ac5d158bd25390372a (patch) | |
| tree | 0e5ba41b96e51542a502ee7df4ade2a50b34e357 /src/corelib/debug_script.py | |
| parent | e0eb2818face4ffb7dafd87464f355d4654b7be0 (diff) | |
lldb: Improve reporting when loading summary providers
If loading the lldbbrige fails, we'll continue on to the next
Qt Creator version if we find one. It makes more sense to report
that we're about to load from a given version, so that any error
messages from lldbbridge are output with that context in place.
Change-Id: Icbab6f7d39333ce76d729fd0769cfdb44f05a2f0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/corelib/debug_script.py')
| -rw-r--r-- | src/corelib/debug_script.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/corelib/debug_script.py b/src/corelib/debug_script.py index f6207c6104e..33b32440699 100644 --- a/src/corelib/debug_script.py +++ b/src/corelib/debug_script.py @@ -34,10 +34,6 @@ def import_bridge(path, debugger, session_dict, reload_module=False): return bridge -def report_success(bridge): - print("Using Qt summary providers from Creator {} in '{}'".format( - bridge.CREATOR_VERSION, bridge.CREATOR_PATH)) - def __lldb_init_module(debugger, session_dict): # Check if the module has already been imported globally. This ensures # that the Qt Creator application search is only performed once per @@ -48,7 +44,6 @@ def __lldb_init_module(debugger, session_dict): bridge = import_bridge(module.__file__, debugger, session_dict, reload_module = True) if bridge: - report_success(bridge) return versions = {} @@ -61,15 +56,14 @@ def __lldb_init_module(debugger, session_dict): (p, v) = install.split('=') versions[v] = p + if not len(versions): + print("Could not find Qt Creator installation. No Qt summary providers installed.") + return + for version in sorted(versions, key=LooseVersion, reverse=True): path = versions[version] - + print(f"Loading Qt summary providers from Creator {version} in '{path}'") bridge_path = '{}/Contents/Resources/debugger/lldbbridge.py'.format(path) bridge = import_bridge(bridge_path, debugger, session_dict) if bridge: - bridge.CREATOR_VERSION = version - bridge.CREATOR_PATH = path - report_success(bridge) return - - print("Could not find Qt Creator installation, no Qt summary providers installed") |
