#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. | |
int | GetCurrentThreadForGDB () const |
Get GDB-style thread ID (the first is 1). | |
const Thread * | GetThreadFromGDB (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 | |
ThreadList & | operator= (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.). | |
AvrDevice & | m_core |
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.
anonymous enum [private] |
ThreadList::ThreadList | ( | AvrDevice & | core | ) |
Definition at line 236 of file hwstack.cpp.
References eNormal, Thread::m_alive, m_cur_thread, Thread::m_ip, m_last_SP_read, m_last_SP_writen, m_phase_of_switch, Thread::m_sp, and m_threads.
ThreadList::~ThreadList | ( | ) |
Definition at line 250 of file hwstack.cpp.
References OnReset().
int ThreadList::GetCount | ( | ) | const |
Definition at line 367 of file hwstack.cpp.
References m_threads.
Referenced by GdbServer::gdb_get_thread_list().
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().
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().
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().
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().
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()().
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().
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().
void ThreadList::OnReset | ( | ) |
Definition at line 254 of file hwstack.cpp.
References m_threads.
Referenced by ~ThreadList().
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().
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().
ThreadList& ThreadList::operator= | ( | const ThreadList & | ) | [private] |
AvrDevice& ThreadList::m_core [private] |
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().
int ThreadList::m_last_SP_read [private] |
Definition at line 61 of file hwstack.h.
Referenced by OnPop(), OnPush(), OnSPRead(), and ThreadList().
int ThreadList::m_last_SP_writen [private] |
Definition at line 62 of file hwstack.h.
Referenced by OnPop(), OnPush(), OnSPWrite(), and ThreadList().
int ThreadList::m_on_call_ip [private] |
int ThreadList::m_on_call_sp [private] |
enum { ... } ThreadList::m_phase_of_switch [private] |
Referenced by OnPop(), OnPush(), OnSPRead(), OnSPWrite(), and ThreadList().
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().