1 | // Copyright 2021 The Go Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style |
3 | // license that can be found in the LICENSE file. |
4 | |
5 | //go:build !go1.7 |
6 | // +build !go1.7 |
7 | |
8 | // TODO(mdempsky): Remove after #44505 is resolved |
9 | |
10 | package pkgbits |
11 | |
12 | import "runtime" |
13 | |
14 | func walkFrames(pcs []uintptr, visit frameVisitor) { |
15 | for _, pc := range pcs { |
16 | fn := runtime.FuncForPC(pc) |
17 | file, line := fn.FileLine(pc) |
18 | |
19 | visit(file, line, fn.Name(), pc-fn.Entry()) |
20 | } |
21 | } |
22 |
Members