Skip to content

Improve automated path mapping in dlv debug adapter #3193

Open
@suzmue

Description

@suzmue

Is your feature request related to a problem? Please describe.

The legacy debug adapter implemented some support for automatic path mapping (#45). We want to deprecate the legacy debug adapter so should provide some automatic path mapping, which will likely take a different form than the legacy.

dlv dap uses the substitutePath setting in the launch.json attributes to configure mappings when the local and debugger paths do not match (such as with symlinked dirs, remote debugging, trimpath).

A lot of times users don’t know that they have to provide path mapping for the breakpoints to hit. Even if they do, they don’t provide the correct path mappings. So what happens is that the debugger appears to be running but no breakpoints are hit. This can cause a lot of confusion to the users.

Describe the solution you'd like
We can use the local configuration of the main modules, module cache, and GOROOT, to help automate this configuration.

This will need implementation work in github.com/go-delve/delve to do the mapping and modifications to the extension to provide the necessary data from the client.

Additional context
Related issues include #3175, #45

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugIssues related to the debugging functionality of the extension.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions