| // 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. |
| // fmtFrames formats a backtrace for reporting reader/writer desyncs. |
| func fmtFrames(pcs ...uintptr) []string { |
| res := make([]string, 0, len(pcs)) |
| walkFrames(pcs, func(file string, line int, name string, offset uintptr) { |
| // Trim package from function name. It's just redundant noise. |
| name = strings.TrimPrefix(name, "cmd/compile/internal/noder.") |
| res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset)) |
| type frameVisitor func(file string, line int, name string, offset uintptr) |
| // SyncMarker is an enum type that represents markers that may be |
| // written to export data to ensure the reader and writer stay |
| //go:generate stringer -type=SyncMarker -trimprefix=Sync |
| // Public markers (known to go/types importers). |
| // Low-level coding markers. |
| // Higher-level object and type markers. |
| // Private markers (only known to cmd/compile). |