diff options
Diffstat (limited to 'src/pkg/runtime/linux/amd64')
-rw-r--r-- | src/pkg/runtime/linux/amd64/signal.c | 10 | ||||
-rw-r--r-- | src/pkg/runtime/linux/amd64/sys.s | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/pkg/runtime/linux/amd64/signal.c b/src/pkg/runtime/linux/amd64/signal.c index 9e501c96d..ea0932523 100644 --- a/src/pkg/runtime/linux/amd64/signal.c +++ b/src/pkg/runtime/linux/amd64/signal.c @@ -50,19 +50,18 @@ runtime·signame(int32 sig) } void -runtime·sighandler(int32 sig, Siginfo* info, void* context) +runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp) { Ucontext *uc; Mcontext *mc; Sigcontext *r; uintptr *sp; - G *gp; uc = context; mc = &uc->uc_mcontext; r = (Sigcontext*)mc; // same layout, more conveient names - if((gp = m->curg) != nil && (runtime·sigtab[sig].flags & SigPanic)) { + if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) { // Make it look like a call to the signal func. // Have to pass arguments out of band since // augmenting the stack frame would break @@ -106,12 +105,11 @@ runtime·sighandler(int32 sig, Siginfo* info, void* context) runtime·printf("\n"); if(runtime·gotraceback()){ - runtime·traceback((void*)r->rip, (void*)r->rsp, 0, g); - runtime·tracebackothers(g); + runtime·traceback((void*)r->rip, (void*)r->rsp, 0, gp); + runtime·tracebackothers(gp); runtime·dumpregs(r); } - runtime·breakpoint(); runtime·exit(2); } diff --git a/src/pkg/runtime/linux/amd64/sys.s b/src/pkg/runtime/linux/amd64/sys.s index 170b659fc..1bf734dc0 100644 --- a/src/pkg/runtime/linux/amd64/sys.s +++ b/src/pkg/runtime/linux/amd64/sys.s @@ -64,8 +64,8 @@ TEXT runtime·sigtramp(SB),7,$64 get_tls(BX) // save g - MOVQ g(BX), BP - MOVQ BP, 40(SP) + MOVQ g(BX), R10 + MOVQ R10, 40(SP) // g = m->gsignal MOVQ m(BX), BP @@ -75,12 +75,14 @@ TEXT runtime·sigtramp(SB),7,$64 MOVQ DI, 0(SP) MOVQ SI, 8(SP) MOVQ DX, 16(SP) + MOVQ R10, 24(SP) + CALL runtime·sighandler(SB) // restore g get_tls(BX) - MOVQ 40(SP), BP - MOVQ BP, g(BX) + MOVQ 40(SP), R10 + MOVQ R10, g(BX) RET TEXT runtime·sigignore(SB),7,$0 |