From: Dmitry V. Levin Date: Thu, 10 Mar 2011 14:44:45 +0000 (+0000) Subject: Get rid of PT_GETSIGINFO X-Git-Tag: v4.6~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c15dfc796150d09bb74bebfbb85bebf142766b6c;p=strace Get rid of PT_GETSIGINFO * strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is available. Replace PT_GETSIGINFO with PTRACE_GETSIGINFO. Use PTRACE_GETSIGINFO for all signals. --- diff --git a/strace.c b/strace.c index 89fda4f0..42d436e1 100644 --- a/strace.c +++ b/strace.c @@ -2639,27 +2639,19 @@ Process %d attached (waiting for parent)\n", && (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) { unsigned long addr = 0; long pc = 0; -#if defined(PT_CR_IPSR) && defined(PT_CR_IIP) && defined(PT_GETSIGINFO) + siginfo_t si; +#if defined(PT_CR_IPSR) && defined(PT_CR_IIP) # define PSR_RI 41 - struct siginfo si; long psr; upeek(tcp, PT_CR_IPSR, &psr); upeek(tcp, PT_CR_IIP, &pc); pc += (psr >> PSR_RI) & 0x3; - ptrace(PT_GETSIGINFO, pid, 0, (long) &si); - addr = (unsigned long) si.si_addr; -#elif defined PTRACE_GETSIGINFO - if (WSTOPSIG(status) == SIGSEGV || - WSTOPSIG(status) == SIGBUS) { - siginfo_t si; - if (ptrace(PTRACE_GETSIGINFO, pid, - 0, &si) == 0) - addr = (unsigned long) - si.si_addr; - } #endif + si.si_addr = NULL; + if (ptrace(PTRACE_GETSIGINFO, pid, 0, &si) == 0) + addr = (unsigned long) si.si_addr; printleader(tcp); tprintf("--- %s (%s) @ %lx (%lx) ---", signame(WSTOPSIG(status)),