diff options
| author | Rob Pike <r@golang.org> | 2009-10-13 22:48:03 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-10-13 22:48:03 -0700 |
| commit | f6d67c9e95f61d17b62faaf1fc4c11fd1eba17e4 (patch) | |
| tree | d916e40185b8ab30a2cdd3457cdc82570e8e6995 /src/pkg/runtime/runtime.c | |
| parent | bf983a0df21fd3408a0a07014fe5852aef28785f (diff) | |
| download | go-f6d67c9e95f61d17b62faaf1fc4c11fd1eba17e4.tar.xz | |
write stack traces and panics to stderr
R=rsc
DELTA=31 (5 added, 3 deleted, 23 changed)
OCL=35700
CL=35700
Diffstat (limited to 'src/pkg/runtime/runtime.c')
| -rw-r--r-- | src/pkg/runtime/runtime.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 6f359e1846..4dcd3da150 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -6,6 +6,7 @@ int32 panicking = 0; int32 maxround = sizeof(uintptr); +int32 fd = 1; int32 gotraceback(void) @@ -23,6 +24,7 @@ sys·panicl(int32 lno) { uint8 *sp; + fd = 2; if(panicking) { printf("double panic\n"); exit(3); @@ -66,6 +68,7 @@ sys·throwinit(void) void throw(int8 *s) { + fd = 2; printf("throw: %s\n", s); sys·panicl(-1); *(int32*)0 = 0; // not reached |
