On 19.03.2020 02:13, Simon Marchi wrote: > On 2020-03-18 7:16 p.m., Kamil Rytarowski wrote: >> @@ -336,15 +350,14 @@ get_ptrace_pid (ptid_t ptid) >> void >> inf_ptrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal) >> { >> - pid_t pid; >> int request; >> >> if (minus_one_ptid == ptid) >> /* Resume all threads. Traditionally ptrace() only supports >> single-threaded processes, so simply resume the inferior. */ >> - pid = inferior_ptid.pid (); >> + ptid = inferior_ptid; >> else >> - pid = get_ptrace_pid (ptid); >> + ptid = ptid_t (inferior_ptid.pid ()); > > That's not what I meant. To keep the existing behavior, I believe it should be: > > if (minus_one_ptid == ptid) > /* Resume all threads. Traditionally ptrace() only supports > single-threaded processes, so simply resume the inferior. */ > ptid = ptid_t (inferior_ptid.pid ()); > OK. >> >> if (catch_syscall_enabled () > 0) >> request = PT_SYSCALL; >> @@ -365,7 +378,7 @@ inf_ptrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal) >> where it was. If GDB wanted it to start some other way, we have >> already written a new program counter value to the child. */ >> errno = 0; >> - ptrace (request, pid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal)); >> + gdb_ptrace (request, ptid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal)); >> if (errno != 0) >> perror_with_name (("ptrace")); >> } > > I'm getting this: > > /home/simark/src/binutils-gdb/gdb/inf-ptrace.c: In member function ‘virtual void inf_ptrace_target::resume(ptid_t, int, gdb_signal)’: > /home/simark/src/binutils-gdb/gdb/inf-ptrace.c:379:15: error: invalid conversion from ‘int’ to ‘__ptrace_request’ [-fpermissive] > 379 | gdb_ptrace (request, ptid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal)); > | ^~~~~~~ > | | > | int > /home/simark/src/binutils-gdb/gdb/inf-ptrace.c:41:30: note: initializing argument 1 of ‘int gdb_ptrace(__ptrace_request, ptid_t, long int, long int)’ > 41 | gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr, > > > We would need to change the type of the variable `ret` to PTRACE_TYPE_ARG1. > > I'll make a test run on Linux with those changes to check if there's any regression. > I presume you mean variable `request', not `ret'. Done. > Simon >