[Lldb-commits] [lldb] [lldb] Replay the cached error from GetLoadImageUtilityFunction (PR #226986)

via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 29 18:28:36 PDT 2026


================
@@ -664,13 +664,16 @@ class Process : public std::enable_shared_from_this<Process>,
   ///     A function that will be called only once per-process in a
   ///     thread-safe way to create the UtilityFunction if it has not
   ///     been initialized yet.
+  /// \param[out] error
+  ///     If the UtilityFunction could not be created, the reason why.
   ///
   /// \return
   ///     The cached utility function or null if the platform is not the
-  ///     same as the target's platform.
+  ///     same as the target's platform, or if it could not be created.
   UtilityFunction *GetLoadImageUtilityFunction(
       Platform *platform,
-      llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory);
+      llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory,
+      Status &error);
----------------
jimingham wrote:

I wish a better word than Expected had been chosen (EnforcedError or something) because returning an Expected here makes it sound like a Process is expected to know how to do this.  But in fact, if you don't have a way to do this that's totally fine, we just won't be able to do `process load`...

Might be good to indicate that this is an optional part of the Process interface.

https://github.com/llvm/llvm-project/pull/226986


More information about the lldb-commits mailing list