Home | History | Annotate | Download | only in tests

Lines Matching refs:child

65 static void check_hw_feature_supported(pid_t child, HwFeature feature) {
68 long result = ptrace(PTRACE_GETHBPREGS, child, 0, &capabilities);
91 long result = ptrace(PTRACE_GETREGSET, child,
99 UNUSED(child);
104 static void set_watchpoint(pid_t child, uintptr_t address, size_t size) {
113 ASSERT_EQ(0, ptrace(PTRACE_SETHBPREGS, child, -1, &address)) << strerror(errno);
114 ASSERT_EQ(0, ptrace(PTRACE_SETHBPREGS, child, -2, &control)) << strerror(errno);
125 ASSERT_EQ(0, ptrace(PTRACE_SETREGSET, child, NT_ARM_HW_WATCH, &iov)) << strerror(errno);
128 ASSERT_EQ(0, ptrace(PTRACE_POKEUSER, child, offsetof(user, u_debugreg[0]), address)) << strerror(errno);
130 unsigned data = ptrace(PTRACE_PEEKUSER, child, offsetof(user, u_debugreg[7]), nullptr);
141 ASSERT_EQ(0, ptrace(PTRACE_POKEUSER, child, offsetof(user, u_debugreg[7]), data)) << strerror(errno);
143 UNUSED(child);
153 pid_t child = fork();
154 ASSERT_NE(-1, child) << strerror(errno);
155 if (child == 0) {
171 ChildGuard guard(child);
174 ASSERT_EQ(child, TEMP_FAILURE_RETRY(waitpid(child, &status, __WALL))) << strerror(errno);
178 check_hw_feature_supported(child, HwFeature::Watchpoint);
180 set_watchpoint(child, uintptr_t(untag_address(&data)) + offset, size);
182 ASSERT_EQ(0, ptrace(PTRACE_CONT, child, nullptr, nullptr)) << strerror(errno);
183 ASSERT_EQ(child, TEMP_FAILURE_RETRY(waitpid(child, &status, __WALL))) << strerror(errno);
188 ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child, nullptr, &siginfo)) << strerror(errno);
285 static void set_breakpoint(pid_t child) {
294 ASSERT_EQ(0, ptrace(PTRACE_SETHBPREGS, child, 1, &address)) << strerror(errno);
295 ASSERT_EQ(0, ptrace(PTRACE_SETHBPREGS, child, 2, &control)) << strerror(errno);
306 ASSERT_EQ(0, ptrace(PTRACE_SETREGSET, child, NT_ARM_HW_BREAK, &iov)) << strerror(errno);
309 ASSERT_EQ(0, ptrace(PTRACE_POKEUSER, child, offsetof(user, u_debugreg[0]), address))
312 unsigned data = ptrace(PTRACE_PEEKUSER, child, offsetof(user, u_debugreg[7]), nullptr);
323 ASSERT_EQ(0, ptrace(PTRACE_POKEUSER, child, offsetof(user, u_debugreg[7]), data))
326 UNUSED(child);
334 pid_t child = fork();
335 ASSERT_NE(-1, child) << strerror(errno);
336 if (child == 0) breakpoint_fork_child();
338 ChildGuard guard(child);
341 ASSERT_EQ(child, TEMP_FAILURE_RETRY(waitpid(child, &status, __WALL))) << strerror(errno);
345 check_hw_feature_supported(child, HwFeature::Breakpoint);
347 set_breakpoint(child);
349 ASSERT_EQ(0, ptrace(PTRACE_CONT, child, nullptr, nullptr)) << strerror(errno);
350 ASSERT_EQ(child, TEMP_FAILURE_RETRY(waitpid(child, &status, __WALL))) << strerror(errno);
355 ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child, nullptr, &siginfo)) << strerror(errno);