GoPLS Viewer

Home|gopls/internal/pkgbits/frames_go17.go
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
8package pkgbits
9
10import "runtime"
11
12// walkFrames calls visit for each call frame represented by pcs.
13//
14// pcs should be a slice of PCs, as returned by runtime.Callers.
15func walkFrames(pcs []uintptrvisit frameVisitor) {
16    if len(pcs) == 0 {
17        return
18    }
19
20    frames := runtime.CallersFrames(pcs)
21    for {
22        framemore := frames.Next()
23        visit(frame.Fileframe.Lineframe.Functionframe.PC-frame.Entry)
24        if !more {
25            return
26        }
27    }
28}
29
MembersX
walkFrames.BlockStmt.frames
walkFrames.BlockStmt.BlockStmt.frame
walkFrames.BlockStmt.BlockStmt.more
Members
X