From bf62cdd4f3576e48405537f7d1056ffea1b542c2 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Sun, 8 Oct 2023 13:22:23 +0200 Subject: [PATCH] Update debugging notes --- build.sh | 8 ++------ src/CMakeLists.txt | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/build.sh b/build.sh index 98c6ac04b..bcf34692d 100755 --- a/build.sh +++ b/build.sh @@ -98,15 +98,11 @@ for arg in SIMD WASM_BIGINT JXL AVIF SVG MODULES BINDINGS; do done # Handy for debugging -#export CFLAGS="-O0 -gsource-map -pthread" -#export CXXFLAGS="$CFLAGS" -#export LDFLAGS="-L$TARGET/lib -O0 -gsource-map" +#COMMON_FLAGS="-Og -gsource-map -pthread" #export EMCC_DEBUG=1 # Handy for catching bugs -#export CFLAGS="-Os -gsource-map -fsanitize=address -pthread" -#export CXXFLAGS="$CFLAGS" -#export LDFLAGS="-L$TARGET/lib -Os -gsource-map -fsanitize=address -sINITIAL_MEMORY=64MB" +#COMMON_FLAGS="-Os -gsource-map -fsanitize=address -pthread" # Specify location where source maps are published (browser specific) #export LDFLAGS+=" --source-map-base http://localhost:3000/lib/" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b854d3b54..975f4c10a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,15 +98,16 @@ set(MAIN_COMPILE_OPTIONS ) # Handy for debugging -# --threadprofiler \ -# -sSAFE_HEAP \ -# -sSTACK_OVERFLOW_CHECK=2 \ -# -sDISABLE_EXCEPTION_CATCHING=0 \ -# -sASSERTIONS=2 \ -# -sPTHREADS_DEBUG \ -# -sLIBRARY_DEBUG \ -# -sSYSCALL_DEBUG \ -# -sDYLINK_DEBUG \ +# --threadprofiler +# -sSAFE_HEAP +# -sASSERTIONS=2 +# -sCHECK_NULL_WRITES=0 +# -sPTHREADS_DEBUG +# -sDYLINK_DEBUG +# -sLIBRARY_DEBUG +# -sEXCEPTION_DEBUG +# -sSYSCALL_DEBUG +# -sDYLINK_DEBUG # note 1: `ALLOW_MEMORY_GROWTH` may run non-wasm code slowly. See: https://github.com/WebAssembly/design/issues/1271. # note 2: Browsers appear to limit the maximum initial memory size to 1GB, set `INITIAL_MEMORY` accordingly.