Documentation ¶
Index ¶
- Constants
- type Attribute
- type BreakPoint
- type Error
- type Memory
- func (m *Memory) Add(r Region)
- func (m *Memory) AddBreakPoint(name string, addr uint, attr Attribute, cond bpFunc)
- func (m *Memory) AddBreakPointByName(name string, attr Attribute, cond bpFunc) error
- func (m *Memory) AddSymbol(s string, adr, size uint) error
- func (m *Memory) AddrArg(arg string) (uint, error)
- func (m *Memory) AddrStr(addr uint) string
- func (m *Memory) Display(adr, size, width uint, vm bool) string
- func (m *Memory) DisplayBreakPoints() string
- func (m *Memory) GetBreak() error
- func (m *Memory) GetSectionName(adr uint) string
- func (m *Memory) LoadELF(filename string, class elf.Class) (string, error)
- func (m *Memory) Map() string
- func (m *Memory) PageTableWalk(va uint, mode csr.Mode, attr Attribute) string
- func (m *Memory) Rd16(va uint) (uint16, error)
- func (m *Memory) Rd16Phys(pa uint) (uint16, error)
- func (m *Memory) Rd32(va uint) (uint32, error)
- func (m *Memory) Rd32Phys(pa uint) (uint32, error)
- func (m *Memory) Rd64(va uint) (uint64, error)
- func (m *Memory) Rd64Phys(pa uint) (uint64, error)
- func (m *Memory) Rd8(va uint) (uint8, error)
- func (m *Memory) Rd8Phys(pa uint) (uint8, error)
- func (m *Memory) RdBuf(addr, n, width uint, vm bool) []uint
- func (m *Memory) RdIns(va uint) (uint, error)
- func (m *Memory) RdInsPhys(pa uint) (uint, error)
- func (m *Memory) SetAttr(name string, attr Attribute) error
- func (m *Memory) SymbolByAddress(adr uint) *Symbol
- func (m *Memory) SymbolByName(s string) *Symbol
- func (m *Memory) SymbolGetAddress(s string) (uint, error)
- func (m *Memory) Symbols() string
- func (m *Memory) Wr16(va uint, val uint16) error
- func (m *Memory) Wr16Phys(pa uint, val uint16) error
- func (m *Memory) Wr32(va uint, val uint32) error
- func (m *Memory) Wr32Phys(pa uint, val uint32) error
- func (m *Memory) Wr64(va uint, val uint64) error
- func (m *Memory) Wr64Phys(pa uint, val uint64) error
- func (m *Memory) Wr8(va uint, val uint8) error
- func (m *Memory) Wr8Phys(pa uint, val uint8) error
- type Region
- type RegionInfo
- type Section
- func (m *Section) In(adr, size uint) bool
- func (m *Section) Info() *RegionInfo
- func (m *Section) Rd16(adr uint) (uint16, error)
- func (m *Section) Rd32(adr uint) (uint32, error)
- func (m *Section) Rd64(adr uint) (uint64, error)
- func (m *Section) Rd8(adr uint) (uint8, error)
- func (m *Section) RdIns(adr uint) (uint, error)
- func (m *Section) SetAttr(attr Attribute)
- func (m *Section) Wr16(adr uint, val uint16) error
- func (m *Section) Wr32(adr uint, val uint32) error
- func (m *Section) Wr64(adr uint, val uint64) error
- func (m *Section) Wr8(adr uint, val uint8) error
- type Symbol
Constants ¶
const ( ErrAlign = 1 << iota // misaligned read/write ErrRead // can't read this memory ErrWrite // can't write this memory ErrExec // can't read instructions from this memory ErrPage // error with page table translation ErrBreak // break on memory access ErrEmpty // no memory at this physical address )
Memory error bits.
const AttrRW = AttrR | AttrW
AttrRW = read/write
const AttrRWM = AttrR | AttrW | AttrM
AttrRWM = read/write/misaligned
const AttrRWX = AttrR | AttrW | AttrX
AttrRWX = read/write/execute
const AttrRX = AttrR | AttrX
AttrRX = read/execute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute uint
Attribute is a bit mask of memory access attributes.
const ( AttrR Attribute = 1 << iota // read AttrW // write AttrX // execute AttrM // misaligned access )
Attribute values.
type BreakPoint ¶
type BreakPoint struct { Name string // breakpoint name Addr uint // address for trigger Access Attribute // access for trigger // contains filtered or unexported fields }
BreakPoint stores the information for a memory breakpoint.
func (*BreakPoint) String ¶
func (mon *BreakPoint) String() string
type Error ¶
type Error struct { Type uint // bitmap of memory errors Ex csr.ECode // exception code Addr uint // memory address causing the error Name string // section name for the address }
Error is a memory acccess error.
type Memory ¶
type Memory struct { Entry uint64 // entry point from ELF // contains filtered or unexported fields }
Memory is emulated target memory.
func (*Memory) AddBreakPoint ¶
AddBreakPoint adds a break point.
func (*Memory) AddBreakPointByName ¶
AddBreakPointByName adds a break point by symbol name.
func (*Memory) DisplayBreakPoints ¶
DisplayBreakPoints displays a string for the memory break points.
func (*Memory) GetSectionName ¶
GetSectionName returns the name of the memory section containing the address.
func (*Memory) PageTableWalk ¶
PageTableWalk returns a string annotating the va->pa page table walk.
func (*Memory) SymbolByAddress ¶
SymbolByAddress returns a symbol for the memory address.
func (*Memory) SymbolByName ¶
SymbolByName returns the symbol for a symbol name.
func (*Memory) SymbolGetAddress ¶
SymbolGetAddress returns the symbol address for a symbol name.
type Region ¶
type Region interface { Info() *RegionInfo SetAttr(attr Attribute) RdIns(adr uint) (uint, error) Rd64(adr uint) (uint64, error) Rd32(adr uint) (uint32, error) Rd16(adr uint) (uint16, error) Rd8(adr uint) (uint8, error) Wr64(adr uint, val uint64) error Wr32(adr uint, val uint32) error Wr16(adr uint, val uint16) error Wr8(adr uint, val uint8) error In(adr, size uint) bool }
Region is an interface to a region of memory.
type RegionInfo ¶
type RegionInfo struct {
// contains filtered or unexported fields
}
RegionInfo contains information for the memory region.
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section is a contiguous region of real memory.
func NewSection ¶
NewSection allocates and returns a memory chunk.
func (*Section) Info ¶
func (m *Section) Info() *RegionInfo
Info returns the information for this region.