Sha256: 8af23e80ba093ddcb5cb4bf93b849b239ebbdcab25499579fe38963a24c4f4bf

Contents?: true

Size: 1.98 KB

Versions: 16

Compression:

Stored size: 1.98 KB

Contents

// 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.

package pkgbits

import (
	"fmt"
	"strings"
)

// 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))
	})
	return res
}

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
// synchronized.
type SyncMarker int

//go:generate stringer -type=SyncMarker -trimprefix=Sync

const (
	_ SyncMarker = iota

	// Public markers (known to go/types importers).

	// Low-level coding markers.
	SyncEOF
	SyncBool
	SyncInt64
	SyncUint64
	SyncString
	SyncValue
	SyncVal
	SyncRelocs
	SyncReloc
	SyncUseReloc

	// Higher-level object and type markers.
	SyncPublic
	SyncPos
	SyncPosBase
	SyncObject
	SyncObject1
	SyncPkg
	SyncPkgDef
	SyncMethod
	SyncType
	SyncTypeIdx
	SyncTypeParamNames
	SyncSignature
	SyncParams
	SyncParam
	SyncCodeObj
	SyncSym
	SyncLocalIdent
	SyncSelector

	// Private markers (only known to cmd/compile).
	SyncPrivate

	SyncFuncExt
	SyncVarExt
	SyncTypeExt
	SyncPragma

	SyncExprList
	SyncExprs
	SyncExpr
	SyncExprType
	SyncAssign
	SyncOp
	SyncFuncLit
	SyncCompLit

	SyncDecl
	SyncFuncBody
	SyncOpenScope
	SyncCloseScope
	SyncCloseAnotherScope
	SyncDeclNames
	SyncDeclName

	SyncStmts
	SyncBlockStmt
	SyncIfStmt
	SyncForStmt
	SyncSwitchStmt
	SyncRangeStmt
	SyncCaseClause
	SyncCommClause
	SyncSelectStmt
	SyncDecls
	SyncLabeledStmt
	SyncUseObjLocal
	SyncAddLocal
	SyncLinkname
	SyncStmt1
	SyncStmtsEnd
	SyncLabel
	SyncOptLabel
)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.6 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.5 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.4 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.2 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.1 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.3.0 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.2.1 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.2.0 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.1.1 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.1.0 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.0.2 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.0.1 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go
ruby_snowflake_client-1.0.0 ext/vendor/golang.org/x/tools/internal/pkgbits/sync.go