From bf60f821b17fbc7df966a779d84edd602a762a23 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 3 May 2026 17:22:27 -0700 Subject: [PATCH] debug-server: always-on wtrace on shell COPY/DELETE sub-state 0x80066BC0 Adds 0x66BC0..0x66BD0 to the always-on wtrace ranges. Used to find that the freeze on COPY click in BIOS shell memcard menu happens because: - shell state-machine index at mem[0x80078320] advances to 7 - state-7 struct at 0x80113C80 has handler=0x800321BC (RAM, non-null) and input_mask=0x00F000F0 (D-pad bits only) - non-D-pad buttons (CROSS/CIRCLE/TRIANGLE) are masked out in this state, and the D-pad handler at 0x800321BC never advances state Memo follows separately. This commit is purely the diagnostic addition so the wtrace coverage is in master for future repro. Co-Authored-By: Claude Opus 4.7 (1M context) --- runtime/src/debug_server.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index c14c9ab2..e407744a 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -3201,7 +3201,14 @@ void debug_server_init(int port) * error path) and which PC sets the failure flag. */ s_wtrace_ranges[13].lo = 0x0000B9D0u; s_wtrace_ranges[13].hi = 0x0000B9F0u; - s_wtrace_range_count = 14; + /* Shell COPY/DELETE/LOAD_DIR sub-state at 0x80066BC0. CIRCLE→7=LOAD_DIR, + * CROSS→4=COPY-related, TRIANGLE→0=cleared, 6=DELETE. After clicking + * COPY, BIOS got stuck at BC0=4 with NO further input transitions — + * likely waiting for a card op completion that never fires. Track every + * writer to identify the BIOS function driving this sub-state. */ + s_wtrace_ranges[14].lo = 0x00066BC0u; + s_wtrace_ranges[14].hi = 0x00066BD0u; + s_wtrace_range_count = 15; /* Tier 1: heap-allocate MMIO trace ring buffer (2 MB). */ if (!s_mmio_trace) {