diff options
| author | Jingcheng Zhang <diogin@gmail.com> | 2012-12-19 00:30:29 +0800 |
|---|---|---|
| committer | Shenghou Ma <minux.ma@gmail.com> | 2012-12-19 00:30:29 +0800 |
| commit | 70e967b7bc6583735c098a91395b9f42b017e006 (patch) | |
| tree | 552bd91d9d3fcba81b6b9dd06e24340889c56402 /src/pkg/runtime/traceback_arm.c | |
| parent | a9d82423110dc39ede4503ea120db1d739119a8f (diff) | |
| download | go-70e967b7bc6583735c098a91395b9f42b017e006.tar.xz | |
runtime: use "mp" and "gp" instead of "m" and "g" for local variable name to avoid confusion with the global "m" and "g".
R=golang-dev, minux.ma, rsc
CC=bradfitz, golang-dev
https://golang.org/cl/6939064
Diffstat (limited to 'src/pkg/runtime/traceback_arm.c')
| -rw-r--r-- | src/pkg/runtime/traceback_arm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c index c92feb6ed8..e67ccd4153 100644 --- a/src/pkg/runtime/traceback_arm.c +++ b/src/pkg/runtime/traceback_arm.c @@ -17,7 +17,7 @@ void _divu(void); void _modu(void); int32 -runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, int32 max) +runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *gp, int32 skip, uintptr *pcbuf, int32 max) { int32 i, n, iter; uintptr pc, lr, tracepc, x; @@ -33,7 +33,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr // If the PC is goexit, the goroutine hasn't started yet. if(pc == (uintptr)runtime·goexit) { - pc = (uintptr)g->entry; + pc = (uintptr)gp->entry; lr = (uintptr)runtime·goexit; } @@ -45,7 +45,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr } n = 0; - stk = (Stktop*)g->stackbase; + stk = (Stktop*)gp->stackbase; for(iter = 0; iter < 100 && n < max; iter++) { // iter avoids looping forever // Typically: // pc is the PC of the running function. @@ -146,21 +146,21 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr waspanic = f->entry == (uintptr)runtime·sigpanic; - if(pcbuf == nil && f->entry == (uintptr)runtime·newstack && g == m->g0) { + if(pcbuf == nil && f->entry == (uintptr)runtime·newstack && gp == m->g0) { runtime·printf("----- newstack called from goroutine %D -----\n", m->curg->goid); pc = (uintptr)m->morepc; sp = (byte*)m->moreargp - sizeof(void*); lr = (uintptr)m->morebuf.pc; fp = (byte*)m->morebuf.sp; - g = m->curg; - stk = (Stktop*)g->stackbase; + gp = m->curg; + stk = (Stktop*)gp->stackbase; continue; } - if(pcbuf == nil && f->entry == (uintptr)runtime·lessstack && g == m->g0) { + if(pcbuf == nil && f->entry == (uintptr)runtime·lessstack && gp == m->g0) { runtime·printf("----- lessstack called from goroutine %D -----\n", m->curg->goid); - g = m->curg; - stk = (Stktop*)g->stackbase; + gp = m->curg; + stk = (Stktop*)gp->stackbase; sp = (byte*)stk->gobuf.sp; pc = (uintptr)stk->gobuf.pc; fp = nil; @@ -184,7 +184,7 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr sp += 12; } - if(pcbuf == nil && (pc = g->gopc) != 0 && (f = runtime·findfunc(pc)) != nil && g->goid != 1) { + if(pcbuf == nil && (pc = gp->gopc) != 0 && (f = runtime·findfunc(pc)) != nil && gp->goid != 1) { runtime·printf("created by %S\n", f->name); tracepc = pc; // back up to CALL instruction for funcline. if(n > 0 && pc > f->entry) @@ -199,9 +199,9 @@ runtime·gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr } void -runtime·traceback(byte *pc0, byte *sp, byte *lr, G *g) +runtime·traceback(byte *pc0, byte *sp, byte *lr, G *gp) { - runtime·gentraceback(pc0, sp, lr, g, 0, nil, 100); + runtime·gentraceback(pc0, sp, lr, gp, 0, nil, 100); } // func caller(n int) (pc uintptr, file string, line int, ok bool) |
