3 Star 3 Fork 1

Gitee 极速下载 / runc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/opencontainers/runc
克隆/下载
capture.go 617 Bytes
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2015-07-10 18:06 . avoid infinite loop with GCCGO
package stacktrace
import "runtime"
// Caputure captures a stacktrace for the current calling go program
//
// skip is the number of frames to skip
func Capture(userSkip int) Stacktrace {
var (
skip = userSkip + 1 // add one for our own function
frames []Frame
prevPc uintptr = 0
)
for i := skip; ; i++ {
pc, file, line, ok := runtime.Caller(i)
//detect if caller is repeated to avoid loop, gccgo
//currently runs into a loop without this check
if !ok || pc == prevPc {
break
}
frames = append(frames, NewFrame(pc, file, line))
prevPc = pc
}
return Stacktrace{
Frames: frames,
}
}
1
https://gitee.com/mirrors/runc.git
git@gitee.com:mirrors/runc.git
mirrors
runc
runc
v0.1.1

搜索帮助