diff options
Diffstat (limited to 'sysdeps/powerpc/powerpc32/backtrace.c')
-rw-r--r-- | sysdeps/powerpc/powerpc32/backtrace.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sysdeps/powerpc/powerpc32/backtrace.c b/sysdeps/powerpc/powerpc32/backtrace.c index 1f372374db..5422fdd50d 100644 --- a/sysdeps/powerpc/powerpc32/backtrace.c +++ b/sysdeps/powerpc/powerpc32/backtrace.c @@ -1,5 +1,5 @@ /* Return backtrace of current program state. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -52,10 +52,10 @@ struct signal_frame_32 { }; static inline int -is_sigtramp_address (unsigned int nip) +is_sigtramp_address (void *nip) { #ifdef SHARED - if (nip == (unsigned int)__vdso_sigtramp32) + if (nip == VDSO_SYMBOL (sigtramp32)) return 1; #endif return 0; @@ -64,15 +64,15 @@ is_sigtramp_address (unsigned int nip) struct rt_signal_frame_32 { char dummy[SIGNAL_FRAMESIZE + 16]; siginfo_t info; - struct ucontext uc; + ucontext_t uc; /* We don't care about the rest, since IP value is at 'uc' field. */ }; static inline int -is_sigtramp_address_rt (unsigned int nip) +is_sigtramp_address_rt (void * nip) { #ifdef SHARED - if (nip == (unsigned int)__vdso_sigtramp_rt32) + if (nip == VDSO_SYMBOL (sigtramp_rt32)) return 1; #endif return 0; @@ -100,20 +100,23 @@ __backtrace (void **array, int size) /* Check if the symbol is the signal trampoline and get the interrupted * symbol address from the trampoline saved area. */ - if (is_sigtramp_address ((unsigned int)current->return_address)) + if (is_sigtramp_address (current->return_address)) { struct signal_frame_32 *sigframe = (struct signal_frame_32*) current; gregset = &sigframe->mctx.gregs; } - else if (is_sigtramp_address_rt ((unsigned int)current->return_address)) + else if (is_sigtramp_address_rt (current->return_address)) { struct rt_signal_frame_32 *sigframe = (struct rt_signal_frame_32*) current; gregset = &sigframe->uc.uc_mcontext.uc_regs->gregs; } if (gregset) - array[++count] = (void*)((*gregset)[PT_NIP]); + { + array[++count] = (void*)((*gregset)[PT_NIP]); + current = (void*)((*gregset)[PT_R1]); + } } /* It's possible the second-last stack frame can't return |