================
@@ -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);
----------------
ashgti 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?

Or we could move the actual address info into the `adapterData` field and then 
we don't need to track the address in the DAP, we'd just need to have some way 
of hashing the address into a unique `sourceReference`.

https://github.com/llvm/llvm-project/pull/144364
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to