aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.c
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-10-13 22:48:03 -0700
committerRob Pike <r@golang.org>2009-10-13 22:48:03 -0700
commitf6d67c9e95f61d17b62faaf1fc4c11fd1eba17e4 (patch)
treed916e40185b8ab30a2cdd3457cdc82570e8e6995 /src/pkg/runtime/runtime.c
parentbf983a0df21fd3408a0a07014fe5852aef28785f (diff)
downloadgo-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.c3
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