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 ¶
var PeekError = errors.New("cannot peek address")
sentinal errors returns by Peek() and Poke()
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 ¶
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 any, read bool) *AddressInfo
GetAddressInfo allows addressing by symbols in addition to numerically.