Commit 334bf95f authored by Jan Ziak's avatar Jan Ziak Committed by Russ Cox

runtime: update field types in preparation for GC changes

R=rsc, remyoudompheng, minux.ma, ality
CC=golang-dev
https://golang.org/cl/6242061
parent 586b6dfa
...@@ -235,7 +235,7 @@ unwindm(void) ...@@ -235,7 +235,7 @@ unwindm(void)
case '8': case '8':
case '6': case '6':
case '5': case '5':
m->g0->sched.sp = *(void**)m->g0->sched.sp; m->g0->sched.sp = *(uintptr*)m->g0->sched.sp;
break; break;
} }
} }
......
...@@ -539,7 +539,7 @@ addstackroots(G *gp) ...@@ -539,7 +539,7 @@ addstackroots(G *gp)
byte *sp, *guard; byte *sp, *guard;
stk = (Stktop*)gp->stackbase; stk = (Stktop*)gp->stackbase;
guard = gp->stackguard; guard = (byte*)gp->stackguard;
if(gp == g) { if(gp == g) {
// Scanning our own stack: start at &gp. // Scanning our own stack: start at &gp.
...@@ -550,17 +550,17 @@ addstackroots(G *gp) ...@@ -550,17 +550,17 @@ addstackroots(G *gp)
} else { } else {
// Scanning another goroutine's stack. // Scanning another goroutine's stack.
// The goroutine is usually asleep (the world is stopped). // The goroutine is usually asleep (the world is stopped).
sp = gp->sched.sp; sp = (byte*)gp->sched.sp;
// The exception is that if the goroutine is about to enter or might // The exception is that if the goroutine is about to enter or might
// have just exited a system call, it may be executing code such // have just exited a system call, it may be executing code such
// as schedlock and may have needed to start a new stack segment. // as schedlock and may have needed to start a new stack segment.
// Use the stack segment and stack pointer at the time of // Use the stack segment and stack pointer at the time of
// the system call instead, since that won't change underfoot. // the system call instead, since that won't change underfoot.
if(gp->gcstack != nil) { if(gp->gcstack != (uintptr)nil) {
stk = (Stktop*)gp->gcstack; stk = (Stktop*)gp->gcstack;
sp = gp->gcsp; sp = (byte*)gp->gcsp;
guard = gp->gcguard; guard = (byte*)gp->gcguard;
} }
} }
...@@ -571,7 +571,7 @@ addstackroots(G *gp) ...@@ -571,7 +571,7 @@ addstackroots(G *gp)
runtime·throw("scanstack"); runtime·throw("scanstack");
} }
addroot(sp, (byte*)stk - sp); addroot(sp, (byte*)stk - sp);
sp = stk->gobuf.sp; sp = (byte*)stk->gobuf.sp;
guard = stk->stackguard; guard = stk->stackguard;
stk = (Stktop*)stk->stackbase; stk = (Stktop*)stk->stackbase;
n++; n++;
......
...@@ -392,7 +392,7 @@ func GoroutineProfile(b Slice) (n int32, ok bool) { ...@@ -392,7 +392,7 @@ func GoroutineProfile(b Slice) (n int32, ok bool) {
for(gp = runtime·allg; gp != nil; gp = gp->alllink) { for(gp = runtime·allg; gp != nil; gp = gp->alllink) {
if(gp == g || gp->status == Gdead) if(gp == g || gp->status == Gdead)
continue; continue;
saveg(gp->sched.pc, gp->sched.sp, gp, r++); saveg(gp->sched.pc, (byte*)gp->sched.sp, gp, r++);
} }
} }
......
...@@ -318,7 +318,7 @@ runtime·tracebackothers(G *me) ...@@ -318,7 +318,7 @@ runtime·tracebackothers(G *me)
continue; continue;
runtime·printf("\n"); runtime·printf("\n");
runtime·goroutineheader(g); runtime·goroutineheader(g);
runtime·traceback(g->sched.pc, g->sched.sp, 0, g); runtime·traceback(g->sched.pc, (byte*)g->sched.sp, 0, g);
} }
} }
...@@ -849,7 +849,7 @@ runtime·newm(void) ...@@ -849,7 +849,7 @@ runtime·newm(void)
m->g0 = runtime·malg(-1); m->g0 = runtime·malg(-1);
else else
m->g0 = runtime·malg(8192); m->g0 = runtime·malg(8192);
runtime·newosproc(m, m->g0, m->g0->stackbase, runtime·mstart); runtime·newosproc(m, m->g0, (byte*)m->g0->stackbase, runtime·mstart);
} }
return m; return m;
...@@ -1034,7 +1034,7 @@ runtime·exitsyscall(void) ...@@ -1034,7 +1034,7 @@ runtime·exitsyscall(void)
g->status = Grunning; g->status = Grunning;
// Garbage collector isn't running (since we are), // Garbage collector isn't running (since we are),
// so okay to clear gcstack. // so okay to clear gcstack.
g->gcstack = nil; g->gcstack = (uintptr)nil;
if(m->profilehz > 0) if(m->profilehz > 0)
runtime·setprof(true); runtime·setprof(true);
...@@ -1059,7 +1059,7 @@ runtime·exitsyscall(void) ...@@ -1059,7 +1059,7 @@ runtime·exitsyscall(void)
// Must wait until now because until gosched returns // Must wait until now because until gosched returns
// we don't know for sure that the garbage collector // we don't know for sure that the garbage collector
// is not running. // is not running.
g->gcstack = nil; g->gcstack = (uintptr)nil;
} }
// Called from runtime·lessstack when returning from a function which // Called from runtime·lessstack when returning from a function which
...@@ -1090,9 +1090,9 @@ runtime·oldstack(void) ...@@ -1090,9 +1090,9 @@ runtime·oldstack(void)
USED(goid); USED(goid);
if(old.free != 0) if(old.free != 0)
runtime·stackfree(g1->stackguard - StackGuard, old.free); runtime·stackfree((byte*)g1->stackguard - StackGuard, old.free);
g1->stackbase = old.stackbase; g1->stackbase = (uintptr)old.stackbase;
g1->stackguard = old.stackguard; g1->stackguard = (uintptr)old.stackguard;
cret = m->cret; cret = m->cret;
m->cret = 0; // drop reference m->cret = 0; // drop reference
...@@ -1139,7 +1139,7 @@ runtime·newstack(void) ...@@ -1139,7 +1139,7 @@ runtime·newstack(void)
// the new Stktop* is necessary to unwind, but // the new Stktop* is necessary to unwind, but
// we don't need to create a new segment. // we don't need to create a new segment.
top = (Stktop*)(m->morebuf.sp - sizeof(*top)); top = (Stktop*)(m->morebuf.sp - sizeof(*top));
stk = g1->stackguard - StackGuard; stk = (byte*)g1->stackguard - StackGuard;
free = 0; free = 0;
} else { } else {
// allocate new segment. // allocate new segment.
...@@ -1156,22 +1156,22 @@ runtime·newstack(void) ...@@ -1156,22 +1156,22 @@ runtime·newstack(void)
//runtime·printf("newstack framesize=%d argsize=%d morepc=%p moreargp=%p gobuf=%p, %p top=%p old=%p\n", //runtime·printf("newstack framesize=%d argsize=%d morepc=%p moreargp=%p gobuf=%p, %p top=%p old=%p\n",
//framesize, argsize, m->morepc, m->moreargp, m->morebuf.pc, m->morebuf.sp, top, g1->stackbase); //framesize, argsize, m->morepc, m->moreargp, m->morebuf.pc, m->morebuf.sp, top, g1->stackbase);
top->stackbase = g1->stackbase; top->stackbase = (byte*)g1->stackbase;
top->stackguard = g1->stackguard; top->stackguard = (byte*)g1->stackguard;
top->gobuf = m->morebuf; top->gobuf = m->morebuf;
top->argp = m->moreargp; top->argp = m->moreargp;
top->argsize = argsize; top->argsize = argsize;
top->free = free; top->free = free;
m->moreargp = nil; m->moreargp = nil;
m->morebuf.pc = nil; m->morebuf.pc = nil;
m->morebuf.sp = nil; m->morebuf.sp = (uintptr)nil;
// copy flag from panic // copy flag from panic
top->panic = g1->ispanic; top->panic = g1->ispanic;
g1->ispanic = false; g1->ispanic = false;
g1->stackbase = (byte*)top; g1->stackbase = (uintptr)top;
g1->stackguard = stk + StackGuard; g1->stackguard = (uintptr)stk + StackGuard;
sp = (byte*)top; sp = (byte*)top;
if(argsize > 0) { if(argsize > 0) {
...@@ -1186,7 +1186,7 @@ runtime·newstack(void) ...@@ -1186,7 +1186,7 @@ runtime·newstack(void)
// Continue as if lessstack had just called m->morepc // Continue as if lessstack had just called m->morepc
// (the PC that decided to grow the stack). // (the PC that decided to grow the stack).
label.sp = sp; label.sp = (uintptr)sp;
label.pc = (byte*)runtime·lessstack; label.pc = (byte*)runtime·lessstack;
label.g = m->curg; label.g = m->curg;
runtime·gogocall(&label, m->morepc); runtime·gogocall(&label, m->morepc);
...@@ -1229,10 +1229,10 @@ runtime·malg(int32 stacksize) ...@@ -1229,10 +1229,10 @@ runtime·malg(int32 stacksize)
stk = g->param; stk = g->param;
g->param = nil; g->param = nil;
} }
newg->stack0 = stk; newg->stack0 = (uintptr)stk;
newg->stackguard = stk + StackGuard; newg->stackguard = (uintptr)stk + StackGuard;
newg->stackbase = stk + StackSystem + stacksize - sizeof(Stktop); newg->stackbase = (uintptr)stk + StackSystem + stacksize - sizeof(Stktop);
runtime·memclr(newg->stackbase, sizeof(Stktop)); runtime·memclr((byte*)newg->stackbase, sizeof(Stktop));
} }
return newg; return newg;
} }
...@@ -1295,7 +1295,7 @@ runtime·newproc1(byte *fn, byte *argp, int32 narg, int32 nret, void *callerpc) ...@@ -1295,7 +1295,7 @@ runtime·newproc1(byte *fn, byte *argp, int32 narg, int32 nret, void *callerpc)
newg->status = Gwaiting; newg->status = Gwaiting;
newg->waitreason = "new goroutine"; newg->waitreason = "new goroutine";
sp = newg->stackbase; sp = (byte*)newg->stackbase;
sp -= siz; sp -= siz;
runtime·memmove(sp, argp, narg); runtime·memmove(sp, argp, narg);
if(thechar == '5') { if(thechar == '5') {
...@@ -1304,7 +1304,7 @@ runtime·newproc1(byte *fn, byte *argp, int32 narg, int32 nret, void *callerpc) ...@@ -1304,7 +1304,7 @@ runtime·newproc1(byte *fn, byte *argp, int32 narg, int32 nret, void *callerpc)
*(void**)sp = nil; *(void**)sp = nil;
} }
newg->sched.sp = sp; newg->sched.sp = (uintptr)sp;
newg->sched.pc = (byte*)runtime·goexit; newg->sched.pc = (byte*)runtime·goexit;
newg->sched.g = newg; newg->sched.g = newg;
newg->entry = fn; newg->entry = fn;
...@@ -1332,8 +1332,12 @@ uintptr ...@@ -1332,8 +1332,12 @@ uintptr
runtime·deferproc(int32 siz, byte* fn, ...) runtime·deferproc(int32 siz, byte* fn, ...)
{ {
Defer *d; Defer *d;
int32 mallocsiz;
d = runtime·malloc(sizeof(*d) + siz - sizeof(d->args));
mallocsiz = sizeof(*d);
if(siz > sizeof(d->args))
mallocsiz += siz - sizeof(d->args);
d = runtime·malloc(mallocsiz);
d->fn = fn; d->fn = fn;
d->siz = siz; d->siz = siz;
d->pc = runtime·getcallerpc(&siz); d->pc = runtime·getcallerpc(&siz);
...@@ -1394,7 +1398,7 @@ rundefer(void) ...@@ -1394,7 +1398,7 @@ rundefer(void)
while((d = g->defer) != nil) { while((d = g->defer) != nil) {
g->defer = d->link; g->defer = d->link;
reflect·call(d->fn, d->args, d->siz); reflect·call(d->fn, (byte*)d->args, d->siz);
if(!d->nofree) if(!d->nofree)
runtime·free(d); runtime·free(d);
} }
...@@ -1413,16 +1417,16 @@ unwindstack(G *gp, byte *sp) ...@@ -1413,16 +1417,16 @@ unwindstack(G *gp, byte *sp)
runtime·throw("unwindstack on self"); runtime·throw("unwindstack on self");
while((top = (Stktop*)gp->stackbase) != nil && top->stackbase != nil) { while((top = (Stktop*)gp->stackbase) != nil && top->stackbase != nil) {
stk = gp->stackguard - StackGuard; stk = (byte*)gp->stackguard - StackGuard;
if(stk <= sp && sp < gp->stackbase) if(stk <= sp && sp < (byte*)gp->stackbase)
break; break;
gp->stackbase = top->stackbase; gp->stackbase = (uintptr)top->stackbase;
gp->stackguard = top->stackguard; gp->stackguard = (uintptr)top->stackguard;
if(top->free != 0) if(top->free != 0)
runtime·stackfree(stk, top->free); runtime·stackfree(stk, top->free);
} }
if(sp != nil && (sp < gp->stackguard - StackGuard || gp->stackbase < sp)) { if(sp != nil && (sp < (byte*)gp->stackguard - StackGuard || (byte*)gp->stackbase < sp)) {
runtime·printf("recover: %p not in [%p, %p]\n", sp, gp->stackguard - StackGuard, gp->stackbase); runtime·printf("recover: %p not in [%p, %p]\n", sp, gp->stackguard - StackGuard, gp->stackbase);
runtime·throw("bad unwindstack"); runtime·throw("bad unwindstack");
} }
...@@ -1455,7 +1459,7 @@ runtime·panic(Eface e) ...@@ -1455,7 +1459,7 @@ runtime·panic(Eface e)
p = runtime·mal(sizeof *p); p = runtime·mal(sizeof *p);
p->arg = e; p->arg = e;
p->link = g->panic; p->link = g->panic;
p->stackbase = g->stackbase; p->stackbase = (byte*)g->stackbase;
g->panic = p; g->panic = p;
for(;;) { for(;;) {
...@@ -1465,7 +1469,7 @@ runtime·panic(Eface e) ...@@ -1465,7 +1469,7 @@ runtime·panic(Eface e)
// take defer off list in case of recursive panic // take defer off list in case of recursive panic
g->defer = d->link; g->defer = d->link;
g->ispanic = true; // rock for newstack, where reflect.call ends up g->ispanic = true; // rock for newstack, where reflect.call ends up
reflect·call(d->fn, d->args, d->siz); reflect·call(d->fn, (byte*)d->args, d->siz);
if(p->recovered) { if(p->recovered) {
g->panic = p->link; g->panic = p->link;
if(g->panic == nil) // must be done with signal if(g->panic == nil) // must be done with signal
...@@ -1513,9 +1517,9 @@ recovery(G *gp) ...@@ -1513,9 +1517,9 @@ recovery(G *gp)
// before it tests the return value.) // before it tests the return value.)
// On the arm there are 2 saved LRs mixed in too. // On the arm there are 2 saved LRs mixed in too.
if(thechar == '5') if(thechar == '5')
gp->sched.sp = (byte*)d->argp - 4*sizeof(uintptr); gp->sched.sp = (uintptr)d->argp - 4*sizeof(uintptr);
else else
gp->sched.sp = (byte*)d->argp - 2*sizeof(uintptr); gp->sched.sp = (uintptr)d->argp - 2*sizeof(uintptr);
gp->sched.pc = d->pc; gp->sched.pc = d->pc;
if(!d->nofree) if(!d->nofree)
runtime·free(d); runtime·free(d);
......
...@@ -167,7 +167,7 @@ struct Slice ...@@ -167,7 +167,7 @@ struct Slice
struct Gobuf struct Gobuf
{ {
// The offsets of these fields are known to (hard-coded in) libmach. // The offsets of these fields are known to (hard-coded in) libmach.
byte* sp; uintptr sp;
byte* pc; byte* pc;
G* g; G* g;
}; };
...@@ -183,15 +183,15 @@ struct GCStats ...@@ -183,15 +183,15 @@ struct GCStats
}; };
struct G struct G
{ {
byte* stackguard; // cannot move - also known to linker, libmach, runtime/cgo uintptr stackguard; // cannot move - also known to linker, libmach, runtime/cgo
byte* stackbase; // cannot move - also known to libmach, runtime/cgo uintptr stackbase; // cannot move - also known to libmach, runtime/cgo
Defer* defer; Defer* defer;
Panic* panic; Panic* panic;
Gobuf sched; Gobuf sched;
byte* gcstack; // if status==Gsyscall, gcstack = stackbase to use during gc uintptr gcstack; // if status==Gsyscall, gcstack = stackbase to use during gc
byte* gcsp; // if status==Gsyscall, gcsp = sched.sp to use during gc uintptr gcsp; // if status==Gsyscall, gcsp = sched.sp to use during gc
byte* gcguard; // if status==Gsyscall, gcguard = stackguard to use during gc uintptr gcguard; // if status==Gsyscall, gcguard = stackguard to use during gc
byte* stack0; uintptr stack0;
byte* entry; // initial function byte* entry; // initial function
G* alllink; // on allg G* alllink; // on allg
void* param; // passed parameter on wakeup void* param; // passed parameter on wakeup
...@@ -486,7 +486,7 @@ struct Defer ...@@ -486,7 +486,7 @@ struct Defer
byte* pc; byte* pc;
byte* fn; byte* fn;
Defer* link; Defer* link;
byte args[8]; // padded to actual size void* args[1]; // padded to actual size
}; };
/* /*
......
...@@ -114,7 +114,7 @@ runtime·minit(void) ...@@ -114,7 +114,7 @@ runtime·minit(void)
{ {
// Initialize signal handling. // Initialize signal handling.
m->gsignal = runtime·malg(32*1024); // OS X wants >=8K, Linux >=2K m->gsignal = runtime·malg(32*1024); // OS X wants >=8K, Linux >=2K
runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024); runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024);
if(m->profilehz > 0) if(m->profilehz > 0)
runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil); runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil);
......
...@@ -126,7 +126,7 @@ runtime·minit(void) ...@@ -126,7 +126,7 @@ runtime·minit(void)
{ {
// Initialize signal handling // Initialize signal handling
m->gsignal = runtime·malg(32*1024); m->gsignal = runtime·malg(32*1024);
runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024); runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024);
runtime·sigprocmask(&sigset_none, nil); runtime·sigprocmask(&sigset_none, nil);
} }
......
...@@ -186,7 +186,7 @@ runtime·minit(void) ...@@ -186,7 +186,7 @@ runtime·minit(void)
{ {
// Initialize signal handling. // Initialize signal handling.
m->gsignal = runtime·malg(32*1024); // OS X wants >=8K, Linux >=2K m->gsignal = runtime·malg(32*1024); // OS X wants >=8K, Linux >=2K
runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024); runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024);
runtime·rtsigprocmask(SIG_SETMASK, &sigset_none, nil, sizeof sigset_none); runtime·rtsigprocmask(SIG_SETMASK, &sigset_none, nil, sizeof sigset_none);
} }
......
...@@ -198,7 +198,7 @@ runtime·minit(void) ...@@ -198,7 +198,7 @@ runtime·minit(void)
{ {
// Initialize signal handling // Initialize signal handling
m->gsignal = runtime·malg(32*1024); m->gsignal = runtime·malg(32*1024);
runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024); runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024);
runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil); runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil);
} }
......
...@@ -171,7 +171,7 @@ runtime·minit(void) ...@@ -171,7 +171,7 @@ runtime·minit(void)
{ {
// Initialize signal handling // Initialize signal handling
m->gsignal = runtime·malg(32*1024); m->gsignal = runtime·malg(32*1024);
runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024); runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024);
runtime·sigprocmask(SIG_SETMASK, sigset_none); runtime·sigprocmask(SIG_SETMASK, sigset_none);
} }
......
...@@ -57,7 +57,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -57,7 +57,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
if(pc == (uintptr)runtime·lessstack) { if(pc == (uintptr)runtime·lessstack) {
// Hit top of stack segment. Unwind to next segment. // Hit top of stack segment. Unwind to next segment.
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
sp = stk->gobuf.sp; sp = (byte*)stk->gobuf.sp;
lr = 0; lr = 0;
fp = nil; fp = nil;
if(pcbuf == nil) if(pcbuf == nil)
...@@ -151,7 +151,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -151,7 +151,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
pc = (uintptr)m->morepc; pc = (uintptr)m->morepc;
sp = (byte*)m->moreargp - sizeof(void*); sp = (byte*)m->moreargp - sizeof(void*);
lr = (uintptr)m->morebuf.pc; lr = (uintptr)m->morebuf.pc;
fp = m->morebuf.sp; fp = (byte*)m->morebuf.sp;
g = m->curg; g = m->curg;
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
continue; continue;
...@@ -161,7 +161,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -161,7 +161,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
runtime·printf("----- lessstack called from goroutine %d -----\n", m->curg->goid); runtime·printf("----- lessstack called from goroutine %d -----\n", m->curg->goid);
g = m->curg; g = m->curg;
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
sp = stk->gobuf.sp; sp = (byte*)stk->gobuf.sp;
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
fp = nil; fp = nil;
lr = 0; lr = 0;
......
...@@ -40,7 +40,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -40,7 +40,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
waspanic = false; waspanic = false;
// If the PC is goexit, the goroutine hasn't started yet. // If the PC is goexit, the goroutine hasn't started yet.
if(pc0 == g->sched.pc && sp == g->sched.sp && pc0 == (byte*)runtime·goexit) { if(pc0 == g->sched.pc && sp == (byte*)g->sched.sp && pc0 == (byte*)runtime·goexit) {
fp = sp; fp = sp;
lr = pc; lr = pc;
pc = (uintptr)g->entry; pc = (uintptr)g->entry;
...@@ -74,7 +74,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -74,7 +74,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
if(pc == (uintptr)runtime·lessstack) { if(pc == (uintptr)runtime·lessstack) {
// Hit top of stack segment. Unwind to next segment. // Hit top of stack segment. Unwind to next segment.
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
sp = stk->gobuf.sp; sp = (byte*)stk->gobuf.sp;
lr = 0; lr = 0;
fp = nil; fp = nil;
if(pcbuf == nil) if(pcbuf == nil)
...@@ -167,9 +167,9 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -167,9 +167,9 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
// use it to keep unwinding the stack. // use it to keep unwinding the stack.
runtime·printf("----- morestack called from goroutine %d -----\n", m->curg->goid); runtime·printf("----- morestack called from goroutine %d -----\n", m->curg->goid);
pc = (uintptr)m->morepc; pc = (uintptr)m->morepc;
sp = m->morebuf.sp - sizeof(void*); sp = (byte*)m->morebuf.sp - sizeof(void*);
lr = (uintptr)m->morebuf.pc; lr = (uintptr)m->morebuf.pc;
fp = m->morebuf.sp; fp = (byte*)m->morebuf.sp;
sawnewstack = 0; sawnewstack = 0;
g = m->curg; g = m->curg;
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
...@@ -181,7 +181,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr ...@@ -181,7 +181,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr
runtime·printf("----- lessstack called from goroutine %d -----\n", m->curg->goid); runtime·printf("----- lessstack called from goroutine %d -----\n", m->curg->goid);
g = m->curg; g = m->curg;
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
sp = stk->gobuf.sp; sp = (byte*)stk->gobuf.sp;
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
fp = nil; fp = nil;
lr = 0; lr = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment