|
HyperDbg Debugger
|
User mode cross-platform implementation of the console-control handler. More...
#include "pch.h"User mode cross-platform implementation of the console-control handler.
See platform-signal.h. The Windows branch forwards to SetConsoleCtrlHandler. The Linux branch blocks the handled signals and dispatches them from a dedicated sigwait() thread. sigwait() (rather than a sigaction() handler) is used deliberately: BreakController calls ShowMessages (printf), socket I/O and Sleep, none of which are async-signal-safe. Running the handler on a normal thread woken by sigwait() sidesteps that entirely and mirrors the Windows model where the console-control handler also runs on its own thread.