Don't load the lldb bridge from Qt Core script in a Qt Creator session
If a process is being debugged from within Qt Creator, the Qt Core lldb helper script should not try to load the lldb bridges from each Qt Creator installation that has been found, because the main Creator's lldbbridge.py was already loaded, and trying to do it again would just return early. In some cases that could even silently break the dumper helpers if a bridge of an older Creator is loaded, because of the side-effects of importing lldbbridge.py. Detect that lldb was launched by Qt Creator via either the QTC_DEBUGGER_PROCESS or the QT_CREATOR_LLDB_PROCESS variables being set. The former is set by Qt Creator 14 and earlier, the latter is newly introduced in Creator 15. Add an opt in to force trying to load the bridge if the QT_FORCE_LOAD_LLDB_SUMMARY_PROVIDER environment variable is set. Fixes: QTCREATORBUG-31769 Change-Id: Id59ed71f1e59c6c430bc0c72eb30a075db5fa603 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 0806aee2bb355e54abcabe87a5fd97504f692ba9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
2469cb7a12
commit
25686af631
@ -43,6 +43,12 @@ def import_bridge(path, debugger, session_dict, reload_module=False):
|
||||
return bridge
|
||||
|
||||
def __lldb_init_module(debugger, session_dict):
|
||||
qtc_env_vars = ['QTC_DEBUGGER_PROCESS', 'QT_CREATOR_LLDB_PROCESS']
|
||||
if any(v in os.environ for v in qtc_env_vars) and \
|
||||
not 'QT_FORCE_LOAD_LLDB_SUMMARY_PROVIDER' in os.environ:
|
||||
debug("Qt Creator lldb bridge not loaded because we're already in a debugging session.")
|
||||
return
|
||||
|
||||
# Check if the module has already been imported globally. This ensures
|
||||
# that the Qt Creator application search is only performed once per
|
||||
# LLDB process invocation, while still reloading for each session.
|
||||
|
Loading…
x
Reference in New Issue
Block a user