ThreadList Class Reference

#include <hwstack.h>

Collaboration diagram for ThreadList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ThreadList (AvrDevice &core)
 ~ThreadList ()
void OnReset ()
void OnCall ()
void OnSPRead (int SP_value)
void OnSPWrite (int new_SP)
void OnPush ()
void OnPop ()
int GetThreadBySP (int SP) const
 Search threads.
int GetCurrentThreadForGDB () const
 Get GDB-style thread ID (the first is 1).
const ThreadGetThreadFromGDB (int thread_id) const
bool IsGDBThreadAlive (int thread_id) const
 GDB-style thread ID (the first is 1).
int GetCount () const

Private Types

enum  { eNormal, eReaded, eWritten, eWritten2 }

Private Member Functions

ThreadListoperator= (const ThreadList &)

Private Attributes

std::vector< Thread * > m_threads
 List of known threads. First addition (of main) is special.
enum ThreadList:: { ... }  m_phase_of_switch
int m_last_SP_read
int m_last_SP_writen
int m_on_call_sp
int m_on_call_ip
int m_cur_thread
 Currently running thread. (Thread index used for querying by GDB is in GdbServer.).
AvrDevicem_core

Detailed Description

List of auto-detected threads. See my Google Docs notes. Stack address 0x0000 is invalid (see datasheet).

Definition at line 56 of file hwstack.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
eNormal 
eReaded 
eWritten 
eWritten2 

Definition at line 60 of file hwstack.h.


Constructor & Destructor Documentation

ThreadList::ThreadList ( AvrDevice core  ) 
ThreadList::~ThreadList (  ) 

Definition at line 250 of file hwstack.cpp.

References OnReset().

Here is the call graph for this function:


Member Function Documentation

int ThreadList::GetCount (  )  const

Definition at line 367 of file hwstack.cpp.

References m_threads.

Referenced by GdbServer::gdb_get_thread_list().

Here is the caller graph for this function:

int ThreadList::GetCurrentThreadForGDB (  )  const

Get GDB-style thread ID (the first is 1).

Definition at line 345 of file hwstack.cpp.

References m_cur_thread.

Referenced by GdbServer::gdb_parse_packet(), GdbServer::gdb_read_registers(), and GdbServer::SendPosition().

Here is the caller graph for this function:

int ThreadList::GetThreadBySP ( int  SP  )  const

Search threads.

Definition at line 335 of file hwstack.cpp.

References Thread::m_sp, and m_threads.

Referenced by OnPop().

Here is the caller graph for this function:

const Thread * ThreadList::GetThreadFromGDB ( int  thread_id  )  const

Definition at line 350 of file hwstack.cpp.

References m_threads.

Referenced by GdbServer::gdb_read_registers().

Here is the caller graph for this function:

bool ThreadList::IsGDBThreadAlive ( int  thread_id  )  const

GDB-style thread ID (the first is 1).

Definition at line 357 of file hwstack.cpp.

References Thread::m_alive, and m_threads.

Referenced by GdbServer::gdb_is_thread_alive().

Here is the caller graph for this function:

void ThreadList::OnCall (  ) 

Definition at line 263 of file hwstack.cpp.

References AvrDevice::GetCoreReg(), HWStack::GetStackPointer(), m_core, m_cur_thread, m_on_call_ip, m_on_call_sp, m_threads, AvrDevice::PC, Thread::registers, and AvrDevice::stack.

Referenced by avr_op_RCALL::operator()(), avr_op_ICALL::operator()(), avr_op_EICALL::operator()(), and avr_op_CALL::operator()().

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadList::OnPop (  ) 

Definition at line 302 of file hwstack.cpp.

References eNormal, eWritten2, GetThreadBySP(), global_verbose_on, Thread::m_alive, m_core, m_cur_thread, Thread::m_ip, m_last_SP_read, m_last_SP_writen, m_on_call_ip, m_on_call_sp, m_phase_of_switch, Thread::m_sp, m_threads, and AvrDevice::PC.

Referenced by HWStackSram::Pop().

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadList::OnPush (  ) 

Definition at line 295 of file hwstack.cpp.

References eNormal, m_last_SP_read, m_last_SP_writen, and m_phase_of_switch.

Referenced by HWStackSram::Push().

Here is the caller graph for this function:

void ThreadList::OnReset (  ) 

Definition at line 254 of file hwstack.cpp.

References m_threads.

Referenced by ~ThreadList().

Here is the caller graph for this function:

void ThreadList::OnSPRead ( int  SP_value  ) 

Definition at line 279 of file hwstack.cpp.

References eReaded, m_last_SP_read, and m_phase_of_switch.

Referenced by HWStackSram::OnSPReadByTarget().

Here is the caller graph for this function:

void ThreadList::OnSPWrite ( int  new_SP  ) 

Definition at line 287 of file hwstack.cpp.

References eWritten, eWritten2, AvrDevice::Flash, AvrFlash::LooksLikeContextSwitch(), m_core, m_last_SP_writen, m_phase_of_switch, and AvrDevice::PC.

Referenced by HWStackSram::SetSph(), and HWStackSram::SetSpl().

Here is the call graph for this function:

Here is the caller graph for this function:

ThreadList& ThreadList::operator= ( const ThreadList  )  [private]

Member Data Documentation

Definition at line 67 of file hwstack.h.

Referenced by OnCall(), OnPop(), and OnSPWrite().

int ThreadList::m_cur_thread [private]

Currently running thread. (Thread index used for querying by GDB is in GdbServer.).

Definition at line 66 of file hwstack.h.

Referenced by GetCurrentThreadForGDB(), OnCall(), OnPop(), and ThreadList().

Definition at line 61 of file hwstack.h.

Referenced by OnPop(), OnPush(), OnSPRead(), and ThreadList().

Definition at line 62 of file hwstack.h.

Referenced by OnPop(), OnPush(), OnSPWrite(), and ThreadList().

int ThreadList::m_on_call_ip [private]

Address in a routine calling the context-switch

Definition at line 64 of file hwstack.h.

Referenced by OnCall(), and OnPop().

int ThreadList::m_on_call_sp [private]

Definition at line 63 of file hwstack.h.

Referenced by OnCall(), and OnPop().

enum { ... } ThreadList::m_phase_of_switch [private]
std::vector<Thread*> ThreadList::m_threads [private]

List of known threads. First addition (of main) is special.

Definition at line 59 of file hwstack.h.

Referenced by GetCount(), GetThreadBySP(), GetThreadFromGDB(), IsGDBThreadAlive(), OnCall(), OnPop(), OnReset(), and ThreadList().


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 16:53:15 2012 for Simulavr by  doxygen 1.6.3