wag: github.com/tsavola/wag/object/debug Index | Files | Directories

package debug

import "github.com/tsavola/wag/object/debug"

Package debug contains DebugObjectMapper implementations.

Index

Package Files

doc.go insnmap.go teller.go trapmap.go

type InsnMap Uses

type InsnMap struct {
    TrapMap
    Insns []InsnMapping
    // contains filtered or unexported fields
}

InsnMap is an object map which stores all available function, call, trap and instruction information. The Mapper method must be used to obtain an actual ObjectMapper implementation.

func (*InsnMap) FindCall Uses

func (m *InsnMap) FindCall(retAddr uint32,
) (init bool, funcIndex, callIndex int, stackOffset int32, retOffset uint32)

func (*InsnMap) Mapper Uses

func (m *InsnMap) Mapper(source Teller) obj.ObjectMapper

Mapper creates a compile.DebugObjectMapper for the InsnMap.

The source position teller is a special reader which must be used when loading (at least) the code section. See NewReadTeller.

type InsnMapping Uses

type InsnMapping struct {
    ObjectOffset uint32 // Machine code offset in bytes.
    SourceOffset uint32 // WebAssembly code offset in bytes.
    BlockLen     int32  // Length of data block (when SourceOffset is 0).
}

Instruction mapping from machine code to WebAssembly. SourceOffset is zero if ObjectOffset contains non-executable data interleaved with the code.

type ReadTeller Uses

type ReadTeller interface {
    reader.R
    Teller
}

ReadTeller is a reader which knows how many bytes have been read.

func NewReadTeller Uses

func NewReadTeller(r reader.R) ReadTeller

NewReadTeller wraps a reader into one which tracks the read position.

type Teller Uses

type Teller interface {
    Tell() int64
}

Teller knows the position.

type TrapMap Uses

type TrapMap struct {
    object.CallMap                   // Function calls and recoverable (portable) traps.
    TrapSites      []object.CallSite // Unrecoverable (or nonportable) traps.
}

TrapMap implements compile.DebugObjectMapper. It stores function addresses, and all call and trap sites. Instruction information is not stored.

func (*TrapMap) FindCall Uses

func (m *TrapMap) FindCall(retAddr uint32,
) (init bool, funcIndex, callIndex int, stackOffset int32, retOffset uint32)

func (TrapMap) PutDataBlock Uses

func (TrapMap) PutDataBlock(uint32, int32)

func (TrapMap) PutInsnAddr Uses

func (TrapMap) PutInsnAddr(uint32)

func (*TrapMap) PutTrapSite Uses

func (m *TrapMap) PutTrapSite(retAddr uint32, stackOffset int32)

Directories

PathSynopsis
dump

Package debug imports 4 packages (graph) and is imported by 4 packages. Updated 2020-09-19. Refresh now. Tools for package owners.