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

Path substitutions? #7

Closed
fraguada opened this issue Jul 15, 2024 · 7 comments · Fixed by microsoft/vscode-js-debug#2109
Closed

Path substitutions? #7

fraguada opened this issue Jul 15, 2024 · 7 comments · Fixed by microsoft/vscode-js-debug#2109
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@fraguada
Copy link

In the Chrome Dev tools extension I can use Path substitutions to map from the prefix in the wasm file to where the actual source files are on my hard drive. this works great in the Chrome extension. I can build locally or on our automated runners and map the wasm to the source files.

Does such a feature exist with the vs code extension?

@trzeciak
Copy link

I would like that too.

I tried with sourceMapPathOverrides settings in launch configuration, but without any successed.

I compile my C++ code with flag: "-fdebug-compilation-dir=/root" (It is required, because my build system is a bazel with sandboxing),
and I want to map /root to "${workspaceFolder}".

cc: @connor4312

@connor4312
Copy link
Member

sourceMapPathOverrides should work but I admit it's been a moment since I tested it with DWARF stuff.

Can you add trace: true to your launch.json config and share the log file (location written to the Debug Console) here or to connor [at] xbox.com? Thanks!

@trzeciak
Copy link

Hey, I wasn't sure if this project was alive xD, but now that I know!
I'll try to prepare a working (or rather not working xD) example that should be easy to reproduce locally, I'll do my best to prepare it this weekend.

@trzeciak
Copy link

trzeciak commented Oct 3, 2024

Finally.. xD
I prepared small example: https://github.com/trzeciak/vscode-debugging-webapp-wasm

Motivation:
In the target project I'm working on, we use Bazel with the sandboxing to build C++,
so for debugging symbols to be useful we need to set the option -fdebug-compilation-dir=<some-root-pach> in clang (or equivalent option).
On the other hand, we build builds on CI, so we chose a common root folder, e.g.: /ciroot.
Let me know if you can repeat this in the prepared example, if not I will send my logs.
BTW: I working on macOS.

If I using C/C++ DevTools Support (DWARF) in google chrome, and setup Path substitutions in extension-options, the breakpoints in tevtools works correctly with /ciroot path.

@trzeciak
Copy link

@connor4312 : Any suggestions, or maybe I should ask this question somewhere else?

@connor4312
Copy link
Member

Thanks for the repro, fixed in the next nightly. The source map path override "file:///ciroot/*": "${workspaceFolder}/*", will work.

@trzeciak
Copy link

Thank you, I tested it and it works!

@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug verified Verification succeeded labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants