Hold a memory block and symbol informations. More...
#include <memory.h>


Public Member Functions | |
| Memory (int size) | |
| ~Memory () | |
| std::string | GetSymbolAtAddress (unsigned int add) |
| unsigned int | GetAddressAtSymbol (const std::string &s) |
| void | AddSymbol (std::pair< unsigned int, std::string > p) |
| unsigned int | GetSize () |
| virtual void | WriteMem (unsigned char *, unsigned int offset, unsigned int size)=0 |
Public Attributes | |
| unsigned char * | myMemory |
| std::multimap< unsigned int, std::string > | sym |
Protected Attributes | |
| unsigned int | size |
Hold a memory block and symbol informations.
Memory class to hold memory content and symbol informations to map symbols to addresses and vice versa.
Definition at line 38 of file memory.h.
| Memory::Memory | ( | int | size | ) |
Creates the memory block
| size | the memory block size |
Definition at line 109 of file memory.cpp.
| Memory::~Memory | ( | ) | [inline] |
Destructor, frees myMemory
Definition at line 56 of file memory.h.
References avr_free(), and myMemory.

| void Memory::AddSymbol | ( | std::pair< unsigned int, std::string > | p | ) | [inline] |
Add the (address, symbol) pair
| p | a std::pair with address and symbol string |
Definition at line 82 of file memory.h.
References sym.
Referenced by AvrDevice::Load().

| unsigned int Memory::GetAddressAtSymbol | ( | const std::string & | s | ) |
Returns the address for a symbol
If the given string is a hex string, the hex value will be converted and returned. If the symbol isn't found, program aborts.
| s | the symbol string or hex string |
Definition at line 35 of file memory.cpp.
References avr_error, avr_free(), avr_new, and sym.
Referenced by AvrDevice::RegisterTerminationSymbol().


| unsigned int Memory::GetSize | ( | ) | [inline] |
Returns the size in bytes of memory block
Definition at line 85 of file memory.h.
References size.
Referenced by GdbServer::avr_core_flash_read(), GdbServer::avr_core_flash_write(), GdbServer::avr_core_flash_write_hi8(), GdbServer::avr_core_flash_write_lo8(), GdbServer::gdb_break_point(), avr_op_RJMP::operator()(), avr_op_RCALL::operator()(), and AvrDevice::Step().

| string Memory::GetSymbolAtAddress | ( | unsigned int | add | ) |
Return string with symbols found at address
Seeks for symbols, which are registered for the given address. If the address isn't equal to a symbol address, but before the next one, then a offset to symbol address will be added. Returns a empty string, if nothing is found. (in case of no given symbols!)
| add | the given address |
Definition at line 67 of file memory.cpp.
References sym.
Referenced by HWSpi::SetSPSR(), AvrDevice::Step(), avr_op_LPM_Z_incr::Trace(), avr_op_LPM::Trace(), avr_op_LPM_Z::Trace(), avr_op_JMP::Trace(), avr_op_BRBS::Trace(), and avr_op_BRBC::Trace().

| virtual void Memory::WriteMem | ( | unsigned char * | , | |
| unsigned int | offset, | |||
| unsigned int | size | |||
| ) | [pure virtual] |
| unsigned char* Memory::myMemory |
THE memory block content itself
Definition at line 45 of file memory.h.
Referenced by AvrFlash::AvrFlash(), HWEeprom::CpuCycle(), AvrFlash::Decode(), HWEeprom::HWEeprom(), Memory(), avr_op_ILLEGAL::operator()(), HWEeprom::ReadFromAddress(), AvrFlash::ReadMem(), AvrFlash::ReadMemRaw(), AvrFlash::ReadMemRawWord(), AvrFlash::ReadMemWord(), HWEeprom::SetEecr(), HWEeprom::WriteAtAddress(), HWEeprom::WriteMem(), AvrFlash::WriteMem(), AvrFlash::WriteMemByte(), HWEeprom::~HWEeprom(), and ~Memory().
unsigned int Memory::size [protected] |
allocated size (in bytes) of myMemory
Definition at line 41 of file memory.h.
Referenced by AvrFlash::AvrFlash(), HWEeprom::CpuCycle(), AvrFlash::Decode(), GetSize(), AvrFlash::LooksLikeContextSwitch(), Memory(), AvrFlash::ReadMemWord(), HWEeprom::SetEecr(), HWEeprom::WriteMem(), AvrFlash::WriteMem(), AvrFlash::WriteMemByte(), and AvrFlash::~AvrFlash().
| std::multimap<unsigned int, std::string> Memory::sym |
address to symbol map
Definition at line 48 of file memory.h.
Referenced by AddSymbol(), GetAddressAtSymbol(), and GetSymbolAtAddress().
1.6.3