From 6cb1cdef511c49cc7f991e44a261f1614d4edb6d Mon Sep 17 00:00:00 2001 From: Carl Woffenden Date: Mon, 26 Feb 2024 18:25:36 +0100 Subject: [PATCH 1/2] Remove DEMANGLE_SUPPORT from docs (deprecated as of Emscripten 3.1.54) --- site/source/docs/porting/Debugging.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/site/source/docs/porting/Debugging.rst b/site/source/docs/porting/Debugging.rst index b249e19d0732..45c3cfe561f2 100644 --- a/site/source/docs/porting/Debugging.rst +++ b/site/source/docs/porting/Debugging.rst @@ -137,11 +137,6 @@ Some important settings are: performance. Default value is 1 if ``ASSERTIONS=1`` is set, and disabled otherwise. - - - .. _debugging-DEMANGLE_SUPPORT: - - ``DEMANGLE_SUPPORT=1`` links in code to automatically demangle stack traces, that is, emit human-readable C++ function names instead of ``_ZN..`` ones. - A number of other useful debug settings are defined in `src/settings.js `_. For more information, search that file for the keywords "check" and "debug". .. _debugging-sanitizers: @@ -166,7 +161,7 @@ Manual print debugging You can also manually instrument the source code with ``printf()`` statements, then compile and run the code to investigate issues. Note that ``printf()`` is line-buffered, make sure to add ``\n`` to see output in the console. -If you have a good idea of the problem line you can add ``print(new Error().stack)`` to the JavaScript to get a stack trace at that point. Also available is :js:func:`stackTrace`, which emits a stack trace and also tries to demangle C++ function names if ``DEMANGLE_SUPPORT`` is enabled (if you don't want or need C++ demangling in a specific stack trace, you can call :js:func:`jsStackTrace`). +If you have a good idea of the problem line you can add ``print(new Error().stack)`` to the JavaScript to get a stack trace at that point. Also available is :js:func:`stackTrace`, which emits stack trace with any extra details available (alternatively call :js:func:`jsStackTrace` to get just the stack trace). Debug printouts can even execute arbitrary JavaScript. For example:: From 93e835219426ea78d9319d07530486872c1bafe9 Mon Sep 17 00:00:00 2001 From: Carl Woffenden Date: Mon, 26 Feb 2024 19:22:34 +0100 Subject: [PATCH 2/2] Removed both alternate JS calls --- site/source/docs/porting/Debugging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/source/docs/porting/Debugging.rst b/site/source/docs/porting/Debugging.rst index 45c3cfe561f2..3a7c3b67bfbe 100644 --- a/site/source/docs/porting/Debugging.rst +++ b/site/source/docs/porting/Debugging.rst @@ -161,7 +161,7 @@ Manual print debugging You can also manually instrument the source code with ``printf()`` statements, then compile and run the code to investigate issues. Note that ``printf()`` is line-buffered, make sure to add ``\n`` to see output in the console. -If you have a good idea of the problem line you can add ``print(new Error().stack)`` to the JavaScript to get a stack trace at that point. Also available is :js:func:`stackTrace`, which emits stack trace with any extra details available (alternatively call :js:func:`jsStackTrace` to get just the stack trace). +If you have a good idea of the problem line you can add ``print(new Error().stack)`` to the JavaScript to get a stack trace at that point. Debug printouts can even execute arbitrary JavaScript. For example::