Files
ubports_kernel_google_msm/arch/x86/kernel
TAKADA Yoshihito 11dbc963a8 ptrace GET/SET FPXREGS broken
When I update kernel 2.6.25 from 2.6.24, gdb does not work.
On 2.6.25, ptrace(PTRACE_GETFPXREGS, ...) returns ENODEV.

But 2.6.24 kernel's ptrace() returns EIO.
It is issue of compatibility.

I attached test program as pt.c and patch for fix it.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/ptrace.h>
#include <sys/types.h>

struct user_fxsr_struct {
	unsigned short	cwd;
	unsigned short	swd;
	unsigned short	twd;
	unsigned short	fop;
	long	fip;
	long	fcs;
	long	foo;
	long	fos;
	long	mxcsr;
	long	reserved;
	long	st_space[32];	/* 8*16 bytes for each FP-reg = 128 bytes */
	long	xmm_space[32];	/* 8*16 bytes for each XMM-reg = 128 bytes */
	long	padding[56];
};

int main(void)
{
  pid_t pid;

  pid = fork();

  switch(pid){
  case -1:/*  error */
    break;
  case 0:/*  child */
    child();
    break;
  default:
    parent(pid);
    break;
  }
  return 0;
}

int child(void)
{
  ptrace(PTRACE_TRACEME);
  kill(getpid(), SIGSTOP);
  sleep(10);
  return 0;
}
int parent(pid_t pid)
{
  int ret;
  struct user_fxsr_struct fpxregs;

  ret = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpxregs);
  if(ret < 0){
    printf("%d: %s.\n", errno, strerror(errno));
  }
  kill(pid, SIGCONT);
  wait(pid);
  return 0;
}

/* in the kerel, at kernel/i387.c get_fpxregs() */

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-06-30 14:35:18 +02:00
..
2008-06-04 13:11:46 +02:00
2008-04-25 19:54:07 +02:00
2008-04-17 17:41:19 +02:00
2008-04-26 17:35:47 +02:00
2008-04-29 08:06:29 -07:00
2008-04-29 08:06:29 -07:00
2008-04-19 19:10:28 -07:00
2008-01-30 13:31:31 +01:00
2008-04-29 13:45:24 +02:00
2008-02-19 16:18:28 +01:00
2008-04-19 19:19:54 +02:00
2008-01-30 13:31:19 +01:00
2008-04-19 19:19:54 +02:00
2008-04-17 17:41:13 +02:00
2008-04-30 23:15:34 +02:00
2008-04-17 17:41:36 +02:00
2008-04-19 19:19:58 +02:00
2008-04-17 17:40:49 +02:00
2008-06-12 21:26:12 +02:00
2008-04-17 17:41:37 +02:00
2008-04-30 23:15:34 +02:00
2008-06-30 14:35:18 +02:00
2008-04-26 17:35:47 +02:00
2008-04-26 17:35:48 +02:00
2008-03-26 22:23:40 +01:00
2008-01-30 13:33:10 +01:00
2008-04-17 17:40:56 +02:00
2008-04-29 08:06:02 -07:00
2008-04-19 19:19:54 +02:00
2008-04-27 12:00:28 +03:00
2008-05-23 14:08:06 +02:00
2008-05-07 12:42:03 +02:00
2008-06-12 21:25:51 +02:00
2008-05-04 20:04:45 +02:00
2008-04-19 19:10:28 -07:00
2008-06-12 21:26:28 +02:00
2008-01-30 13:33:19 +01:00
2008-04-19 19:19:57 +02:00
2008-04-19 19:19:56 +02:00
2008-06-12 18:05:42 -07:00
2008-04-19 19:19:55 +02:00
2008-04-30 08:29:37 -07:00
2008-04-30 08:29:37 -07:00
2008-05-13 19:36:12 +02:00
2008-06-30 13:15:43 +02:00
2008-04-17 17:40:55 +02:00
2008-04-17 17:40:55 +02:00
2008-04-26 17:35:47 +02:00
2008-04-29 08:06:03 -07:00
2008-02-08 09:22:29 -08:00
2008-04-17 17:40:56 +02:00
2008-01-30 13:31:52 +01:00
2008-04-17 17:41:37 +02:00
2008-05-23 14:08:06 +02:00
2008-04-24 23:57:31 +02:00
2008-04-28 13:49:35 -07:00
2008-04-24 23:15:44 +02:00