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