From 47a2a2303c9b261e88a4333bf2964b4291a22a12 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 20 Apr 2009 22:43:37 +0200 Subject: Pass task from tapset, through stack and unwind functions for lookup. * runtime/stack-arm.c (__stp_stack_print): Take struct task_struct *. * runtime/stack-ia64.c (__stp_stack_print): Likewise. * runtime/stack-ppc64.c (__stp_stack_print): Likewise. * runtime/stack-s390.c (__stp_stack_print): Likewise. * runtime/stack-i386.c (__stp_stack_print): Likewise. And add check and pass to unwind() and _stp_func_print(). * runtime/stack-x86_64.c: Likewise. * runtime/stack.c *_stp_stack_print): Take and pass on task_struct. (_stp_stack_snprint): Likewise. * runtime/unwind.c (unwind): Take and use task_struct for _stp_mod_sec_lookup(). * tapset/context-unwind.stp (print_backtrace): Pass NULL to _stp_stack_print(). (backtrace): Pass NULL to _stp_stack_snprint(). --- runtime/stack-i386.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime/stack-i386.c') diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c index a37ddd72..6fd1613f 100644 --- a/runtime/stack-i386.c +++ b/runtime/stack-i386.c @@ -30,7 +30,8 @@ static void _stp_stack_print_fallback(unsigned long stack, int verbose, int leve } #endif -static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) +static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels, + struct task_struct *tsk) { unsigned long context = (unsigned long)®_SP(regs) & ~(THREAD_SIZE - 1); @@ -60,11 +61,11 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) struct unwind_frame_info info; arch_unw_init_frame_info(&info, regs); - while (levels && !arch_unw_user_mode(&info)) { - int ret = unwind(&info); + while (levels && (tsk || !arch_unw_user_mode(&info))) { + int ret = unwind(&info, tsk); dbug_unwind(1, "ret=%d PC=%lx SP=%lx\n", ret, UNW_PC(&info), UNW_SP(&info)); if (ret == 0) { - _stp_func_print(UNW_PC(&info), verbose, 1, current); + _stp_func_print(UNW_PC(&info), verbose, 1, tsk); levels--; continue; } -- cgit