Patch for ptrace.c in 2.0.27

Stephen Polkowski (stephen@centtech.com)
Mon, 25 Aug 1997 20:27:35 -0500


Hello Linus,

This is a patch for ptrace.c that adds PTRACE_PEEKUSR support for the
Intel floating point registers. This is the first of two steps required
to get floating point info from "gdb". The second step requires a
change in "gdb" directly. I hope this diff isn't too old.

--- linux/arch/i386/kernel/ptrace.c.orig Tue Jul 29 18:03:12 1997
+++ linux/arch/i386/kernel/ptrace.c Tue Jul 29 18:03:24 1997
@@ -391,6 +391,24 @@
addr = addr >> 2;
tmp = child->debugreg[addr];
};
+
+ if (hard_math) { /* skip fpu if using 387
emulator */
+
+ addr &= -4;
+ if (addr == &dummy->u_fpvalid) {
+ tmp = 1;
+ }
+
+ if (addr >= (long) &dummy->i387.cwd &&
+ addr <= (long) &dummy->i387.st_space[19])
{
+
+ __asm__("fnop"); /* force dump of the
child's fpu state */
+ addr -= (long)
&dummy->i387.cwd;
+ addr += (long) &child->tss.i387.hard.cwd;
+ tmp = *((long*) addr);
+ }
+ }
+
put_fs_long(tmp,(unsigned long *) data);
return 0;
}


Regards,

Steve

-- 
Stephen Polkowski
Centaur Technology  
Austin, TX
(512) 418-5730