diff options
| author | Dmitry V. Levin <ldv@altlinux.org> | 2011-03-10 14:44:45 +0000 |
|---|---|---|
| committer | Dmitry V. Levin <ldv@altlinux.org> | 2011-03-10 22:25:03 +0000 |
| commit | c15dfc796150d09bb74bebfbb85bebf142766b6c (patch) | |
| tree | a413a06839a366786273a23e03c43e12c760d608 | |
| parent | b41e1c90f0c0791ccf524323fffc96c04646c4d4 (diff) | |
| download | strace-c15dfc796150d09bb74bebfbb85bebf142766b6c.tar.gz | |
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.
| -rw-r--r-- | strace.c | 18 |
1 files changed, 5 insertions, 13 deletions
@@ -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)), |
