summaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/ia64/regs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/linux-gnu/ia64/regs.c')
-rw-r--r--sysdeps/linux-gnu/ia64/regs.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sysdeps/linux-gnu/ia64/regs.c b/sysdeps/linux-gnu/ia64/regs.c
index cbc2744..67873ce 100644
--- a/sysdeps/linux-gnu/ia64/regs.c
+++ b/sysdeps/linux-gnu/ia64/regs.c
@@ -1,6 +1,6 @@
/*
* This file is part of ltrace.
- * Copyright (C) 2011,2012 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc.
* Copyright (C) 2008,2009 Juan Cespedes
* Copyright (C) 2006 Ian Wienand
*
@@ -34,7 +34,8 @@
#include "common.h"
void *
-get_instruction_pointer(Process *proc) {
+get_instruction_pointer(struct process *proc)
+{
unsigned long ip = ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IIP, 0);
unsigned long slot =
(ptrace(PTRACE_PEEKUSER, proc->pid, PT_CR_IPSR, 0) >> 41) & 3;
@@ -43,7 +44,8 @@ get_instruction_pointer(Process *proc) {
}
void
-set_instruction_pointer(Process *proc, void *addr) {
+set_instruction_pointer(struct process *proc, void *addr)
+{
unsigned long newip = (unsigned long)addr;
unsigned long slot = (unsigned long)addr & 0xf;
@@ -59,7 +61,8 @@ set_instruction_pointer(Process *proc, void *addr) {
}
void *
-get_stack_pointer(Process *proc) {
+get_stack_pointer(struct process *proc)
+{
long l = ptrace(PTRACE_PEEKUSER, proc->pid, PT_R12, 0);
if (l == -1 && errno)
return NULL;
@@ -67,14 +70,10 @@ get_stack_pointer(Process *proc) {
}
void *
-get_return_addr(Process *proc, void *stack_pointer) {
+get_return_addr(struct process *proc, void *stack_pointer)
+{
long l = ptrace(PTRACE_PEEKUSER, proc->pid, PT_B0, 0);
if (l == -1 && errno)
return NULL;
return (void *)l;
}
-
-void
-set_return_addr(Process *proc, void *addr) {
- ptrace(PTRACE_POKEUSER, proc->pid, PT_B0, addr);
-}