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

DWARF debugger fails to resolve source tree #23642

Closed
Minterl opened this issue Feb 10, 2025 · 7 comments
Closed

DWARF debugger fails to resolve source tree #23642

Minterl opened this issue Feb 10, 2025 · 7 comments

Comments

@Minterl
Copy link

Minterl commented Feb 10, 2025

I can't say confidently whether this should be in this issue tracker or not but in light of #13486, I will post it here.
When I try to use the DWARF debugger extension (https://chromewebstore.google.com/detail/cc++-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb), I get the below console output.

Image

This is my source tree:

Image

This is a sample from the output of a wasm-objdump on the .debug_line section of the binary.

0418198: 2f75 7073 7472 6561 6d2f 656d 7363 7269  /upstream/emscri
04181a8: 7074 656e 2f63 6163 6865 2f73 7973 726f  pten/cache/sysro
04181b8: 6f74 2f69 6e63 6c75 6465 2f63 2b2b 2f76  ot/include/c++/v
04181c8: 312f 5f5f 6368 726f 6e6f 0000 7372 632f  1/__chrono..src/
04181d8: 6370 702f 6261 636b 656e 642d 7765 6267  cpp/backend-webg
04181e8: 7075 2f61 6461 7074 6572 2e63 7070 0001  pu/adapter.cpp..
04181f8: 0000 616c 6c74 7970 6573 2e68 0002 0000  ..alltypes.h....
0418208: 6461 7461 7369 7a65 6f66 2e68 0003 0000  datasizeof.h....
0418218: 7374 7269 6e67 0004 0000 666f 726d 6174  string....format
0418228: 5f66 756e 6374 696f 6e73 2e68 0005 0000  _functions.h....
0418238: 666f 726d 6174 5f73 7472 696e 672e 6800  format_string.h.

This is the beginning of that section.

0417ae8: 0b2e 6465 6275 675f 6c69 6e65 d7fc 0100  ..debug_line....
0417af8: 0400 6e10 0000 0101 01fb 0e0d 0001 0101  ..n.............
0417b08: 0100 0000 0100 0001 2f68 6f6d 652f 6d69  ......../home/mi
0417b18: 6b65 2f72 6570 6f2f 706f 7274 666f 6c69  ke/repo/portfoli
0417b28: 6f2d 3364 002f 7573 722f 6c6f 6361 6c2f  o-3d./usr/local/
0417b38: 7374 6f77 2f65 6d73 646b 2f75 7073 7472  stow/emsdk/upstr
0417b48: 6561 6d2f 656d 7363 7269 7074 656e 2f63  eam/emscripten/c
0417b58: 6163 6865 2f73 7973 726f 6f74 2f69 6e63  ache/sysroot/inc
{
  "directory": "/home/mike/repo/portfolio-3d/build",
  "command": "/usr/local/stow/emsdk/upstream/emscripten/em++  @CMakeFiles/portfolio-3d.dir/includes_CXX.rsp -g -std=gnu++20 -o CMakeFiles/portfolio-3d.dir/src/cpp/backend-webgpu/adapter.cpp.o -c /home/mike/repo/portfolio-3d/src/cpp/backend-webgpu/adapter.cpp",
  "file": "/home/mike/repo/portfolio-3d/src/cpp/backend-webgpu/adapter.cpp",
  "output": "CMakeFiles/portfolio-3d.dir/src/cpp/backend-webgpu/adapter.cpp.o"
}

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.2 (7591f1c5ea0adf6f4293cfba2995ee9700aa0d93)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 9534d27e3321a3b9e6e79fe6328445575bf26b7b)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /usr/local/stow/emsdk/upstream/bin
@Minterl Minterl changed the title DWARF Debugger Fails to Resolve Source Tree DWARF debugger fails to resolve source tree Feb 10, 2025
@TriceHelix
Copy link

I'm getting the same console logs and can't figure out the root of the issue. I've tried different versions of emsdk (including versions older than 4.0) and even used emrun with a build of Chrome 131 (which used to work just fine). Not even the simplest "Hello, World!" executable's symbols are loaded. Really strange.

@kripken
Copy link
Member

kripken commented Feb 11, 2025

cc @pfaffe

@pfaffe , is there a proper place to report DWARF debugger issues like this?

@sbc100
Copy link
Collaborator

sbc100 commented Feb 11, 2025

Can you share the full set of link flags you are using?

@Minterl
Copy link
Author

Minterl commented Feb 11, 2025

Can you share the full set of link flags you are using?

@sbc100

-sALLOW_MEMORY_GROWTH -sASSERTIONS -sASYNCIFY -sUSE_WEBGPU -sEXPORTED_RUNTIME_METHODS=[WebGPU]

@Minterl
Copy link
Author

Minterl commented Feb 11, 2025

This the version of Chrome I'm using if that helps:

Google Chrome 135.0.6999.0 canary

@pfaffe
Copy link
Collaborator

pfaffe commented Feb 12, 2025

Generally speaking if the issue is a bug in the debugger and not the toolchain bugs should go on crbug.com against the Chromium > Platform > DevTools > WebAssembly component.

There's a known regression in Chrome 133, it's fixed in Canary (135.0.7001.0) and Beta (134, yet to be released).

@sasmaster
Copy link

sasmaster commented Feb 17, 2025

I am hitting this one as well. A week ago all worked fine. My Chrome version is

133.0.6943.99

After installing 134 Beta the issue was gone.

@Minterl Minterl closed this as completed Feb 22, 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

No branches or pull requests

6 participants