Skip to content

Conversation

@CPunisher
Copy link

@CPunisher CPunisher commented Mar 21, 2025

Issue microsoft/vscode-dwarf-debugging-ext#7 gives a solution of path substitutions in browser. But it doesn't work when debugging webassembly in nodejs. I wonder why we cannot directly add a configuration. Here it is.

Docs and descriptions come from the jsdocs in @vscode/dwarf-debugging/chrome-cxx/mnt/extension/ModuleConfiguration

@CPunisher
Copy link
Author

@microsoft-github-policy-service agree

@CPunisher
Copy link
Author

CPunisher commented Mar 21, 2025

I think we can also merge the configuration into enableDWARF: boolean | ModuleConfigurations

@connor4312
Copy link
Member

sourceMapPathOverrides should work for Node.js just as well as the browser. We don't rely on any special path mapping done by the dwarf module (and I wouldn't really want to add an extra way to map paths) and instead pass the path through the normal path mapping logic (ISourcePathResolver.urlToAbsolutePath)

@CPunisher
Copy link
Author

CPunisher commented Mar 22, 2025

sourceMapPathOverrides should work for Node.js just as well as the browser. We don't rely on any special path mapping done by the dwarf module (and I wouldn't really want to add an extra way to map paths) and instead pass the path through the normal path mapping logic (ISourcePathResolver.urlToAbsolutePath)

I agree that it's good to keep only one way to map paths. I should appologize for my inaccurate statement:

But it doesn't work when debugging webassembly in nodejs

Let me clarify my issue. There is actually a bug in the C/C++ DevTools Support (DWARF) chrome extension. A temporary solution is adding path substitutions in extension options, so I'd like to do the same thing in vscode.

I have tried to add sourceMapPathOverrides, but after debugging I find that the dwarf symbol url isn't handled by NodeSourcePathResolver.urlToAbsolutePath. So I wonder there are some cases that urlToAbsolutePath can't do but path substitution can when it comes to dwarf symbol resolution.

connor4312 added a commit that referenced this pull request Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants