The state of debugging c++

48 views
Skip to first unread message

adam crockett

unread,
Jul 3, 2019, 6:47:56 PM7/3/19
to emscripten-discuss
Thanks everyone, firstly I have searched high and low for a definitive answer but have not found anything credible.

Is it possible to place breakpoints in <insert_ide_name> here and have a process (I don't know what) attach so that a developer can debug the c/c++ portion of the code?

My use case:
Target: node 8^
Editor: vscode

Have you managed it, what is your editor of choice and may you share the steps.

adam crockett

unread,
Jul 3, 2019, 6:50:41 PM7/3/19
to emscripten-discuss
To clarify this is regarding emscripten and not generally c++

Alon Zakai

unread,
Jul 9, 2019, 8:00:24 PM7/9/19
to emscripte...@googlegroups.com
Source maps are the closest thing currently: build with -g4, load in a browser's devtools, and you should see the original C++ source code, and can place breakpoints. However, variable names don't work. That will need something more like DWARF, which people are currently working on.


--
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 emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/491e84c9-7920-4b30-ad34-4b90df381e10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Floh

unread,
Jul 10, 2019, 4:52:14 AM7/10/19
to emscripten-discuss
The best debugging workflow is still to create a native build of your code and debug that in a "traditional" debugger.

It's far from perfect, but since most source code should be platform-agnostic, and assuming that bugs are evenly distributed, it works pretty well in most real-world debugging situations.

For emscripten-specific code, fall back to "printf-debugging".

Making this whole process of working with native and cross-compiled build targets easier was one important reason why I created fips: http://floooh.github.io/fips/

Cheers,
-Floh.
Reply all
Reply to author
Forward
0 new messages