You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: read command output from a UTF-16 log on multibyte code pages
On a multibyte system code page (Chinese 936, Japanese 932, Korean 949, or the
"Use Unicode UTF-8" setting 65001) the debugger truncates its text output over
a pipe: it writes each line's character count as a byte count, so the tail of
any line with non-ASCII text, its newline included, is dropped. This lost the
end of du strings and other Unicode output, and a line cut in the middle of a
character wedged the session. It affects every command, not just du, and no
debugger output mode over the pipe avoids it.
.logopen /u writes a UTF-16 log that is complete and flushes per command. So on
a multibyte code page the session now opens such a log at startup and reads
each command's output from it, keyed by the same .echo markers the pipe already
uses to synchronize. The pipe stays the control channel; only the returned
content comes from the log. Single-byte code pages (e.g. Western 1252), where
the pipe is lossless, are detected via GetCPInfo and keep the pipe path,
byte-for-byte unchanged.
The pipe is also decoded with the debugger's own ANSI code page and with
errors="replace", so a multibyte sequence split across reads cannot raise in
the reader thread on the paths that still read the pipe (a live target's
asynchronous output).
Verified on a Windows 11 VM with cdb 10.0.26100.1742 under code pages 1252
(passthrough), 936 and 65001 (all commands return complete Unicode). Fixes#102.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,12 @@ All notable changes to the MCP Server for WinDbg Crash Analysis project will be
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [Unreleased]
9
+
10
+
### Fixed
11
+
12
+
-**Unicode command output on Chinese, Japanese and Korean Windows** ([#102](https://github.com/svnscha/mcp-windbg/issues/102)) - on a multibyte system code page (936, 932, 949, or the "Use Unicode UTF-8" setting 65001) the debugger truncates its text output over a pipe, dropping the tail of any line that contains non-ASCII text; a `du` of a Chinese string came back empty or partial, other Unicode output was cut short, and a line split in the middle of a character could leave the session unresponsive. On these code pages the session now mirrors output to a UTF-16 log and reads each command's output from it, keyed by the markers it already uses to synchronize; the result is complete for every command. Single-byte code pages (such as Western 1252), where the pipe is lossless, are detected and left on the pipe path unchanged.
0 commit comments