summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2011-03-10 14:44:45 +0000
committerDmitry V. Levin <ldv@altlinux.org>2011-03-10 22:25:03 +0000
commitc15dfc796150d09bb74bebfbb85bebf142766b6c (patch)
treea413a06839a366786273a23e03c43e12c760d608
parentb41e1c90f0c0791ccf524323fffc96c04646c4d4 (diff)
downloadstrace-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.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/strace.c b/strace.c
index 89fda4f09..42d436e1a 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)),