Module Name: src
Committed By: christos
Date: Thu Nov 30 00:13:29 UTC 2017
Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-bsd-nat.c i386-bsd-nat.c
m68k-bsd-nat.c m88k-bsd-nat.c vax-bsd-nat.c
Log Message:
Fix 'last argument of ptrace is the thread id' on NetBSD.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c:1.1.1.1 Tue Nov 28 13:18:06 2017
+++ src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c Wed Nov 29 19:13:29 2017
@@ -49,7 +49,7 @@ amd64bsd_fetch_inferior_registers (struc
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
amd64_supply_native_gregset (regcache, ®s, -1);
@@ -66,7 +66,7 @@ amd64bsd_fetch_inferior_registers (struc
if (x86bsd_xsave_len != 0)
{
xstateregs = alloca (x86bsd_xsave_len);
- if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0)
+ if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, ptid_get_lwp (inferior_ptid))
== -1)
perror_with_name (_("Couldn't get extended state status"));
@@ -75,7 +75,7 @@ amd64bsd_fetch_inferior_registers (struc
}
#endif
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
amd64_supply_fxsave (regcache, -1, &fpregs);
@@ -96,12 +96,12 @@ amd64bsd_store_inferior_registers (struc
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
amd64_collect_native_gregset (regcache, ®s, regnum);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write registers"));
if (regnum != -1)
@@ -117,11 +117,11 @@ amd64bsd_store_inferior_registers (struc
if (x86bsd_xsave_len != 0)
{
xstateregs = alloca (x86bsd_xsave_len);
- if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0)
+ if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, ptid_get_lwp (inferior_ptid))
== -1)
perror_with_name (_("Couldn't get extended state status"));
- amd64_collect_xsave (regcache, regnum, xstateregs, 0);
+ amd64_collect_xsave (regcache, regnum, xstateregs, ptid_get_lwp (inferior_ptid));
if (ptrace (PT_SETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs,
x86bsd_xsave_len) == -1)
@@ -130,12 +130,12 @@ amd64bsd_store_inferior_registers (struc
}
#endif
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
amd64_collect_fxsave (regcache, regnum, &fpregs);
- if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write floating point status"));
}
}
Index: src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c:1.1.1.1 Tue Nov 28 13:18:07 2017
+++ src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c Wed Nov 29 19:13:29 2017
@@ -137,7 +137,7 @@ i386bsd_fetch_inferior_registers (struct
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
i386bsd_supply_gregset (regcache, ®s);
@@ -159,7 +159,7 @@ i386bsd_fetch_inferior_registers (struct
xstateregs = alloca (x86bsd_xsave_len);
if (ptrace (PT_GETXSTATE, pid,
- (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
+ (PTRACE_TYPE_ARG3) xstateregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get extended state status"));
i387_supply_xsave (regcache, -1, xstateregs);
@@ -169,7 +169,7 @@ i386bsd_fetch_inferior_registers (struct
#ifdef HAVE_PT_GETXMMREGS
if (have_ptrace_xmmregs != 0
- && ptrace(PT_GETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, 0) == 0)
+ && ptrace(PT_GETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, ptid_get_lwp (inferior_ptid)) == 0)
{
have_ptrace_xmmregs = 1;
i387_supply_fxsave (regcache, -1, xmmregs);
@@ -178,7 +178,7 @@ i386bsd_fetch_inferior_registers (struct
{
have_ptrace_xmmregs = 0;
#endif
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
i387_supply_fsave (regcache, -1, &fpregs);
@@ -201,12 +201,12 @@ i386bsd_store_inferior_registers (struct
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
i386bsd_collect_gregset (regcache, ®s, regnum);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write registers"));
if (regnum != -1)
@@ -227,10 +227,10 @@ i386bsd_store_inferior_registers (struct
xstateregs = alloca (x86bsd_xsave_len);
if (ptrace (PT_GETXSTATE, pid,
- (PTRACE_TYPE_ARG3) xstateregs, 0) == -1)
+ (PTRACE_TYPE_ARG3) xstateregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get extended state status"));
- i387_collect_xsave (regcache, -1, xstateregs, 0);
+ i387_collect_xsave (regcache, -1, xstateregs, ptid_get_lwp (inferior_ptid));
if (ptrace (PT_SETXSTATE, pid,
(PTRACE_TYPE_ARG3) xstateregs, x86bsd_xsave_len) == -1)
@@ -241,25 +241,25 @@ i386bsd_store_inferior_registers (struct
#ifdef HAVE_PT_GETXMMREGS
if (have_ptrace_xmmregs != 0
- && ptrace(PT_GETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, 0) == 0)
+ && ptrace(PT_GETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, ptid_get_lwp (inferior_ptid)) == 0)
{
have_ptrace_xmmregs = 1;
i387_collect_fxsave (regcache, regnum, xmmregs);
- if (ptrace (PT_SETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, 0) == -1)
+ if (ptrace (PT_SETXMMREGS, pid, (PTRACE_TYPE_ARG3) xmmregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write XMM registers"));
}
else
{
have_ptrace_xmmregs = 0;
#endif
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
i387_collect_fsave (regcache, regnum, &fpregs);
- if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write floating point status"));
#ifdef HAVE_PT_GETXMMREGS
}
Index: src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c:1.1.1.1 Tue Nov 28 13:18:03 2017
+++ src/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c Wed Nov 29 19:13:29 2017
@@ -69,7 +69,7 @@ m88kbsd_fetch_inferior_registers (struct
struct reg regs;
if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
- (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
m88kbsd_supply_gregset (regcache, ®s);
@@ -85,13 +85,13 @@ m88kbsd_store_inferior_registers (struct
struct reg regs;
if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
- (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
m88kbsd_collect_gregset (regcache, ®s, regnum);
if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
- (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write registers"));
}
Index: src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c:1.2 Wed Nov 29 13:15:29 2017
+++ src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c Wed Nov 29 19:13:29 2017
@@ -117,7 +117,7 @@ m68kbsd_fetch_inferior_registers (struct
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
m68kbsd_supply_gregset (regcache, ®s);
@@ -127,7 +127,7 @@ m68kbsd_fetch_inferior_registers (struct
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
m68kbsd_supply_fpregset (regcache, &fpregs);
@@ -147,12 +147,12 @@ m68kbsd_store_inferior_registers (struct
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
m68kbsd_collect_gregset (regcache, ®s, regnum);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write registers"));
}
@@ -160,12 +160,12 @@ m68kbsd_store_inferior_registers (struct
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get floating point status"));
m68kbsd_collect_fpregset (regcache, &fpregs, regnum);
- if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write floating point status"));
}
}
Index: src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c:1.3 Wed Nov 29 16:35:26 2017
+++ src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c Wed Nov 29 19:13:29 2017
@@ -72,7 +72,7 @@ vaxbsd_fetch_inferior_registers (struct
struct reg regs;
pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
vaxbsd_supply_gregset (regcache, ®s);
@@ -88,12 +88,12 @@ vaxbsd_store_inferior_registers (struct
struct reg regs;
pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't get registers"));
vaxbsd_collect_gregset (regcache, ®s, regnum);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, ptid_get_lwp (inferior_ptid)) == -1)
perror_with_name (_("Couldn't write registers"));
}