building DWARF debug info into skia webassembly

43 views
Skip to first unread message

craste...@gmail.com

unread,
Apr 27, 2021, 10:15:03 AM4/27/21
to skia-discuss
I need to debug something in webassembly, so I need to rebuild skia with DWARF debug support.   How do I launch the compile shell script with parameters that would build a debug version that includes dwarf?

Mike Klein

unread,
Apr 27, 2021, 10:35:05 AM4/27/21
to skia-discuss
Is -g3 enough?  If so, try a debug build?

if [[ $@ == *debug* ]]; then

  echo "Building a Debug build"

  EXTRA_CFLAGS="\"-DSK_DEBUG\","

  RELEASE_CONF="-O0 --js-opts 0 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g3 \

                --source-map-base /node_modules/canvaskit/bin/ -DSK_DEBUG --pre-js $BASE_DIR/debug.js"

  BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm_debug"}




On Tue, Apr 27, 2021 at 9:15 AM craste...@gmail.com <craste...@gmail.com> wrote:
I need to debug something in webassembly, so I need to rebuild skia with DWARF debug support.   How do I launch the compile shell script with parameters that would build a debug version that includes dwarf?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/96509e43-b765-48cb-933b-958562c8bec7n%40googlegroups.com.

craste...@gmail.com

unread,
Apr 27, 2021, 10:38:57 AM4/27/21
to skia-discuss
I can try.  So, what would the exact command line be?  "./compile.sh -g3" ?  Would there be additional parameters for debug info?

Mike Klein

unread,
Apr 27, 2021, 10:45:23 AM4/27/21
to skia-discuss
The $@ == *debug* bit there is shell for "if the word 'debug' is anywhere on the command line."  Try 

  $ modules/canvaskit/compile.sh debug

craste...@gmail.com

unread,
Apr 27, 2021, 11:02:38 AM4/27/21
to skia-discuss
Okay.  But how do I get the -g3 parameter included?

Mike Klein

unread,
Apr 27, 2021, 11:08:13 AM4/27/21
to skia-discuss
Running compile.sh with debug on the command line will include the -g3 parameter.

It might help you to understand if you read compile.sh, at least the snippet I quoted earlier.

Reply all
Reply to author
Forward
0 new messages