Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by rin ...
details: https://anonhg.NetBSD.org/src/rev/bda51d537784
branches: netbsd-8
changeset: 461358:bda51d537784
user: martin <martin%NetBSD.org@localhost>
date: Sun Nov 24 08:15:17 2019 +0000
description:
Pull up following revision(s) (requested by rin in ticket #1456):
sys/kern/sys_ptrace_common.c: revision 1.73
Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27
Size of registers should be determined from tracer, NOT tracee.
Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.
XXX
pullup to netbsd-9 and -8.
diffstat:
sys/kern/sys_ptrace_common.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diffs (59 lines):
diff -r a1f3c6807fb7 -r bda51d537784 sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c Sun Nov 24 08:11:06 2019 +0000
+++ b/sys/kern/sys_ptrace_common.c Sun Nov 24 08:15:17 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_ptrace_common.c,v 1.22.2.7 2019/11/19 10:50:25 martin Exp $ */
+/* $NetBSD: sys_ptrace_common.c,v 1.22.2.8 2019/11/24 08:15:17 martin Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.7 2019/11/19 10:50:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.8 2019/11/24 08:15:17 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ptrace.h"
@@ -775,9 +775,12 @@
void *addr, size_t data)
{
int error;
- struct proc *t = (*lt)->l_proc;
+ struct proc *p, *t;
struct vmspace *vm;
+ p = l->l_proc; /* tracer */
+ t = (*lt)->l_proc; /* traced */
+
if ((error = ptrace_update_lwp(t, lt, data)) != 0)
return error;
@@ -791,7 +794,7 @@
case_PT_SETREGS
if (!process_validregs(*lt))
return EINVAL;
- size = PROC_REGSZ(t);
+ size = PROC_REGSZ(p);
func = ptm->ptm_doregs;
break;
#endif
@@ -800,7 +803,7 @@
case_PT_SETFPREGS
if (!process_validfpregs(*lt))
return EINVAL;
- size = PROC_FPREGSZ(t);
+ size = PROC_FPREGSZ(p);
func = ptm->ptm_dofpregs;
break;
#endif
@@ -809,7 +812,7 @@
case_PT_SETDBREGS
if (!process_validdbregs(*lt))
return EINVAL;
- size = PROC_DBREGSZ(t);
+ size = PROC_DBREGSZ(p);
func = ptm->ptm_dodbregs;
break;
#endif
Home |
Main Index |
Thread Index |
Old Index