1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:44:40 -07:00

runtime: fix crash trace on amd64

g is not in r15 anymore.
now it's in a per-thread memory segment,
which is valid even inside a signal handler,
so we can just refer to g directly.

Fixes #1082.

R=r
CC=golang-dev
https://golang.org/cl/2149045
This commit is contained in:
Russ Cox 2010-09-11 00:26:56 -04:00
parent 0aa2317096
commit befecf6b59
3 changed files with 6 additions and 6 deletions

View File

@ -112,8 +112,8 @@ sighandler(int32 sig, Siginfo *info, void *context)
printf("\n");
if(gotraceback()){
traceback((void*)r->rip, (void*)r->rsp, 0, (void*)r->r15);
tracebackothers((void*)r->r15);
traceback((void*)r->rip, (void*)r->rsp, 0, g);
tracebackothers(g);
dumpregs(r);
}

View File

@ -106,8 +106,8 @@ sighandler(int32 sig, Siginfo* info, void* context)
printf("\n");
if(gotraceback()){
traceback((void*)r->mc_rip, (void*)r->mc_rsp, 0, (void*)r->mc_r15);
tracebackothers((void*)r->mc_r15);
traceback((void*)r->mc_rip, (void*)r->mc_rsp, 0, g);
tracebackothers(g);
dumpregs(r);
}

View File

@ -105,8 +105,8 @@ sighandler(int32 sig, Siginfo* info, void* context)
printf("\n");
if(gotraceback()){
traceback((void*)r->rip, (void*)r->rsp, 0, (void*)r->r15);
tracebackothers((void*)r->r15);
traceback((void*)r->rip, (void*)r->rsp, 0, g);
tracebackothers(g);
dumpregs(r);
}