inject non-stop signal by default

This commit is contained in:
5ec1cff
2023-11-12 21:10:40 +08:00
parent 0ac9bb819b
commit 889a44cd0d

View File

@@ -234,12 +234,17 @@ public:
LOGI("stop tracing init");
continue;
}
// suppress
// TODO: inject signal
if (WIFSTOPPED(status)) {
if (WPTEVENT(status) == 0) {
LOGW("suppressed signal sent to init: %s %d",
sigabbrev_np(WSTOPSIG(status)), WSTOPSIG(status));
if (WSTOPSIG(status) != SIGSTOP && WSTOPSIG(status) != SIGTSTP && WSTOPSIG(status) != SIGTTIN && WSTOPSIG(status) != SIGTTOU) {
LOGW("inject signal sent to init: %s %d",
sigabbrev_np(WSTOPSIG(status)), WSTOPSIG(status));
ptrace(PTRACE_CONT, pid, 0, WSTOPSIG(status));
} else {
LOGW("suppress stopping signal sent to init: %s %d",
sigabbrev_np(WSTOPSIG(status)), WSTOPSIG(status));
}
continue;
}
ptrace(PTRACE_CONT, pid, 0, 0);
}