get_regs: define for all architectures

* defs.h (get_regs_error): Remove.
(clear_regs): Update prototype, declare unconditionally.
(get_regs): Declare unconditionally.
* syscall.c (clear_regs): New function.
(get_regs): Define unconditionally.
(get_regs_error): Define unconditionally, change scope to static.
This commit is contained in:
2015-02-13 21:56:50 +00:00
parent 7abf2e8307
commit 9a176c9290
2 changed files with 9 additions and 21 deletions

20
defs.h
View File

@ -457,25 +457,9 @@ extern int trace_syscall(struct tcb *);
extern void count_syscall(struct tcb *, const struct timeval *);
extern void call_summary(FILE *);
#if defined(AVR32) \
|| defined(I386) \
|| defined(X86_64) || defined(X32) \
|| defined(AARCH64) \
|| defined(ARM) \
|| defined(SPARC) || defined(SPARC64) \
|| defined(TILE) \
|| defined(OR1K) \
|| defined(METAG) \
|| defined(ARC) \
|| defined(POWERPC)
extern long get_regs_error;
# define clear_regs() (get_regs_error = -1)
extern void clear_regs(void);
extern void get_regs(pid_t pid);
#else
# define get_regs_error 0
# define clear_regs() ((void)0)
# define get_regs(pid) ((void)0)
#endif
extern int umoven(struct tcb *, long, unsigned int, char *);
#define umove(pid, addr, objp) \
umoven((pid), (addr), sizeof(*(objp)), (char *) (objp))

View File

@ -791,6 +791,8 @@ static struct user_regs_struct arc_regs;
# define ARCH_REGS_FOR_GETREGSET arc_regs
#endif
static long get_regs_error;
void
print_pc(struct tcb *tcp)
{
@ -1017,8 +1019,11 @@ static int powerpc_getregs_old(pid_t pid)
}
#endif
#ifndef get_regs
long get_regs_error;
void
clear_regs(void)
{
get_regs_error = -1;
}
#if defined ARCH_REGS_FOR_GETREGSET
static long
@ -1116,7 +1121,6 @@ get_regs(pid_t pid)
get_regs_error = 0;
#endif
}
#endif /* !get_regs */
/* Returns:
* 0: "ignore this ptrace stop", bail out of trace_syscall_entering() silently.