From 1b73c202ce907cd03864413f472bfeb5abf5151e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 15 May 2017 18:04:26 +0200 Subject: macOS: Add LLDB debug script when building with separate debug info (dSYM) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script will look for the most recent Qt Creator version on the system, and pick up the LLDB summary providers from there, allowing pretty-printing of Qt types inside LLDB/Xcode. LLDB will detect the file when loading the dSYM, and inform the user that the file can be loaded to enable the formatters. The script can be loaded automatically by adding the following setting in ~/.lldbinit: settings set target.load-script-from-symbol-file true Which comes as a slight security risk, as other libraries might have scripts of their own. The alternative is to load the script directly from ~/.lldbinit: command script import "" With an optional target.load-script-from-symbol-file set to false, to silence the warning when loading the dSYM bundle. Change-Id: I01ba51dab725a8d0a58f1ad1749742443b639cc5 Reviewed-by: hjk Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- mkspecs/features/unix/separate_debug_info.prf | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index ebb37bdfc7..0b34b17c27 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -56,6 +56,13 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) { debug_info_plist.input = $$QMAKESPEC/Info.plist.dSYM.in debug_info_plist.output = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist QMAKE_SUBSTITUTES += debug_info_plist + + !isEmpty(QMAKE_DSYM_DEBUG_SCRIPT) { + debug_script.input = $$QMAKE_DSYM_DEBUG_SCRIPT + debug_script.output = $${debug_info_target}.$$debug_info_suffix/Contents/Resources/Python/$${TARGET}.py + debug_script.CONFIG = verbatim + QMAKE_SUBSTITUTES += debug_script + } } contains(INSTALLS, target):isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) { @@ -64,6 +71,11 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) { debug_info_plist_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist debug_info_plist_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents INSTALLS += debug_info_plist_target + + debug_script_target.CONFIG += no_check_exist + debug_script_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Resources/Python/$${TARGET}.py + debug_script_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents/Resources/Python + INSTALLS += debug_script_target } debug_info_target.CONFIG += no_check_exist -- cgit v1.2.3