Documentation
¶
Overview ¶
Package disasm provides disassembly routines.
It is broken out from cmd/internal/objfile so tools that don't need disassembling don't need to depend on x/arch disassembler code.
Index ¶
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 DisasmForFile ¶
DisasmForFile returns a disassembler for the file f.
func (*Disasm) Decode ¶
func (d *Disasm) Decode(start, end uint64, relocs []objfile.Reloc, gnuAsm bool, 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 ¶
func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64, printCode bool, gnuAsm bool)
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 includes corresponding source lines. The disassembly only includes functions that overlap the range [start, end).
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.