LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch_GOARCH.h" | 6 #include "arch_GOARCH.h" |
7 #include "stack.h" | 7 #include "stack.h" |
8 | 8 |
9 // Code related to defer, panic and recover. | 9 // Code related to defer, panic and recover. |
10 | 10 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 { | 294 { |
295 if(m->dying) { | 295 if(m->dying) { |
296 runtime·printf("panic during panic\n"); | 296 runtime·printf("panic during panic\n"); |
297 runtime·exit(3); | 297 runtime·exit(3); |
298 } | 298 } |
299 m->dying = 1; | 299 m->dying = 1; |
300 runtime·xadd(&runtime·panicking, 1); | 300 runtime·xadd(&runtime·panicking, 1); |
301 runtime·lock(&paniclk); | 301 runtime·lock(&paniclk); |
302 } | 302 } |
303 | 303 |
| 304 extern String runtime·panicvers; // defined in extern.go |
| 305 |
304 void | 306 void |
305 runtime·dopanic(int32 unused) | 307 runtime·dopanic(int32 unused) |
306 { | 308 { |
307 static bool didothers; | 309 static bool didothers; |
308 | 310 |
309 if(g->sig != 0) | 311 if(g->sig != 0) |
310 runtime·printf("[signal %x code=%p addr=%p pc=%p]\n", | 312 runtime·printf("[signal %x code=%p addr=%p pc=%p]\n", |
311 g->sig, g->sigcode0, g->sigcode1, g->sigpc); | 313 g->sig, g->sigcode0, g->sigcode1, g->sigpc); |
312 | 314 |
| 315 runtime·printstring(runtime·panicvers); |
313 if(runtime·gotraceback()){ | 316 if(runtime·gotraceback()){ |
314 if(g != m->g0) { | 317 if(g != m->g0) { |
315 runtime·printf("\n"); | 318 runtime·printf("\n"); |
316 runtime·goroutineheader(g); | 319 runtime·goroutineheader(g); |
317 runtime·traceback(runtime·getcallerpc(&unused), runtime·
getcallersp(&unused), 0, g); | 320 runtime·traceback(runtime·getcallerpc(&unused), runtime·
getcallersp(&unused), 0, g); |
318 } | 321 } |
319 if(!didothers) { | 322 if(!didothers) { |
320 didothers = true; | 323 didothers = true; |
321 runtime·tracebackothers(g); | 324 runtime·tracebackothers(g); |
322 } | 325 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 runtime·newErrorString(runtime·gostringnocopy((byte*)s), &err); | 386 runtime·newErrorString(runtime·gostringnocopy((byte*)s), &err); |
384 runtime·panic(err); | 387 runtime·panic(err); |
385 } | 388 } |
386 | 389 |
387 void | 390 void |
388 runtime·Goexit(void) | 391 runtime·Goexit(void) |
389 { | 392 { |
390 rundefer(); | 393 rundefer(); |
391 runtime·goexit(); | 394 runtime·goexit(); |
392 } | 395 } |
LEFT | RIGHT |