[Lldb-commits] [lldb] [lldb][PlatformDarwin] Make PlatformDarwin define a safe-path for auto-loading scripting resources (PR #191454)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 10 09:21:56 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- lldb/include/lldb/Core/Debugger.h lldb/include/lldb/Target/Platform.h lldb/include/lldb/Utility/FileSpecList.h lldb/source/Core/Debugger.cpp lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h lldb/source/Target/Platform.cpp lldb/unittests/Platform/PlatformDarwinTest.cpp lldb/unittests/Utility/FileSpecListTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h
index 920684855..7f56b83ad 100644
--- a/lldb/include/lldb/Target/Platform.h
+++ b/lldb/include/lldb/Target/Platform.h
@@ -1011,7 +1011,10 @@ public:
/// Returns a \c FileSpecList of safe paths to auto-load scripting resources
/// from for a particular platform.
- virtual llvm::Expected<FileSpecList> GetSafeAutoLoadPaths(const Target &target) { return FileSpecList(); }
+ virtual llvm::Expected<FileSpecList>
+ GetSafeAutoLoadPaths(const Target &target) {
+ return FileSpecList();
+ }
protected:
/// Create a list of ArchSpecs with the given OS and a architectures. The
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index f91410ab1..8e9eb600b 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -2599,12 +2599,13 @@ FileSpecList Debugger::GetSafeAutoLoadPaths() {
// Add platform-specific safe-paths.
if (TargetSP target_sp = GetSelectedTarget()) {
if (PlatformSP platform_sp = GetPlatformList().GetSelectedPlatform()) {
- if (auto platform_fspecs_or_err = platform_sp->GetSafeAutoLoadPaths(*target_sp))
+ if (auto platform_fspecs_or_err =
+ platform_sp->GetSafeAutoLoadPaths(*target_sp))
fspecs.Append(*platform_fspecs_or_err);
else
- LLDB_LOG_ERROR(
- GetLog(LLDBLog::Modules | LLDBLog::Platform), platform_fspecs_or_err.takeError(),
- "Skipping safe auto-load path: {0}");
+ LLDB_LOG_ERROR(GetLog(LLDBLog::Modules | LLDBLog::Platform),
+ platform_fspecs_or_err.takeError(),
+ "Skipping safe auto-load path: {0}");
}
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index fdbc6ce4e..17da8554d 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -1564,7 +1564,8 @@ PlatformDarwin::ResolveSDKPathFromDebugInfo(CompileUnit &unit) {
return path_or_err->str();
}
-llvm::Expected<FileSpecList> PlatformDarwin::GetSafeAutoLoadPaths(const Target &target) {
+llvm::Expected<FileSpecList>
+PlatformDarwin::GetSafeAutoLoadPaths(const Target &target) {
Log *log = GetLog(LLDBLog::Modules | LLDBLog::Platform);
XcodeSDK::Type sdk_type =
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index 9e446d65e..c4aa840f7 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -159,7 +159,8 @@ public:
const Target &target,
const FileSpec &symfile_spec);
- llvm::Expected<FileSpecList> GetSafeAutoLoadPaths(const Target &target) override;
+ llvm::Expected<FileSpecList>
+ GetSafeAutoLoadPaths(const Target &target) override;
protected:
static const char *GetCompatibleArch(ArchSpec::Core core, size_t idx);
diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index e79986b42..a4dd91667 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -721,9 +721,11 @@ INSTANTIATE_TEST_SUITE_P(PlatformDarwinLocateWithSpecialCharsTest,
{' ', '_'}, {'.', '_'}, {'-', '_'}, {'+', 'x'}}));
TEST_F(PlatformDarwinLocateTest, GetSafeAutoLoadPaths) {
- // Tests PlatformDarwin::GetSafeAutoLoadPaths returns a path into the SDK on Darwin platforms.
+ // Tests PlatformDarwin::GetSafeAutoLoadPaths returns a path into the SDK on
+ // Darwin platforms.
- auto paths_or_err = std::static_pointer_cast<PlatformDarwin>(m_platform_sp)->GetSafeAutoLoadPaths(*m_target_sp);
+ auto paths_or_err = std::static_pointer_cast<PlatformDarwin>(m_platform_sp)
+ ->GetSafeAutoLoadPaths(*m_target_sp);
ASSERT_THAT_EXPECTED(paths_or_err, llvm::Succeeded());
``````````
</details>
https://github.com/llvm/llvm-project/pull/191454
More information about the lldb-commits
mailing list