dbgmem

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dbgmem sits between the debugger and the acutal VCS memory. In the context of the debugger it is more useful to address memory via this package rather than using the memory package directly.

The key type provided by the package is the AddressInfo type. This type provides every detail about a memory address that you could want.

The other key type is the MemoryDebug type. Initialise this is the usual way by specifying a VCS instance and symbols table. Note that both should be initialised and not left to point to nil - no checks are made in the dbgmem package.

The MapAddress() function is the basic way you create an AddressInfo type. Specify whether the address is read or write address and the function does all the work. The address can even be a symbol, in which case the symbols table is consulted.

The Peek() and Poke() functions complement the Peek() and Poke() functions in the memory package. In the dbgmem package case, Peek() and Poke() accept symbols as well as numeric addresses.

Peek() and Poke() will return sentinal errors (PeekError and PokeError respectively) if a bus.AddressError is encountered).

Index

Constants

This section is empty.

Variables

View Source
var PeekError = errors.New("cannot peek address")

sentinal errors returns by Peek() and Poke()

View Source
var PokeError = errors.New("cannot poke address")

Functions

This section is empty.

Types

type AddressInfo

type AddressInfo struct {
	Address       uint16
	MappedAddress uint16
	Symbol        string
	Area          memorymap.Area

	// addresses and symbols are mapped differently depending on whether
	// address is to be used for reading or writing
	Read bool

	// the data at the address. if peeked is false then data may not be valid
	Peeked bool
	Data   uint8
}

AddressInfo is returned by dbgmem functions. This type contains everything you could possibly usefully know about an address. Most usefully perhaps, the String() function provides a normalised presentation of information.

func (AddressInfo) String

func (ai AddressInfo) String() string

type DbgMem

type DbgMem struct {
	VCS *hardware.VCS
	Sym *symbols.Symbols
}

DbgMem is a front-end to the real VCS memory. it allows addressing by symbol name and uses the AddressInfo type for easier presentation.

func (DbgMem) GetAddressInfo added in v0.20.0

func (dbgmem DbgMem) GetAddressInfo(address interface{}, read bool) *AddressInfo

GetAddressInfo allows addressing by symbols in addition to numerically.

func (DbgMem) Peek

func (dbgmem DbgMem) Peek(address interface{}) (*AddressInfo, error)

Peek returns the contents of the memory address, without triggering any side effects. The supplied address can be numeric of symbolic.

func (DbgMem) Poke

func (dbgmem DbgMem) Poke(address interface{}, data uint8) (*AddressInfo, error)

Poke writes a value at the specified address. The supplied address be numeric or symbolic.

Jump to

Keyboard shortcuts

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