[Lldb-commits] [lldb] f5255b0 - [lldb][PlatformDarwin] Make LocateExecutableScriptingResourcesFromDSYM a public static (#185056)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 6 10:34:50 PST 2026
Author: Michael Buch
Date: 2026-03-06T18:34:46Z
New Revision: f5255b0d5ab853a56ad7bdce65c6f217d87d46b9
URL: https://github.com/llvm/llvm-project/commit/f5255b0d5ab853a56ad7bdce65c6f217d87d46b9
DIFF: https://github.com/llvm/llvm-project/commit/f5255b0d5ab853a56ad7bdce65c6f217d87d46b9.diff
LOG: [lldb][PlatformDarwin] Make LocateExecutableScriptingResourcesFromDSYM a public static (#185056)
This will allow us to unit-test it in a follow-up patch. We could test
`LocateExecutableScriptingResources` directly, but that requires a valid
`Module`/`ObjectFile`/`SymbolFile`. That's a lot of boilerplate/set to
ultimately just test the `dSYM` logic. The helper just takes
`FileSpec`s, which are much easier to construct in a test.
Added:
Modified:
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 3d12f9f815661..2c5b10c07ee26 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -200,7 +200,7 @@ PlatformDarwin::PutFile(const lldb_private::FileSpec &source,
return PlatformPOSIX::PutFile(source, destination, uid, gid);
}
-static FileSpecList LocateExecutableScriptingResourcesFromDSYM(
+FileSpecList PlatformDarwin::LocateExecutableScriptingResourcesFromDSYM(
Stream &feedback_stream, FileSpec module_spec, const Target &target,
const FileSpec &symfile_spec) {
FileSpecList file_list;
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index dc81a9baf5e51..e884bcba5c2cc 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -133,6 +133,28 @@ class PlatformDarwin : public PlatformPOSIX {
llvm::Expected<std::string>
ResolveSDKPathFromDebugInfo(CompileUnit &unit) override;
+ /// Helper function for \c LocateExecutableScriptingResources
+ /// which gathers FileSpecs for executable scripts (currently
+ /// just Python) from a .dSYM Python directory.
+ ///
+ /// \param[out] feedback_stream Any warnings/errors are printed into this
+ /// stream.
+ ///
+ /// \param[in] module_spec FileSpec of the Module for which to locate
+ /// scripting resources.
+ ///
+ /// \param[in] target Target which owns the ScriptInterpreter which is
+ /// eventually used for loading the scripting resources.
+ ///
+ /// \param[in] symfile_spec FileSpec for the SymbolFile inside the Module's
+ /// dSYM directory. The scripting resources are loaded from the adjacent
+ /// Resources directory in the same dSYM.
+ /// E.g., \c /path/to/.dSYM/Contents/Resources/DWARF/a.out
+ ///
+ static FileSpecList LocateExecutableScriptingResourcesFromDSYM(
+ Stream &feedback_stream, FileSpec module_spec, const Target &target,
+ const FileSpec &symfile_spec);
+
protected:
static const char *GetCompatibleArch(ArchSpec::Core core, size_t idx);
More information about the lldb-commits
mailing list