Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gdb/dist/gdb Fix 'last argument of ptrace is t...
details: https://anonhg.NetBSD.org/src/rev/0da2e3a0adcf
branches: trunk
changeset: 357846:0da2e3a0adcf
user: christos <christos%NetBSD.org@localhost>
date: Thu Nov 30 00:13:29 2017 +0000
description:
Fix 'last argument of ptrace is the thread id' on NetBSD.
diffstat:
external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c | 18 +++++++++---------
external/gpl3/gdb/dist/gdb/i386-bsd-nat.c | 24 ++++++++++++------------
external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c | 12 ++++++------
external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c | 6 +++---
external/gpl3/gdb/dist/gdb/vax-bsd-nat.c | 6 +++---
5 files changed, 33 insertions(+), 33 deletions(-)
diffs (277 lines):
diff -r de5443308d9a -r 0da2e3a0adcf external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c Wed Nov 29 22:40:45 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c Thu Nov 30 00:13:29 2017 +0000
@@ -49,7 +49,7 @@
{
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 @@
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 @@
}
#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 @@
{
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 @@
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 @@
}
#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"));
}
}
diff -r de5443308d9a -r 0da2e3a0adcf external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c Wed Nov 29 22:40:45 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c Thu Nov 30 00:13:29 2017 +0000
@@ -137,7 +137,7 @@
{
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 @@
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 @@
#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 @@
{
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 @@
{
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 @@
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 @@
#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
}
diff -r de5443308d9a -r 0da2e3a0adcf external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c Wed Nov 29 22:40:45 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c Thu Nov 30 00:13:29 2017 +0000
@@ -117,7 +117,7 @@
{
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 @@
{
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 @@
{
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 @@
{
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"));
}
}
diff -r de5443308d9a -r 0da2e3a0adcf external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c Wed Nov 29 22:40:45 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/m88k-bsd-nat.c Thu Nov 30 00:13:29 2017 +0000
@@ -69,7 +69,7 @@
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 @@
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"));
}
diff -r de5443308d9a -r 0da2e3a0adcf external/gpl3/gdb/dist/gdb/vax-bsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c Wed Nov 29 22:40:45 2017 +0000
+++ b/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c Thu Nov 30 00:13:29 2017 +0000
@@ -72,7 +72,7 @@
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 @@
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"));
}
Home |
Main Index |
Thread Index |
Old Index