diff options
| author | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-23 01:59:12 +0300 |
|---|---|---|
| committer | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-23 01:59:12 +0300 |
| commit | 3ac0ee5f34c41b60bb916c4ae2634acafe3b6d17 (patch) | |
| tree | c599d30388fb0c2645111ba804401189f56b9110 /runtime/shims/process.cpp | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
startup trace: log OutputDebugStringW once, not again as its lossy ANSI fallback
With no debugger attached, OutputDebugStringW raises DBG_PRINTEXCEPTION_WIDE_C and, when nothing
handles it, calls OutputDebugStringA on its own ANSI copy of the text, which raises
DBG_PRINTEXCEPTION_C. The trace handler logged both, so every wide debug line appeared twice, the
second one lossy (characters outside the ANSI code page became "?").
Remember the wide exception's ANSI pointer (ExceptionInformation[3]) in a thread_local and skip the
ANSI exception whose string pointer ([1]) matches it. Every debug string on the thread resets the
marker, so only the exception right after the wide one is ever skipped and a later
OutputDebugStringA is still logged. startup_trace_test checks one UTF-8 line for a non-ASCII
OutputDebugStringW and that the OutputDebugStringA after it is still there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/process.cpp')
0 files changed, 0 insertions, 0 deletions