================ @@ -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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits