+ static void reg_dump(FILE *fp,sigregs_t *rp)
+ {
+ fprintf(fp,"REGS:\n");
+- fprintf(fp," r8: %20p %jd\n", (void*)rp->r8,rp->r8);
+- fprintf(fp," r9: %20p %jd\n", (void*)rp->r9,rp->r9);
+- fprintf(fp," r10: %20p %jd\n", (void*)rp->r10,rp->r10);
+- fprintf(fp," r11: %20p %jd\n", (void*)rp->r11,rp->r11);
+- fprintf(fp," r12: %20p %jd\n", (void*)rp->r12,rp->r12);
+- fprintf(fp," r13: %20p %jd\n", (void*)rp->r13,rp->r13);
+- fprintf(fp," r14: %20p %jd\n", (void*)rp->r14,rp->r14);
+- fprintf(fp," r15: %20p %jd\n", (void*)rp->r15,rp->r15);
+- fprintf(fp," rdi: %20p %jd\n", (void*)rp->rdi,rp->rdi);
+- fprintf(fp," rsi: %20p %jd\n", (void*)rp->rsi,rp->rsi);
+- fprintf(fp," rbp: %20p %jd\n", (void*)rp->rbp,rp->rbp);
+- fprintf(fp," rbx: %20p %jd\n", (void*)rp->rbx,rp->rbx);
+- fprintf(fp," rdx: %20p %jd\n", (void*)rp->rdx,rp->rdx);
+- fprintf(fp," rax: %20p %jd\n", (void*)rp->rax,rp->rax);
+- fprintf(fp," rcx: %20p %jd\n", (void*)rp->rcx,rp->rcx);
+- fprintf(fp," rsp: %20p %jd\n", (void*)rp->rsp,rp->rsp);
+- fprintf(fp," rip: %20p %jd\n", (void*)rp->rip,rp->rip);
+- fprintf(fp," eflags: %14p %jd\n", (void*)rp->eflags,rp->eflags);
+- fprintf(fp," cs: %04x\n", rp->cs);
+- fprintf(fp," gs: %04x\n", rp->gs);
+- fprintf(fp," fs: %04x\n", rp->fs);
+- fprintf(fp," err: %20p %jd\n", (void*)rp->err,rp->err);
+- fprintf(fp," trapno: %20p %jd\n", (void*)rp->trapno,rp->trapno);
+- fprintf(fp," oldmask: %20p %jd\n", (void*)rp->oldmask,rp->oldmask);
+- fprintf(fp," cr2: %20p %jd\n", (void*)rp->cr2,rp->cr2);
++ fprintf(fp," r8: %20p %jd\n", (void*)rp->mc_r8,rp->mc_r8);
++ fprintf(fp," r9: %20p %jd\n", (void*)rp->mc_r9,rp->mc_r9);
++ fprintf(fp," r10: %20p %jd\n", (void*)rp->mc_r10,rp->mc_r10);
++ fprintf(fp," r11: %20p %jd\n", (void*)rp->mc_r11,rp->mc_r11);
++ fprintf(fp," r12: %20p %jd\n", (void*)rp->mc_r12,rp->mc_r12);
++ fprintf(fp," r13: %20p %jd\n", (void*)rp->mc_r13,rp->mc_r13);
++ fprintf(fp," r14: %20p %jd\n", (void*)rp->mc_r14,rp->mc_r14);
++ fprintf(fp," r15: %20p %jd\n", (void*)rp->mc_r15,rp->mc_r15);
++ fprintf(fp," rdi: %20p %jd\n", (void*)rp->mc_rdi,rp->mc_rdi);
++ fprintf(fp," rsi: %20p %jd\n", (void*)rp->mc_rsi,rp->mc_rsi);
++ fprintf(fp," rbp: %20p %jd\n", (void*)rp->mc_rbp,rp->mc_rbp);
++ fprintf(fp," rbx: %20p %jd\n", (void*)rp->mc_rbx,rp->mc_rbx);
++ fprintf(fp," rdx: %20p %jd\n", (void*)rp->mc_rdx,rp->mc_rdx);
++ fprintf(fp," rax: %20p %jd\n", (void*)rp->mc_rax,rp->mc_rax);
++ fprintf(fp," rcx: %20p %jd\n", (void*)rp->mc_rcx,rp->mc_rcx);
++ fprintf(fp," rsp: %20p %jd\n", (void*)rp->mc_rsp,rp->mc_rsp);
++ fprintf(fp," rip: %20p %jd\n", (void*)rp->mc_rip,rp->mc_rip);
++ fprintf(fp," eflags: %14p %u\n", (void*)((unsigned long)rp->mc_flags),rp->mc_flags);
++ fprintf(fp," cs: %04x\n", (unsigned)rp->mc_cs);
++ fprintf(fp," gs: %04x\n", (unsigned)rp->mc_gs);
++ fprintf(fp," fs: %04x\n", (unsigned)rp->mc_fs);
++ fprintf(fp," err: %20p %jd\n", (void*)rp->mc_err,rp->mc_err);
++ fprintf(fp," trapno: %20p %d\n", (void*)((unsigned long)rp->mc_trapno),rp->mc_trapno);
++// fprintf(fp," oldmask: %20p %jd\n", (void*)rp->mc_oldmask,rp->mc_oldmask);
++// fprintf(fp," cr2: %20p %jd\n", (void*)rp->mc_cr2,rp->mc_cr2);
+ fprintf(fp,"\n");
+ }
+
+@@ -476,7 +468,7 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
+ // if( uid != 0 ) return;
+ ucontext_t *uc = (ucontext_t *)sc;
+ int pid = getpid(), tid = gettid();
+- struct sigregs_t *c = (struct sigregs_t *)&uc->uc_mcontext;
++ sigregs_t *c = (sigregs_t *)&uc->uc_mcontext;
+ uint8_t *ip = (uint8_t *)c->IP;
+ fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
+ n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
+@@ -545,26 +537,5 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
+ reg_dump(fp, c);