Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/arch/powerpc Fixed ptrace() so that it is n...
details: https://anonhg.NetBSD.org/src/rev/2c63b11d9067
branches: trunk
changeset: 510219:2c63b11d9067
user: manu <manu%NetBSD.org@localhost>
date: Tue May 22 21:09:20 2001 +0000
description:
Fixed ptrace() so that it is now possible to get traced process registers.
This makes Linux gdb able to run a Linux binary
diffstat:
sys/compat/linux/arch/powerpc/linux_ptrace.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (63 lines):
diff -r 188f3438e594 -r 2c63b11d9067 sys/compat/linux/arch/powerpc/linux_ptrace.c
--- a/sys/compat/linux/arch/powerpc/linux_ptrace.c Tue May 22 21:05:49 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_ptrace.c Tue May 22 21:09:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.3 2001/02/04 22:59:26 christos Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.4 2001/05/22 21:09:20 manu Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -87,6 +87,7 @@
struct linux_user {
struct linux_pt_regs regs;
+#define lusr_startgdb regs
size_t u_tsize;
size_t u_dsize;
size_t u_ssize;
@@ -97,9 +98,9 @@
struct linux_pt_regs *u_ar0; /* help gdb find registers */
unsigned long magic;
char u_comm[32];
+#define lu_comm_end u_comm[31]
};
-#define lusr_startgdb regs
#define LUSR_OFF(member) offsetof(struct linux_user, member)
#define ISSET(t, f) ((t) & (f))
@@ -124,7 +125,6 @@
int addr;
int i;
-
switch (request = SCARG(uap, request)) {
case LINUX_PTRACE_PEEKUSR:
case LINUX_PTRACE_POKEUSR:
@@ -262,7 +262,8 @@
PHOLD(t); /* need full process info */
error = 0;
- if (addr < LUSR_OFF(lusr_startgdb)) {
+ if ((addr < LUSR_OFF(lusr_startgdb)) ||
+ (addr > LUSR_OFF(lu_comm_end))) {
error = 1;
} else if (addr == LUSR_OFF(u_tsize))
*retval = p->p_vmspace->vm_tsize;
@@ -274,7 +275,7 @@
*retval = (register_t) p->p_vmspace->vm_taddr;
else if (addr == LUSR_OFF(start_stack))
*retval = (register_t) p->p_vmspace->vm_minsaddr;
- else if (addr == LUSR_OFF(u_ar0))
+ else if ((addr >=0 ) && (addr < LUSR_OFF(u_tsize)))
*retval = LUSR_OFF(regs);
else if (addr == LUSR_OFF(signal)) {
error = 1;
@@ -306,7 +307,6 @@
/* never reached */
break;
}
-
return EIO;
out:
Home |
Main Index |
Thread Index |
Old Index