Bug 30691 - Implement "source" request
Summary: Implement "source" request
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: dap (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 14.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-27 17:09 UTC by Tom Tromey
Modified: 2023-08-01 19:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2023-07-27 17:09:15 UTC
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.
Comment 1 Tom Tromey 2023-07-27 20:27:20 UTC
I went ahead and implemented this.
Comment 3 Sourceware Commits 2023-08-01 19:15:56 UTC
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
Comment 4 Tom Tromey 2023-08-01 19:16:43 UTC
Fixed.