go frames_go17 源码

  • 2022-07-15
  • 浏览 (836)

golang frames_go17 代码

文件路径:/src/internal/pkgbits/frames_go17.go

// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.7
// +build go1.7

package pkgbits

import "runtime"

// walkFrames calls visit for each call frame represented by pcs.
//
// pcs should be a slice of PCs, as returned by runtime.Callers.
func walkFrames(pcs []uintptr, visit frameVisitor) {
	if len(pcs) == 0 {
		return
	}

	frames := runtime.CallersFrames(pcs)
	for {
		frame, more := frames.Next()
		visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry)
		if !more {
			return
		}
	}
}

相关信息

go 源码目录

相关文章

go codes 源码

go decoder 源码

go doc 源码

go encoder 源码

go frames_go1 源码

go reloc 源码

go support 源码

go sync 源码

go syncmarker_string 源码

0  赞