Commit Graph
8 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Sonnet 5 0c63905095 Debugger: report dropped messages when the log broadcaster's ring buffer overflows
DebuggerLogListener buffers up to 1024 log messages between polls of the
WebSocket event loop (up to 1000Hz under high activity, 60Hz otherwise -
see WebSocket.cpp). A source that logs faster than that - a log-only
breakpoint hit thousands of times in a tight loop is a real example, not
hypothetical, see docs/VSHBootInvestigation.md's Attempt 22/24 - can wrap
the ring buffer before GetMessages() ever reads the oldest entries,
silently losing them. From the client's side this was indistinguishable
from the breakpoint just not firing at all, which cost real debugging time
this session tracking down a red herring before finding the real
mechanism.

GetMessages() already detected the overflow case internally (the
`read_ + BUFFER_SIZE < count_` branch) to avoid returning garbage, but
never reported how many messages were actually lost. Now synthesizes a
warning LogMessage ("N log message(s) dropped - client polling too slow
for this volume") and prepends it to the batch whenever this happens, so
a real gap is visibly distinguishable from "this just never got logged."

Verified via UnitTest.exe all (49/49) and a live PPSSPPHeadless + wsdbg
session confirming normal (non-overflow) log relay still works
end-to-end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
2026-08-14 11:04:32 +02:00
Henrik Rydgård 96cab3f267 Rework the log manager to be more robust 2024-12-16 12:33:58 +01:00
Henrik Rydgård 3ffff831c7 Refactor LogManager (remove GetInstance()). In headless, add option to log to OutputDebugString on Windows. 2024-12-03 21:39:42 +01:00
Henrik Rydgård 5939270d2c Log: Split out StdioListener from ConsoleListener, making the second Win32-only. 2024-07-21 13:55:40 +02:00
Henrik Rydgård 1025bbcf89 Log level/type: Use enum class instead of the awkward namespace trick.
Just a small cleanup I've wanted to do for a long time.
2023-08-25 11:48:59 +02:00
Unknown W. Brackets 77131e737b Log: Use a separate field for the timestamp.
Better than parsing it since we already have the header separate.  Simpler
too.
2018-06-08 06:59:17 -07:00
Unknown W. Brackets 1f987bf1c1 Debugger: Initial register get/set APIs. 2018-06-08 06:59:16 -07:00
Unknown W. Brackets b37d59e8fa Debugger: Organize WebSocket event handling.
Just a starting point to organize it.  Trying to keep it simple.
2018-06-08 06:59:16 -07:00