The DAP "source" request tells gdb to send the text of a source file. This would be handy for the scenario where an IDE launches gdb on some remote machine. To implement this, we'd need to fix up a couple of spots that specify "sourceReference": 0, and also at least one spot (loadedSources request) that doesn't specify this at all. We'd probably also need a Python API to something like find_and_open_source.
I went ahead and implemented this.
https://sourceware.org/pipermail/gdb-patches/2023-July/201207.html
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=13bd1a9175962980a3b0f1c0598698858c72fc04 commit 13bd1a9175962980a3b0f1c0598698858c72fc04 Author: Tom Tromey <tromey@adacore.com> Date: Thu Jul 27 14:27:05 2023 -0600 Implement DAP "source" request This implements the DAP "source" request. I renamed the "loadedSources" function from "sources" to "loaded_sources" to avoid any confusion. I also moved the loadedSources test to the new sources.exp. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30691
Fixed.