C++ WASM breakpoints not hitting in Chrome DevTools (Emscripten 3.1.12)

1 week ago 4
ARTICLE AD BOX

I’m debugging C++ compiled to WebAssembly using Emscripten 3.1.12, running in Chrome and trying to debug the C++ code of my web extension which has C++ backend.

env.AppendUnique( CCFLAGS = ['-Wall', '-Wunknown-pragmas', '-O0', '-g'], CXXFLAGS = ['-O0', '-g'], LINKFLAGS = [ '-gsource-map', '--source-map-base=http:/wasm/' ] )

and the .wasm.map file loads correctly in chrome devtools.

What works:

- C++ source files appear in Chrome DevTools sources tab.

- The C++ code definitely executes (verified with printf logs in console)

- WASM loads correctly

Problem:

- some lines in C++ files are greyed out (cannot set breakpoints there)

- Breakpoints dont hit when i launch the web extension.

- Reloading and re-triggering the WASM does not pause execution

Question:

Is this a known limitation with Emscripten 3.1.12 or Chrome WASM debugging?

What flags or Emscripten version are required for reliable C++ breakpoints in Chrome DevTools?
Am i missing anything here?

Read Entire Article