Skip to content

Failed to map Rust stdlib sources when debugging in Windows #18782

Open
@inflation

Description

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rust-analyzer version: 0.3.2228-standalone (fa4a40bbe8 2024-12-22)

rustc version: (eg. output of rustc -V)

rustc 1.83.0 (90b35a623 2024-11-26)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)

vscode 0.3.2228

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

repository link (if public, optional): (eg. rust-analyzer)

code snippet to reproduce:

// add your code here

When debugging anything on Windows using cppvspkg, the sourceMap output in Debug console failed to map to rust src:

  "sourceFileMap": {
    "D:\\packages\\rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust": "D:\\packages\\rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust"
  },

It should be

      "sourceFileMap": {
        "\\rustc\\90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\\": "D:\\packages\\rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust\\"
      }

Manually setting it in launch.json works fine.

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions