simulavr
1.1.0
|
#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 Thread * | GetThreadFromGDB (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 | |
ThreadList & | operator= (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... | |
AvrDevice & | m_core |
List of auto-detected threads. See my Google Docs notes. Stack address 0x0000 is invalid (see datasheet).
|
private |
ThreadList::ThreadList | ( | AvrDevice & | core | ) |
Definition at line 245 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 259 of file hwstack.cpp.
References OnReset().
unsigned int ThreadList::GetCount | ( | ) | const |
Definition at line 370 of file hwstack.cpp.
References m_threads.
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.
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().
const Thread * ThreadList::GetThreadFromGDB | ( | int | thread_id | ) | const |
Definition at line 353 of file hwstack.cpp.
References m_threads.
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.
void ThreadList::OnCall | ( | ) |
Definition at line 272 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_CALL::operator()(), avr_op_EICALL::operator()(), avr_op_ICALL::operator()(), and avr_op_RCALL::operator()().
void ThreadList::OnPop | ( | ) |
Definition at line 306 of file hwstack.cpp.
References avr_message, eNormal, eWritten2, GetThreadBySP(), 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 299 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 | ( | ) |
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().
void ThreadList::OnSPWrite | ( | int | new_SP | ) |
Definition at line 291 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().
|
private |
|
private |
Definition at line 67 of file hwstack.h.
Referenced by OnCall(), OnPop(), and OnSPWrite().
|
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().
|
private |
Definition at line 61 of file hwstack.h.
Referenced by OnPop(), OnPush(), OnSPRead(), and ThreadList().
|
private |
Definition at line 62 of file hwstack.h.
Referenced by OnPop(), OnPush(), OnSPWrite(), and ThreadList().
|
private |
|
private |
enum { ... } ThreadList::m_phase_of_switch |
Referenced by OnPop(), OnPush(), OnSPRead(), OnSPWrite(), and ThreadList().
|
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().