Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support source maps between editor and debugger file paths #1030

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 1, 2023

  1. Support source maps between editor and debugger file paths

    When nvim-dap is running on a separate machine from the debugger then
    Nvim and the debugger will use different paths for source files. For
    example, if Nvim is running on a machine where the source tree is
    located at /a/project/foo and the debugger is running on a separate
    machine where the source tree is located at /b/project/foo, when
    nvim-dap tries to set a breakpoint it will use /a/project/foo/ in the
    breakpoint location. When the debugger receives this request it will not
    set the breakpoint correctly because the debugger does not have any
    files at /a/project/foo.
    
    The source_map option instructs nvim-dap to convert paths as seen by the
    editor and nvim-dap itself to the paths as the debugger sees them. The
    opposite mapping takes place when nvim-dap receives stack frame or
    source file information from the debugger.
    
    Note that this is different than the "source map" option provided by
    many debuggers themselves (such as codelldb's "sourceMap" option or
    GDB's "substitute-path" setting). Those options convert _compiled_
    source paths (i.e. the path of the source file when the binary was
    compiled) into the debugger's path namespace (/b/project/foo in our
    example).
    gpanders committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    5120f69 View commit details
    Browse the repository at this point in the history