diff options
Diffstat (limited to 'sysdeps/linux-gnu/sparc/regs.c')
-rw-r--r-- | sysdeps/linux-gnu/sparc/regs.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sysdeps/linux-gnu/sparc/regs.c b/sysdeps/linux-gnu/sparc/regs.c index 5e5ad20..c474c83 100644 --- a/sysdeps/linux-gnu/sparc/regs.c +++ b/sysdeps/linux-gnu/sparc/regs.c @@ -1,5 +1,6 @@ /* * This file is part of ltrace. + * Copyright (C) 2013 Petr Machata, Red Hat Inc. * Copyright (C) 2004,2008,2009 Juan Cespedes * Copyright (C) 2006 Ian Wienand * @@ -27,7 +28,8 @@ #include "common.h" void * -get_instruction_pointer(Process *proc) { +get_instruction_pointer(struct process *proc) +{ proc_archdep *a = (proc_archdep *) (proc->arch_ptr); if (a->valid) return (void *)a->regs.pc; @@ -35,14 +37,16 @@ get_instruction_pointer(Process *proc) { } void -set_instruction_pointer(Process *proc, void *addr) { +set_instruction_pointer(struct process *proc, void *addr) +{ proc_archdep *a = (proc_archdep *) (proc->arch_ptr); if (a->valid) a->regs.pc = (long)addr; } void * -get_stack_pointer(Process *proc) { +get_stack_pointer(struct process *proc) +{ proc_archdep *a = (proc_archdep *) (proc->arch_ptr); if (a->valid) return (void *)a->regs.u_regs[UREG_I5]; @@ -50,7 +54,8 @@ get_stack_pointer(Process *proc) { } void * -get_return_addr(Process *proc, void *stack_pointer) { +get_return_addr(struct process *proc, void *stack_pointer) +{ proc_archdep *a = (proc_archdep *) (proc->arch_ptr); unsigned int t; if (!a->valid) @@ -61,11 +66,3 @@ get_return_addr(Process *proc, void *stack_pointer) { return (void *)a->regs.u_regs[UREG_I6] + 12; return (void *)a->regs.u_regs[UREG_I6] + 8; } - -void -set_return_addr(Process *proc, void *addr) { - proc_archdep *a = (proc_archdep *) (proc->arch_ptr); - if (!a->valid) - return; - ptrace(PTRACE_POKETEXT, proc->pid, a->regs.u_regs[UREG_I6] + 8, addr); -} |