package gosym

Import Path
	debug/gosym (on golang.org and go.dev)

Dependency Relation
	imports 6 packages, and imported by 0 packages

Involved Source Files
	    pclntab.go
	d-> symtab.go

Exported Type Names

type DecodingError (struct) DecodingError represents an error during the decoding of the symbol table. (*T) Error() string *T : error
type Func (struct) A Func collects information about a single function. End uint64 Entry uint64 FrameSize int LineTable *LineTable Locals []*Sym Obj *Obj Params []*Sym Sym *Sym Sym.Func *Func Sym.GoType uint64 Sym.Name string Sym.Type byte Sym.Value uint64 (T) BaseName() string (T) PackageName() string (T) ReceiverName() string (T) Static() bool func (*Table).LineToPC(file string, line int) (pc uint64, fn *Func, err error) func (*Table).LookupFunc(name string) *Func func (*Table).PCToFunc(pc uint64) *Func func (*Table).PCToLine(pc uint64) (file string, line int, fn *Func)
type LineTable (struct) A LineTable is a data structure mapping program counters to line numbers. In Go 1.1 and earlier, each function (represented by a Func) had its own LineTable, and the line number corresponded to a numbering of all source lines in the program, across all files. That absolute line number would then have to be converted separately to a file name and line number within the file. In Go 1.2, the format of the data changed so that there is a single LineTable for the entire program, shared by all Funcs, and there are no absolute line numbers, just line numbers within specific files. For the most part, LineTable's methods should be treated as an internal detail of the package; callers should use the methods on Table instead. Data []byte Line int PC uint64 (*T) LineToPC(line int, maxpc uint64) uint64 (*T) PCToLine(pc uint64) int func NewLineTable(data []byte, text uint64) *LineTable func NewTable(symtab []byte, pcln *LineTable) (*Table, error)
type Obj (struct) An Obj represents a collection of functions in a symbol table. The exact method of division of a binary into separate Objs is an internal detail of the symbol table format. In early versions of Go each source file became a different Obj. In Go 1 and Go 1.1, each package produced one Obj for all Go sources and one Obj per C source file. In Go 1.2, there is a single Obj for the entire program. Funcs []Func Paths []Sym
type Sym (struct) A Sym represents a single symbol table entry. Func *Func GoType uint64 Name string Type byte Value uint64 (*T) BaseName() string (*T) PackageName() string (*T) ReceiverName() string (*T) Static() bool func (*Table).LookupSym(name string) *Sym func (*Table).SymByAddr(addr uint64) *Sym
type Table (struct) Table represents a Go symbol table. It stores all of the symbols decoded from the program and provides methods to translate between symbols, names, and addresses. Files map[string]*Obj Funcs []Func Objs []Obj Syms []Sym (*T) LineToPC(file string, line int) (pc uint64, fn *Func, err error) (*T) LookupFunc(name string) *Func (*T) LookupSym(name string) *Sym (*T) PCToFunc(pc uint64) *Func (*T) PCToLine(pc uint64) (file string, line int, fn *Func) (*T) SymByAddr(addr uint64) *Sym func NewTable(symtab []byte, pcln *LineTable) (*Table, error)
type UnknownFileError string UnknownFileError represents a failure to find the specific file in the symbol table. (T) Error() string T : error
type UnknownLineError (struct) UnknownLineError represents a failure to map a line to a program counter, either because the line is beyond the bounds of the file or because there is no code on the given line. File string Line int (*T) Error() string *T : error
Exported Values
func NewLineTable(data []byte, text uint64) *LineTable NewLineTable returns a new PC/line table corresponding to the encoded data. Text must be the start address of the corresponding text segment.
func NewTable(symtab []byte, pcln *LineTable) (*Table, error) NewTable decodes the Go symbol table (the ".gosymtab" section in ELF), returning an in-memory representation. Starting with Go 1.3, the Go symbol table no longer includes symbol data.