refine tracing logic

This commit is contained in:
5ec1cff
2023-11-13 21:51:37 +08:00
parent fd6a454275
commit fd9f8799a1
4 changed files with 17 additions and 27 deletions

View File

@@ -319,7 +319,7 @@ public:
LOGD("stopping %d", pid);
kill(pid, SIGSTOP);
ptrace(PTRACE_CONT, pid, 0, 0);
wait_pid(pid, &status, __WALL);
waitpid(pid, &status, __WALL);
if (STOPPED_WITH(SIGSTOP, 0)) {
LOGD("detaching %d", pid);
ptrace(PTRACE_DETACH, pid, 0, SIGSTOP);