]> granicus.if.org Git - strace/commitdiff
2005-03-06 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Sun, 6 Mar 2005 22:24:29 +0000 (22:24 +0000)
committerRoland McGrath <roland@redhat.com>
Sun, 6 Mar 2005 22:24:29 +0000 (22:24 +0000)
* strace.c (trace) [PTRACE_GETSIGINFO]: Fetch siginfo_t for SIGSEGV
and SIGBUS signals, use si_addr in output.

strace.c

index ac83703d3d19572a557d83183ee7eef7091d90a9..25f45c823187516cdab566ad0de504b1c9dbb031 100644 (file)
--- 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) ---",