llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) <details> <summary>Changes</summary> 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. --- Full diff: https://github.com/llvm/llvm-project/pull/185056.diff 2 Files Affected: - (modified) lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (+1-1) - (modified) lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h (+22) ``````````diff 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); `````````` </details> https://github.com/llvm/llvm-project/pull/185056 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
