diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/pkg/runtime/arm/traceback.c | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/pkg/runtime/arm/traceback.c')
-rw-r--r-- | src/pkg/runtime/arm/traceback.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/pkg/runtime/arm/traceback.c b/src/pkg/runtime/arm/traceback.c index 0131f21d6..8289fdb28 100644 --- a/src/pkg/runtime/arm/traceback.c +++ b/src/pkg/runtime/arm/traceback.c @@ -16,9 +16,9 @@ gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, i lr = (uintptr)lr0; // If the PC is goexit, it hasn't started yet. - if(pc == (uintptr)goexit) { + if(pc == (uintptr)runtime·goexit) { pc = (uintptr)g->entry; - lr = (uintptr)goexit; + lr = (uintptr)runtime·goexit; } // If the PC is zero, it's likely a nil function call. @@ -31,7 +31,7 @@ gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, i n = 0; stk = (Stktop*)g->stackbase; for(iter = 0; iter < 100 && n < m; iter++) { // iter avoids looping forever - if(pc == (uintptr)·lessstack) { + if(pc == (uintptr)runtime·lessstack) { // Hit top of stack segment. Unwind to next segment. pc = (uintptr)stk->gobuf.pc; sp = stk->gobuf.sp; @@ -39,7 +39,7 @@ gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, i stk = (Stktop*)stk->stackbase; continue; } - if(pc <= 0x1000 || (f = findfunc(pc-4)) == nil) { + if(pc <= 0x1000 || (f = runtime·findfunc(pc-4)) == nil) { // TODO: Check for closure. break; } @@ -53,24 +53,24 @@ gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, i // Print during crash. // main+0xf /home/rsc/go/src/runtime/x.go:23 // main(0x1, 0x2, 0x3) - printf("%S", f->name); + runtime·printf("%S", f->name); if(pc > f->entry) - printf("+%p", (uintptr)(pc - f->entry)); + runtime·printf("+%p", (uintptr)(pc - f->entry)); tracepc = pc; // back up to CALL instruction for funcline. if(n > 0 && pc > f->entry) tracepc -= sizeof(uintptr); - printf(" %S:%d\n", f->src, funcline(f, tracepc)); - printf("\t%S(", f->name); + runtime·printf(" %S:%d\n", f->src, runtime·funcline(f, tracepc)); + runtime·printf("\t%S(", f->name); for(i = 0; i < f->args; i++) { if(i != 0) - prints(", "); - ·printhex(((uintptr*)sp)[1+i]); + runtime·prints(", "); + runtime·printhex(((uintptr*)sp)[1+i]); if(i >= 4) { - prints(", ..."); + runtime·prints(", ..."); break; } } - prints(")\n"); + runtime·prints(")\n"); n++; } @@ -85,19 +85,19 @@ gentraceback(byte *pc0, byte *sp, byte *lr0, G *g, int32 skip, uintptr *pcbuf, i } void -traceback(byte *pc0, byte *sp, byte *lr, G *g) +runtime·traceback(byte *pc0, byte *sp, byte *lr, G *g) { gentraceback(pc0, sp, lr, g, 0, nil, 100); } // func caller(n int) (pc uintptr, file string, line int, ok bool) int32 -callers(int32 skip, uintptr *pcbuf, int32 m) +runtime·callers(int32 skip, uintptr *pcbuf, int32 m) { byte *pc, *sp; - sp = getcallersp(&skip); - pc = ·getcallerpc(&skip); + sp = runtime·getcallersp(&skip); + pc = runtime·getcallerpc(&skip); return gentraceback(pc, sp, 0, g, skip, pcbuf, m); } |