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