[Lldb-commits] [lldb] [lldb] Add a per-CU API to read the SDK (PR #119022)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 6 14:13:15 PST 2024


================
@@ -473,6 +473,32 @@ class Platform : public PluginInterface {
                       LLVM_PRETTY_FUNCTION, GetName()));
   }
 
+  /// Search CU for the SDK path the CUs was compiled against.
+  ///
+  /// \param[in] unit The CU
+  ///
+  /// \returns If successful, returns a parsed XcodeSDK object.
+  virtual llvm::Expected<XcodeSDK> GetSDKPathFromDebugInfo(CompileUnit &unit) {
+    return llvm::createStringError(
+        llvm::formatv("{0} not implemented for '{1}' platform.",
+                      LLVM_PRETTY_FUNCTION, GetName()));
+  }
+
+  /// Returns the full path of the most appropriate SDK for the
+  /// specified compile unit. This function gets this path by parsing
+  /// debug-info (see \ref `GetSDKPathFromDebugInfo`).
+  ///
+  /// \param[in] unit The CU to scan.
+  ///
+  /// \returns If successful, returns the full path to an
+  ///          Xcode SDK.
+  virtual llvm::Expected<std::string>
----------------
JDevlieghere wrote:

Ok, consistency wins then. 

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


More information about the lldb-commits mailing list