gdb

package module
v0.0.0-...-de83ca7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchitectureType

type ArchitectureType string
const (
	ARMThumb ArchitectureType = "thumb"
)

type CallParameters

type CallParameters struct {
	Addr               uint64
	WorkAreaTop        uint64
	Params             []uint64
	SkipRestoreContext bool
	IgnoreReturnValue  bool
	ReturnAddr         uint64
}

type CancelFunc

type CancelFunc func() error

type GDB

type GDB struct {
	// contains filtered or unexported fields
}

func New

func New(conn io.ReadWriter, cfg GDBConfig) *GDB

func (*GDB) BreakpointSet

func (g *GDB) BreakpointSet(addr uint64) (CancelFunc, error)

func (*GDB) Call

func (g *GDB) Call(params CallParameters) (uint64, error)

func (*GDB) MemoryRead

func (g *GDB) MemoryRead(addr uint64, data []byte) error

func (*GDB) MemoryWrite

func (g *GDB) MemoryWrite(addr uint64, data []byte) error

func (*GDB) RawExchange

func (g *GDB) RawExchange(out []byte) ([]byte, error)

func (*GDB) RegistersRead

func (g *GDB) RegistersRead(regs Registers) error

func (*GDB) RegistersWrite

func (g *GDB) RegistersWrite(reg Registers) error

func (*GDB) Run

func (g *GDB) Run(setAddr bool, addr uint64) error

type GDBConfig

type GDBConfig struct {
	Architecture ArchitectureType

	MaxWriteSize int
	MaxReadSize  int
}

type GDBError

type GDBError struct {
	Code uint8
}

func (*GDBError) Error

func (e *GDBError) Error() string

type Registers

type Registers interface {
	String() string
	Encode() []byte
	Decode([]byte) error
}

type ThumbRegisters

type ThumbRegisters struct {
	Reg            [13]uint32 // R0-R12
	StackPointer   uint32     // R13
	LinkRegister   uint32     // R14
	ProgramCounter uint32     // R15
	XPSR           uint32
}

func (*ThumbRegisters) Decode

func (a *ThumbRegisters) Decode(data []byte) error

func (ThumbRegisters) Encode

func (a ThumbRegisters) Encode() []byte

func (ThumbRegisters) String

func (a ThumbRegisters) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL