[Lldb-commits] [lldb] [lldb-dap] Fix source references (PR #144364)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 16 11:17:19 PDT 2025


================
@@ -37,10 +37,15 @@ protocol::Source CreateSource(const lldb::SBFileSpec &file);
 /// \param[in] target
 ///     The target that has the address.
 ///
+/// \param[in] create_reference
+///     function used to create a source_reference
+///
 /// \return
-///     A "Source" JSON object that follows the formal JSON
+///     An optional "Source" JSON object that follows the formal JSON
 ///     definition outlined by Microsoft.
-protocol::Source CreateSource(lldb::SBAddress address, lldb::SBTarget &target);
+std::optional<protocol::Source>
+CreateSource(lldb::SBAddress address, lldb::SBTarget &target,
+             llvm::function_ref<int32_t(lldb::addr_t)> create_reference);
----------------
da-viper wrote:

> Should we move this into the DAP? Something like optional<Source> DAP::ResolveSource(SBAddress, SBTarget); that creates or returns a source for the given address?

I am leaning towards this because there may be clients that do not support the optional `source`  argument in `SourceRequest`

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


More information about the lldb-commits mailing list