Add support for NetBSD threads in amd64-bsd-nat.c
authorKamil Rytarowski <n54@gmx.com>
Sat, 14 Mar 2020 16:41:11 +0000 (17:41 +0100)
committerKamil Rytarowski <n54@gmx.com>
Wed, 18 Mar 2020 01:34:21 +0000 (02:34 +0100)
commit1c0aa1fbb2fb1920c12400940704ee90491b7290
tree3d34f25a7bdc2fc738c10a73f57b5d8e3f732f29
parentd3e2a5e85df4c8454135503c1034b95fecd522ab
Add support for NetBSD threads in amd64-bsd-nat.c

NetBSD ptrace(2) accepts thread id (LWP) as the 4th argument for threads.

Define gdb_ptrace() a wrapper function for ptrace(2) that properly passes
the pid,lwp pair on NetBSD and the result of get_ptrace_pid() for others.

gdb/ChangeLog:

* amd64-bsd-nat.c (gdb_ptrace): New.
* (amd64bsd_fetch_inferior_registers,
amd64bsd_store_inferior_registers) Switch from pid_t to ptid_t.
* (amd64bsd_fetch_inferior_registers,
amd64bsd_store_inferior_registers) Use gdb_ptrace.
gdb/ChangeLog
gdb/amd64-bsd-nat.c