[Lldb-commits] [lldb] [lldb] Add ScriptedSymbolLocator plugin for source file resolution (PR #181334)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 13 19:32:52 PST 2026


================
@@ -172,6 +172,31 @@ ScriptInterpreter::GetOpaqueTypeFromSBValue(const lldb::SBValue &value) const {
   return locker.GetLockedSP(*value.m_opaque_sp);
 }
 
+FileSpec ScriptInterpreter::GetOpaqueTypeFromSBFileSpec(
+    const lldb::SBFileSpec &file_spec) const {
+  if (file_spec.m_opaque_up)
+    return *file_spec.m_opaque_up;
+  return {};
+}
+
+ModuleSpec ScriptInterpreter::GetOpaqueTypeFromSBModuleSpec(
+    const lldb::SBModuleSpec &module_spec) const {
+  if (module_spec.m_opaque_up)
+    return *module_spec.m_opaque_up;
+  return {};
+}
----------------
medismailben wrote:

nit: Since `FileSpec` & `ModuleSpec` don't have a `IsValid` method, I'd return a `std::optional<FileSpec>` & `std::optional<ModuleSpec>` here.

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


More information about the lldb-commits mailing list