Skip to content

Commit 8da8de9

Browse files
authored
debugging docs: mention \n for printf-debugging (#13437)
1 parent 4eb1175 commit 8da8de9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,4 @@ a license to everyone to use it as detailed in LICENSE.)
542542
* Patric Stout <[email protected]>
543543
* Jinoh Kang <[email protected]>
544544
* Jorge Prendes <[email protected]>
545+
* Alexey Shamrin <[email protected]>

site/source/docs/porting/Debugging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ the sub-command that it runs as well as passes ``-v`` to Clang.
129129
Manual print debugging
130130
======================
131131

132-
You can also manually instrument the source code with ``printf()`` statements, then compile and run the code to investigate issues.
132+
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.
133133

134134
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`).
135135

0 commit comments

Comments
 (0)