2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2003 PathScale, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the GPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include "ptrace_user.h"
|
|
|
|
|
|
|
|
int ptrace_getregs(long pid, unsigned long *regs_out)
|
|
|
|
{
|
2008-02-05 14:31:20 +08:00
|
|
|
if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
|
|
|
|
return -errno;
|
2005-04-17 06:20:36 +08:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2008-02-05 14:31:20 +08:00
|
|
|
int ptrace_setregs(long pid, unsigned long *regs_out)
|
2006-02-08 04:58:43 +08:00
|
|
|
{
|
2008-02-05 14:31:20 +08:00
|
|
|
if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
|
2006-02-08 04:58:43 +08:00
|
|
|
return -errno;
|
2008-02-05 14:31:20 +08:00
|
|
|
return(0);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|