Documentation ¶
Overview ¶
Package objfile implements portable access to OS-specific executable files.
Index ¶
- type CachedFile
- type Disasm
- type Entry
- func (e *Entry) DWARF() (*dwarf.Data, error)
- func (e *Entry) Disasm() (*Disasm, error)
- func (e *Entry) GOARCH() string
- func (e *Entry) LoadAddress() (uint64, error)
- func (e *Entry) Name() string
- func (e *Entry) PCLineTable() (Liner, error)
- func (e *Entry) Symbols() ([]Sym, error)
- func (e *Entry) Text() (uint64, []byte, error)
- type File
- func (f *File) Close() error
- func (f *File) DWARF() (*dwarf.Data, error)
- func (f *File) Disasm() (*Disasm, error)
- func (f *File) Entries() []*Entry
- func (f *File) GOARCH() string
- func (f *File) LoadAddress() (uint64, error)
- func (f *File) PCLineTable() (Liner, error)
- func (f *File) Symbols() ([]Sym, error)
- func (f *File) Text() (uint64, []byte, error)
- type FileCache
- type Liner
- type Reloc
- type RelocStringer
- type Sym
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedFile ¶
CachedFile contains the content of a file split into lines.
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, relocs []Reloc, 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. If printCode is true, the disassembly includs corresponding source lines. The disassembly only includes functions that overlap the range [start, end).
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) DWARF ¶
DWARF returns DWARF debug data for the file, if any. This is for cmd/pprof to locate cgo functions.
func (*Entry) LoadAddress ¶
LoadAddress returns the expected load address of the file. This differs from the actual load address for a position-independent executable.
func (*Entry) PCLineTable ¶
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) LoadAddress ¶
func (*File) PCLineTable ¶
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache is a simple LRU cache of file contents.
func NewFileCache ¶
NewFileCache returns a FileCache which can contain up to maxLen cached file contents.
type Reloc ¶
type Reloc struct { Addr uint64 // Address of first byte that reloc applies to. Size uint64 // Number of bytes Stringer RelocStringer }