2005-04-17 05:20:36 +07: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 13:31:20 +07:00
|
|
|
if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
|
|
|
|
return -errno;
|
2005-04-17 05:20:36 +07:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2008-02-05 13:31:20 +07:00
|
|
|
int ptrace_setregs(long pid, unsigned long *regs_out)
|
2006-02-08 03:58:43 +07:00
|
|
|
{
|
2008-02-05 13:31:20 +07:00
|
|
|
if (ptrace(PTRACE_SETREGS, pid, 0, regs_out) < 0)
|
2006-02-08 03:58:43 +07:00
|
|
|
return -errno;
|
2008-02-05 13:31:20 +07:00
|
|
|
return(0);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|