]> granicus.if.org Git - strace/blobdiff - printsiginfo.c
Add a enum for decoding to tprint_iov() and tprint_iov_upto()
[strace] / printsiginfo.c
index 78508df31abdb7b5adb2e16056d428686a9ca5e2..699460f3f25ce6352e801ac084d6b60ead1b4d4f 100644 (file)
@@ -76,8 +76,9 @@ printsigsource(const siginfo_t *sip)
 static void
 printsigval(const siginfo_t *sip)
 {
-       tprintf(", si_value={int=%d, ptr=%#lx}",
-               sip->si_int, (unsigned long) sip->si_ptr);
+       tprintf(", si_value={int=%d, ptr=", sip->si_int);
+       printaddr((unsigned long) sip->si_ptr);
+       tprints("}");
 }
 
 static void
@@ -171,13 +172,13 @@ print_si_info(const siginfo_t *sip)
                        else
                                printsignal(sip->si_status);
                        tprintf(", si_utime=%llu, si_stime=%llu",
-                               (unsigned long long) sip->si_utime,
-                               (unsigned long long) sip->si_stime);
+                               widen_to_ull(sip->si_utime),
+                               widen_to_ull(sip->si_stime));
                        break;
                case SIGILL: case SIGFPE:
                case SIGSEGV: case SIGBUS:
-                       tprintf(", si_addr=%#lx",
-                               (unsigned long) sip->si_addr);
+                       tprints(", si_addr=");
+                       printaddr((unsigned long) sip->si_addr);
                        break;
                case SIGPOLL:
                        switch (sip->si_code) {
@@ -189,8 +190,9 @@ print_si_info(const siginfo_t *sip)
                        break;
 #ifdef HAVE_SIGINFO_T_SI_SYSCALL
                case SIGSYS:
-                       tprintf(", si_call_addr=%#lx, si_syscall=__NR_%s, si_arch=",
-                               (unsigned long) sip->si_call_addr,
+                       tprints(", si_call_addr=");
+                       printaddr((unsigned long) sip->si_call_addr);
+                       tprintf(", si_syscall=__NR_%s, si_arch=",
                                syscall_name((unsigned) sip->si_syscall));
                        printxval(audit_arch, sip->si_arch, "AUDIT_ARCH_???");
                        break;
@@ -228,7 +230,8 @@ printsiginfo(const siginfo_t *sip)
        tprints("}");
 }
 
-MPERS_PRINTER_DECL(void, printsiginfo_at)(struct tcb *tcp, long addr)
+MPERS_PRINTER_DECL(void, printsiginfo_at,
+                  struct tcb *tcp, long addr)
 {
        siginfo_t si;
 
@@ -243,7 +246,8 @@ print_siginfo_t(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
        return true;
 }
 
-MPERS_PRINTER_DECL(void, print_siginfo_array)(struct tcb *tcp, unsigned long addr, unsigned long len)
+MPERS_PRINTER_DECL(void, print_siginfo_array,
+                  struct tcb *tcp, unsigned long addr, unsigned long len)
 {
        siginfo_t si;