microsoft / microsoft/vscode-dwarf-debugging

How to sourceMapPathOverrides

Open
#9 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
6
Avg merge
8h
Merged PRs (30d)
1

Description

I am using docker to build a debug version of a wasm program, which makes the DWARF information contain file paths as used inside the docker container fs.

How can I use sourceMapPathOverrides to point to the right sources?

I have tried:

// in .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        "type": "node",
        "request": "launch",
        "name": "Debug Current Test File",
        "autoAttachChildProcesses": true,
        "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
        "program": "${workspaceRoot}myproj/node_modules/vitest/vitest.mjs",
        "runtimeArgs": ["--preserve-symlinks"],
        "sourceMapPathOverrides": {
          "file:///workspace/*": "${workspaceFolder}/ccode/*",
        }
}

What does work is making a symlink /workspace -> ${workspaceFolder}/ccode

Basically I am looking for path substitutions like: https://developer.chrome.com/docs/devtools/wasm#map-path

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the .vscode/launch.json configuration and the sourceMapPathOverrides setting, then compare its behavior with the linked Chrome DevTools WebAssembly path-mapping documentation. Reproduce the Docker-built debug case and verify whether container paths such as file:///workspace/* resolve to local sources without the /workspace symlink.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, vscode, wasm
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.