elvish/sys/dumpstack.go
2016-02-03 02:50:15 +01:00

12 lines
186 B
Go

package sys
import "runtime"
func DumpStack() string {
buf := make([]byte, 1024)
for runtime.Stack(buf, true) == cap(buf) {
buf = make([]byte, cap(buf)*2)
}
return string(buf)
}