From 7de461e40b549a914ff4d19ad7530d724440994b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 25 Sep 2018 15:16:46 +0200 Subject: [PATCH] Debugger: Fix use of external debug info for installer-based Qt On macOS. This amends ada0e43c93. Fixes the default build directory on macOS as this is different compared to Linux. Beside this the patch passes the configured mappings of build dir and source locations to the lldb. Task-number: QTCREATORBUG-20693 Change-Id: I4258c09ec96fbdc1a713ae82df6bcab04129570c Reviewed-by: hjk --- .../debugger/debuggersourcepathmappingwidget.cpp | 2 ++ src/plugins/debugger/lldb/lldbengine.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 6ed1196c963..67915d8cfad 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -61,6 +61,8 @@ QStringList qtBuildPaths() "C:/work/build/qt5_workdir/w/s", "c:/users/qt/work/qt", "c:/Users/qt/work/install"}; + } else if (HostOsInfo::isMacHost()) { + return { "/Users/qt/work/qt" }; } else { return { "/home/qt/work/qt" }; } diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 9d024cef97b..01fb4650ad2 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -318,6 +319,15 @@ void LldbEngine::runEngine() if (rp.startMode == AttachCore) cmd.arg("coreFile", rp.coreFile); runCommand(cmd); + + const SourcePathMap sourcePathMap = + DebuggerSourcePathMappingWidget::mergePlatformQtPath(rp, + Internal::globalDebuggerOptions()->sourcePathMap); + for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); + it != cend; + ++it) { + executeDebuggerCommand("settings append target.source-map " + it.key() + ' ' + it.value()); + } } void LldbEngine::interruptInferior()