package objfile
import "cmd/internal/objfile"
Package objfile implements portable access to OS-specific executable files.
Index ¶
- type Disasm
- func (d *Disasm) Decode(start, end uint64, f func(pc, size uint64, file string, line int, text string))
- func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64)
- type File
- func Open(name string) (*File, error)
- func (f *File) Close() error
- func (f *File) Disasm() (*Disasm, error)
- func (f *File) GOARCH() string
- func (f *File) PCLineTable() (*gosym.Table, error)
- func (f *File) Symbols() ([]Sym, error)
- func (f *File) Text() (uint64, []byte, error)
- type Sym
Types ¶
type Disasm ¶
type Disasm struct {
// contains filtered or unexported fields
}
Disasm is a disassembler for a given File.
func (*Disasm) Decode ¶
func (d *Disasm) Decode(start, end uint64, f func(pc, size uint64, file string, line int, text string))
Decode disassembles the text segment range [start, end), calling f for each instruction.
func (*Disasm) Print ¶
Print prints a disassembly of the file to w. If filter is non-nil, the disassembly only includes functions with names matching filter. The disassembly only includes functions that overlap the range [start, end).
type File ¶
type File struct {
// contains filtered or unexported fields
}
A File is an opened executable file.
func Open ¶
Open opens the named file. The caller must call f.Close when the file is no longer needed.
func (*File) Close ¶
func (*File) Disasm ¶
Disasm returns a disassembler for the file f.
func (*File) GOARCH ¶
func (*File) PCLineTable ¶
func (*File) Symbols ¶
func (*File) Text ¶
type Sym ¶
type Sym struct { Name string // symbol name Addr uint64 // virtual address of symbol Size int64 // size in bytes Code rune // nm code (T for text, D for data, and so on) Type string // XXX? }
A Sym is a symbol defined in an executable file.
Source Files ¶
disasm.go elf.go goobj.go macho.go objfile.go pe.go plan9obj.go
- Version
- v1.6.2
- Published
- Apr 19, 2016
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 8 seconds ago –
Tools for package owners.