Skip to content

Commit c43ec5f

Browse files
dschojon-turney
authored andcommitted
Cygwin: devdoc: Mention the extremely useful small_printf() function
This function came in real handy many, many times over the year whenever I needed to debug any issues with the MSYS2/Cygwin runtime, first instance was while debugging an issue that strace 'fixed'. However, this function was not mentioned anywhere I looked, so it took me a good while to find out about it. Let's improve on that situation by mentioning it explicitly in the documentation about debugging the runtime. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent bec497d commit c43ec5f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

winsup/cygwin/DevDocs/how-to-debug-cygwin.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,14 @@ set CYGWIN_DEBUG=cat.exe:gdb.exe
126126
program will crash, probably in small_printf. At that point, a 'bt'
127127
command should show you the offending call to strace_printf with the
128128
improper format string.
129+
130+
9. Debug output without strace
131+
132+
If you cannot use gdb, or if the program behaves differently using strace
133+
for whatever reason, you can still use the small_printf() function to
134+
output debugging messages directly to stderr.
135+
136+
This function accepts slightly different format placeholders than the
137+
POSIX printf() function you're used to, for example `%W` instead of `%ls`
138+
to print UTF-16 strings (provided via `wchar_t *` pointers). For full
139+
details, see the first comment in `winsup/cygwin/smallprint.cc`.

0 commit comments

Comments
 (0)