simulavr  1.1.0
ThreadList Class Reference

#include <hwstack.h>

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. More...
 
int GetCurrentThreadForGDB () const
 Get GDB-style thread ID (the first is 1) More...
 
const ThreadGetThreadFromGDB (int thread_id) const
 
bool IsGDBThreadAlive (int thread_id) const
 GDB-style thread ID (the first is 1) More...
 
unsigned 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. More...
 
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.) More...
 
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

anonymous enum
private
Enumerator
eNormal 
eReaded 
eWritten 
eWritten2 

Definition at line 60 of file hwstack.h.

Constructor & Destructor Documentation

◆ ThreadList()

ThreadList::ThreadList ( AvrDevice core)

◆ ~ThreadList()

ThreadList::~ThreadList ( )

Definition at line 259 of file hwstack.cpp.

References OnReset().

Member Function Documentation

◆ GetCount()

unsigned int ThreadList::GetCount ( ) const

Definition at line 370 of file hwstack.cpp.

References m_threads.

◆ GetCurrentThreadForGDB()

int ThreadList::GetCurrentThreadForGDB ( ) const

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

Definition at line 348 of file hwstack.cpp.

References m_cur_thread.

◆ GetThreadBySP()

int ThreadList::GetThreadBySP ( int  SP) const

Search threads.

Definition at line 338 of file hwstack.cpp.

References Thread::m_sp, and m_threads.

Referenced by OnPop().

◆ GetThreadFromGDB()

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

Definition at line 353 of file hwstack.cpp.

References m_threads.

◆ IsGDBThreadAlive()

bool ThreadList::IsGDBThreadAlive ( int  thread_id) const

GDB-style thread ID (the first is 1)

Definition at line 360 of file hwstack.cpp.

References Thread::m_alive, and m_threads.

◆ OnCall()

◆ OnPop()

◆ OnPush()

void ThreadList::OnPush ( )

Definition at line 299 of file hwstack.cpp.

References eNormal, m_last_SP_read, m_last_SP_writen, and m_phase_of_switch.

Referenced by HWStackSram::Push().

◆ OnReset()

void ThreadList::OnReset ( )

Definition at line 263 of file hwstack.cpp.

References m_threads.

Referenced by ~ThreadList().

◆ OnSPRead()

void ThreadList::OnSPRead ( int  SP_value)

Definition at line 283 of file hwstack.cpp.

References eReaded, m_last_SP_read, and m_phase_of_switch.

Referenced by HWStackSram::OnSPReadByTarget().

◆ OnSPWrite()

void ThreadList::OnSPWrite ( int  new_SP)

◆ operator=()

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

Member Data Documentation

◆ m_core

AvrDevice& ThreadList::m_core
private

Definition at line 67 of file hwstack.h.

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

◆ m_cur_thread

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().

◆ m_last_SP_read

int ThreadList::m_last_SP_read
private

Definition at line 61 of file hwstack.h.

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

◆ m_last_SP_writen

int ThreadList::m_last_SP_writen
private

Definition at line 62 of file hwstack.h.

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

◆ m_on_call_ip

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().

◆ m_on_call_sp

int ThreadList::m_on_call_sp
private

Definition at line 63 of file hwstack.h.

Referenced by OnCall(), and OnPop().

◆ m_phase_of_switch

enum { ... } ThreadList::m_phase_of_switch

◆ m_threads

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: