From: Roland McGrath Date: Sun, 6 Mar 2005 22:24:29 +0000 (+0000) Subject: 2005-03-06 Roland McGrath X-Git-Tag: v4.5.18~411 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a055d7d64222223da2550ca540043de7e3e232b;p=strace 2005-03-06 Roland McGrath * strace.c (trace) [PTRACE_GETSIGINFO]: Fetch siginfo_t for SIGSEGV and SIGBUS signals, use si_addr in output. --- diff --git a/strace.c b/strace.c index ac83703d..25f45c82 100644 --- a/strace.c +++ b/strace.c @@ -2240,6 +2240,15 @@ Process %d attached (waiting for parent)\n", 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 printleader(tcp); tprintf("--- %s (%s) @ %lx (%lx) ---",