43 typedef multimap<unsigned long, Funktor *>::iterator I;
56 typedef multimap<unsigned long, Funktor *>::iterator I;
59 for(I i = l.first; i != l.second; i++) {
139 unsigned long val =
Pop();
167 avr_warning(
"assignment to non existent SPH (value=0x%x)", (
unsigned int)val);
213 avr_error(
"Push method isn't available on TreeLevelStack");
217 avr_error(
"Pop method isn't available on TreeLevelStack");
254 main_thread->
m_sp = 0;
255 main_thread->
m_ip = 0;
265 for(
unsigned int i = 0; i <
m_threads.size(); i++) {
278 for(
unsigned int i = 0; i < 32; i++) {
285 assert(0 <= SP_value && SP_value <= 0xFFFF);
286 assert(0 != SP_value);
330 new_thread->
m_sp = 0x0000;
331 new_thread->
m_ip = 0x0000;
340 for(
unsigned int i = 0; i <
m_threads.size(); i++) {
355 assert(thread_id >= 1);
356 unsigned int index = thread_id - 1;
362 assert(thread_id >= 1);
363 unsigned int index = thread_id - 1;
uint32_t lowestStackPointer
marker: lowest stackpointer used by program
unsigned long * stackArea
Basic AVR device, contains the core functionality.
enum ThreadList::@11 m_phase_of_switch
virtual void Reset()
Resets stack pointer and listener table.
unsigned int GetMemIRamSize(void)
Get configured internal RAM size.
virtual void PushAddr(unsigned long addr)
Pushs a address to stack.
void avr_free(void *ptr)
Free malloc'd memory.
void SetReturnPoint(unsigned long stackPointer, Funktor *listener)
Subscribes a Listener for a return address.
Implements a stack with stack register using RAM as stackarea.
const Thread * GetThreadFromGDB(int thread_id) const
virtual void Reset()
Resets stack pointer and listener table.
virtual void Push(unsigned char val)
Pushs one byte to stack.
virtual void Reset()
Resets stack pointer and listener table.
bool SetRWMem(unsigned addr, unsigned char val)
Set a value to RW memory cell.
virtual unsigned long PopAddr()
Pops a address from stack.
virtual void PushAddr(unsigned long addr)
Pushs a address to stack.
uint32_t stackPointer
current value of stack pointer
void SetSpl(unsigned char)
Implements a stack register with stack logic.
const unsigned int PC_size
AvrDevice * core
Link to device.
ThreeLevelStack(AvrDevice *core)
unsigned char GetRWMem(unsigned addr)
Get a value of RW memory cell.
HWStack(AvrDevice *core)
Creates a stack instance.
std::vector< Thread * > m_threads
List of known threads. First addition (of main) is special.
void OnSPRead(int SP_value)
Build a register for TraceValue's.
void CheckReturnPoints()
Run functions registered for current stack address and delete them.
virtual unsigned long PopAddr()
Pops a address from stack.
unsigned int GetMemIOSize(void)
Get configured IO memory space size.
int m_cur_thread
Currently running thread. (Thread index used for querying by GDB is in GdbServer.) ...
virtual unsigned char Pop()
Pops one byte from stack.
std::multimap< unsigned long, Funktor * > returnPointList
Maps adresses to listeners for return addresses.
void SetSph(unsigned char)
unsigned int GetCount() const
#define avr_new(type, count)
Macro for allocating memory.
virtual void Push(unsigned char val)
Pushs one byte to stack.
IOReg< HWStackSram > sph_reg
bool LooksLikeContextSwitch(unsigned int addr) const
int GetCurrentThreadForGDB() const
Get GDB-style thread ID (the first is 1)
unsigned char GetCoreReg(unsigned addr)
Get a value from core register.
unsigned int GetMemRegisterSize(void)
Get configured register space size.
bool IsGDBThreadAlive(int thread_id) const
GDB-style thread ID (the first is 1)
void hardwareChange(unsigned char val)
unsigned char registers[32]
virtual unsigned char Pop()
Pops one byte from stack.
HWStackSram(AvrDevice *core, int bitsize, bool initRAMEND=false)
Creates a stack instance.
unsigned long GetStackPointer() const
Returns current stack pointer value.
ThreadList(AvrDevice &core)
int m_ip
address (in bytes, not index)
IOReg< HWStackSram > spl_reg
int GetThreadBySP(int SP) const
Search threads.
int m_sp
Stack Pointer. Address 0x0000 is invalid; used for running thread. GDB never sees the 0...
TraceValue * trace_direct(TraceValueRegister *t, const std::string &name, const bool *val)
Register a directly traced bool value.
void OnSPWrite(int new_SP)