diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/ChangeLog | 11 | ||||
-rw-r--r-- | runtime/regs-ia64.c | 21 | ||||
-rw-r--r-- | runtime/syscall.h | 17 | ||||
-rw-r--r-- | runtime/task_finder.c | 6 |
4 files changed, 38 insertions, 17 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 9cca0759..f7a844d8 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,5 +1,16 @@ 2008-09-09 Masami Hiramatsu <mhiramat@redhat.com> + * regs-ia64.c (__ia64_fetch_register): Return the address of the + register. + (ia64_fetch_register): Use __ia64_fetch_register. + * syscall.h (____stp_user_syscall_arg): Use __ia64_fetch_register. + (__stp_user_syscall_arg): Wrapping ____stp_user_syscall_arg to pass the + unwind address cache. + * task_finder.c (__stp_utrace_task_finder_target_syscall_): Added dummy + unwind address cache. + +2008-09-09 Masami Hiramatsu <mhiramat@redhat.com> + * syscall.h: Added ia64 support. 2008-09-09 Mark Wielaard <mwielaard@redhat.com> diff --git a/runtime/regs-ia64.c b/runtime/regs-ia64.c index fd8d8ca8..8ce3e4c3 100644 --- a/runtime/regs-ia64.c +++ b/runtime/regs-ia64.c @@ -61,27 +61,36 @@ static void ia64_stap_get_arbsp(struct unw_frame_info *info, void *arg) -(__offset + (regs->cr_ifs & 127)));\ } -static long ia64_fetch_register(int regno, struct pt_regs *pt_regs, unsigned long **cache) +static long * +__ia64_fetch_register(int regno, struct pt_regs *pt_regs, unsigned long **cache) { struct ia64_stap_get_arbsp_param pa; if (regno == 12) - return pt_regs->r12; + return &pt_regs->r12; if (regno >= 8 && regno <= 11) - return *(unsigned long *)(&pt_regs->r8 + regno - 8); + return (long *)(&pt_regs->r8 + regno - 8); else if (regno < 32 || regno > 127) - return 0; + return NULL; if (!*cache) { pa.ip = pt_regs->cr_iip; unw_init_running(ia64_stap_get_arbsp, &pa); if (pa.address == 0) - return 0; + return NULL; *cache = pa.address; } - return *ia64_rse_skip_regs(*cache, regno-32); + return ia64_rse_skip_regs(*cache, regno-32); +} + +static long +ia64_fetch_register(int regno, struct pt_regs *pt_regs, unsigned long **cache) +{ + long *reg; + reg = __ia64_fetch_register(regno, pt_regs, cache); + return (reg != NULL)? *reg : 0; } static void ia64_store_register(int regno, diff --git a/runtime/syscall.h b/runtime/syscall.h index 8416fd1d..24fc7b1c 100644 --- a/runtime/syscall.h +++ b/runtime/syscall.h @@ -236,23 +236,18 @@ __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, #endif #if defined(__ia64__) +#define __stp_user_syscall_arg(task, regs, n) \ + ____stp_user_syscall_arg(task, regs, n, &c->unwaddr) + static inline long * -__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, - unsigned int n) +____stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, + unsigned int n, unsigned long **cache) { - struct ia64_stap_get_arbsp_param pa; if (n > 5) { _stp_error("syscall arg > 5"); return NULL; } - - pa.ip = regs->cr_iip; - unw_init_running(ia64_stap_get_arbsp, &pa); - if (pa.address == 0) - return NULL; - - return ia64_rse_skip_regs(pa.address, n); - + return __ia64_fetch_register(n + 32, regs, cache); } #endif diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 2d4eed15..cbb10d35 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -843,6 +843,9 @@ __stp_utrace_task_finder_target_syscall_entry(enum utrace_resume_action action, struct vm_area_struct *vma; unsigned long *arg0_addr, arg0; int rc; +#if defined(__ia64__) + struct { unsigned long *unwaddr; } _c = {.unwaddr = NULL}, *c = &_c; +#endif if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { debug_task_finder_detach(); @@ -950,6 +953,9 @@ __stp_utrace_task_finder_target_syscall_exit(enum utrace_resume_action action, struct mm_struct *mm; struct vm_area_struct *vma; struct __stp_tf_vma_entry *entry = NULL; +#if defined(__ia64__) + struct { unsigned long *unwaddr; } _c = {.unwaddr = NULL}, *c = &_c; +#endif if (atomic_read(&__stp_task_finder_state) != __STP_TF_RUNNING) { debug_task_finder_detach(); |