Subject: Linux ptrace emulation patch
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
List: tech-kern
Date: 05/24/2001 19:55:11
Hello

I fixed a bug in Linux ptrace emulation on the PowerPC. It's located in
machine independent code, and I'm not sure this fix would not break non
PowerPC ports (that is, i386, since Alpha and m68k do not seem to have a
strong ptrace support).

Therefore, I'm looking for someone who could test emulation of
Linux/i386 gdb on a Linux process and check that this patch does not
decrease gdb functionnality.

Index: linux_misc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/linux/common/linux_misc.c,v
retrieving revision 1.88
diff -r1.88 linux_misc.c
1225a1226
>       int ret;
1250c1251,1263
<                       return sys_ptrace(p, &pta, retval);
---
>                       ret = sys_ptrace(p, &pta, retval);
>                       switch (request) {
>                               case LINUX_PTRACE_PEEKTEXT:
>                               case LINUX_PTRACE_PEEKDATA:
>                                       ret = copyout (retval, 
>                                           (caddr_t)SCARG(&pta, data),
>                                           sizeof ret);
>                                       *retval = SCARG(&pta, data);
>                                       break;
>                               default:        
>                                       break;
>                       }
>                       return ret;

-- 
Emmanuel Dreyfus
p99dreyf@criens.u-psud.fr