go/src/debug/buildinfo/buildinfo.go

type BuildInfo

var errUnrecognizedFormat

var errNotGoExe

var buildInfoMagic

const buildInfoAlign

const buildInfoHeaderSize

// ReadFile returns build information embedded in a Go binary
// file at the given path. Most information is only available for binaries built
// with module support.
func ReadFile(name string) (info *BuildInfo, err error) {}

// Read returns build information embedded in a Go binary file
// accessed through the given ReaderAt. Most information is only available for
// binaries built with module support.
func Read(r io.ReaderAt) (*BuildInfo, error) {}

type exe

// readRawBuildInfo extracts the Go toolchain version and module information
// strings from a Go binary. On success, vers should be non-empty. mod
// is empty if the binary was not built with modules enabled.
func readRawBuildInfo(r io.ReaderAt) (vers, mod string, err error) {}

func hasPlan9Magic(magic []byte) bool {}

func decodeString(x exe, addr uint64) (string, uint64, error) {}

// readString returns the string at address addr in the executable x.
func readString(x exe, ptrSize int, readPtr func([]byte) uint64, addr uint64) string {}

const searchChunkSize

// searchMagic returns the aligned first instance of buildInfoMagic in the data
// range [addr, addr+size). Returns false if not found.
func searchMagic(x exe, start, size uint64) (uint64, error) {}

func readData(x exe, addr, size uint64) ([]byte, error) {}

func readDataInto(x exe, addr uint64, b []byte) (int, error) {}

type elfExe

func (x *elfExe) DataReader(addr uint64) (io.ReaderAt, error) {}

func (x *elfExe) DataStart() (uint64, uint64) {}

type peExe

func (x *peExe) imageBase() uint64 {}

func (x *peExe) DataReader(addr uint64) (io.ReaderAt, error) {}

func (x *peExe) DataStart() (uint64, uint64) {}

type machoExe

func (x *machoExe) DataReader(addr uint64) (io.ReaderAt, error) {}

func (x *machoExe) DataStart() (uint64, uint64) {}

type xcoffExe

func (x *xcoffExe) DataReader(addr uint64) (io.ReaderAt, error) {}

func (x *xcoffExe) DataStart() (uint64, uint64) {}

type plan9objExe

func (x *plan9objExe) DataStart() (uint64, uint64) {}

func (x *plan9objExe) DataReader(addr uint64) (io.ReaderAt, error) {}