Index: tests/lib/libc/sys/t_ptrace_core_wait.h =================================================================== RCS file: /home/netbsd/src/tests/lib/libc/sys/t_ptrace_core_wait.h,v retrieving revision 1.2 diff -p -u -r1.2 t_ptrace_core_wait.h --- tests/lib/libc/sys/t_ptrace_core_wait.h 24 Jun 2020 04:47:10 -0000 1.2 +++ tests/lib/libc/sys/t_ptrace_core_wait.h 12 Oct 2020 13:58:50 -0000 @@ -207,12 +207,11 @@ ATF_TC_BODY(core_dump_procinfo, tc) DPRINTF("Before resuming the child process where it left off and " "without signal to be sent\n"); -#ifndef __powerpc__ - SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); -#else + +#if defined(__aarch64__) || defined(__arm__) || defined(__powerpc__) /* - * For powerpc, program counter is not automatically incremented by - * a trap instruction. We cannot increment PC in the trap handler, + * For these archs, program counter is not automatically incremented + * by a trap instruction. We cannot increment PC in the trap handler, * which breaks applications depending on this behavior, e.g., GDB. * Therefore, we need to pass (PC + 4) instead of (void *)1 (== PC) * to PT_CONTINUE here. @@ -220,8 +219,15 @@ ATF_TC_BODY(core_dump_procinfo, tc) struct reg r; SYSCALL_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1); - SYSCALL_REQUIRE( - ptrace(PT_CONTINUE, child, (void *)(r.pc + 4), 0) != -1); + SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, +# if defined(__aarch64__) || defined(__arm__) + (void *)(r.r_pc + 4), +# elif defined(__powerpc__) + (void *)(r.pc + 4), +# endif + 0) != -1); +#else + SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); #endif DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);