...
1
2
3
4
5 package main
6
7
8
9
10
11
20 import "C"
21
22 import (
23 "runtime"
24 "unsafe"
25 )
26
27 func init() {
28 register("CrashTraceback", CrashTraceback)
29 register("CrashTracebackGo", CrashTracebackGo)
30 }
31
32 func CrashTraceback() {
33 runtime.SetCgoTraceback(0, unsafe.Pointer(C.cgoTraceback), nil, unsafe.Pointer(C.cgoSymbolizer))
34 C.tracebackF1()
35 }
36
37 func CrashTracebackGo() {
38 C.crashInGo = 1
39 CrashTraceback()
40 }
41
42
43 func h1() {
44 h2()
45 }
46
47 func h2() {
48 h3()
49 }
50
51 func h3() {
52 var x *int
53 *x = 0
54 }
55
View as plain text