LLTP, but VSCode now has WASM DWARF debugging support, and I just confirmed 
that it works for Emscripten's node.js output.

First install this VSCode extension:

https://marketplace.visualstudio.com/items?itemName=ms-vscode.wasm-dwarf-debugging

...then...

emcc hello.c -o hello.js -g

...open the directory in VSCode, open hello.js, set a breakpoint at a point 
where the WASM has been loaded (e.g. in the JS function "callMain()").

Press F5 to run hello.js in the debugger, it should stop at that breakpoint 
in callMain().

Next open hello.c, set a breakpoint in the C code. Continue debugging. It 
should stop now at the breakpoint in the C code.

Voila :)

[image: Screenshot 2023-11-08 at 11.56.42.png]

...with a bit more tinkering this even works with WASM running in Chrome :)
On Saturday, 12 August 2023 at 15:50:42 UTC+2 Mike Lischke wrote:

>
>> Is there some way you could make/share a minimal repro case?
>>
>>
>> I can try, but what I'd really need is a way to debug the C++ code. 
>> Otherwise it becomes a pretty frustrating trial and error experience, which 
>> costs a lot of time.
>>
>
> If you need real debugging, have you tried the chrome DWARF debugger 
> extension: https://developer.chrome.com/blog/wasm-debugging-2020/?   As 
> far as I know that is the only way to get a real debugging experience with 
> webassembly on the web today.   
>  
>
>
> This is probably one of my next steps, though this is really a Node.js, 
> not a web app, which means I have to strip out the Node.js stuff for 
> debugging. Weird that there's no wasm debugger for VS Code yet. There are a 
> number of wasm extensions, but they all more or less provide wasm syntax 
> highlighting, nothing else. Maybe at some later time...
>
> Mike
> -- 
> www.soft-gems.net 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/45ae0ff7-2396-436c-b974-da55d2b6499en%40googlegroups.com.

Reply via email to