From 57e637ff32e982c219d530d819e47cb00c8c170a Mon Sep 17 00:00:00 2001 From: Yuanfeng Gao Date: Thu, 1 Oct 2020 14:57:23 -0400 Subject: [PATCH] Setting working directory to ensure lldb remote debugging works on relative paths in debug info etc. --- .../bazelinstallers/lldb-settings.sh | 5 +++++ .../bazelinstallers/lldb-settings.sh | 5 +++++ .../bazelinstallers/lldb-settings.sh | 5 +++++ .../bazelinstallers/lldb-settings.sh | 5 +++++ .../bazelinstallers/lldb-settings.sh | 5 +++++ .../bazelinstallers/lldb-settings.sh | 5 +++++ tools/xcodeproj_shims/installers/lldb-settings.sh | 5 +++++ 7 files changed, 35 insertions(+) diff --git a/tests/ios/xcodeproj/Single-Static-Framework-Project.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/ios/xcodeproj/Single-Static-Framework-Project.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/ios/xcodeproj/Single-Static-Framework-Project.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/ios/xcodeproj/Single-Static-Framework-Project.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tests/ios/xcodeproj/Test-Imports-App-Project.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/ios/xcodeproj/Test-Imports-App-Project.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/ios/xcodeproj/Test-Imports-App-Project.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/ios/xcodeproj/Test-Imports-App-Project.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tests/ios/xcodeproj/TestWithHostApp.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/ios/xcodeproj/TestWithHostApp.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/ios/xcodeproj/TestWithHostApp.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/ios/xcodeproj/TestWithHostApp.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/bazelinstallers/lldb-settings.sh b/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/bazelinstallers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/bazelinstallers/lldb-settings.sh +++ b/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/bazelinstallers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS diff --git a/tools/xcodeproj_shims/installers/lldb-settings.sh b/tools/xcodeproj_shims/installers/lldb-settings.sh index bc280dfab..11e4c7452 100755 --- a/tools/xcodeproj_shims/installers/lldb-settings.sh +++ b/tools/xcodeproj_shims/installers/lldb-settings.sh @@ -11,10 +11,15 @@ set -euo pipefail # the paths in the debug info. This lldb setting ensures that _project relative_ # paths are remapped to _project absolute_ paths. # +# The platform settings one points the current working directory (cwd) to workspace root. +# This is needed for features relying on lldb remote debugging, such as `oso_prefix_is_pwd`. +# # NOTE: In order to use this, add this line to `~/.lldbinit`: # # command source ~/.lldbinit-source-map cat <<-END > ~/.lldbinit-source-map +platform settings -w "$BAZEL_WORKSPACE_ROOT/" + settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/" settings set target.sdk-path $SDKROOT settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS