ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
gdb server implementation that is used as a plugin in etiss More...
#include <GDBServer.h>
Public Member Functions | |
Server (etiss::plugin::gdb::PacketProtocol &pp) | |
void | init (ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch) override |
this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute). More... | |
void | cleanup () override |
this function is called after cpu execution loop (etiss::CPUCore::execute) finished. More... | |
etiss::int32 | execute () override |
called before a block and may act in the same way as a block More... | |
void | finalizeInstrSet (etiss::instr::ModedInstructionSet &) const override |
called after all instructions have been added to allow last changes More... | |
void | finalizeCodeBlock (etiss::CodeBlock &) const override |
called after all instructions have been translated for the code block More... | |
void * | getPluginHandle () override |
called to get the handle that is available in translated code via getPoinerCode(). [default: this] More... | |
ETISS_System * | wrap (ETISS_CPU *cpu, ETISS_System *system) override |
SystemWrapper,. More... | |
ETISS_System * | unwrap (ETISS_CPU *cpu, ETISS_System *system) override |
undo wrap function call this function will be called AFTER etiss::Plugin::cleanup More... | |
etiss::int32 | preInstructionCallback () |
void | preDReadCallback (etiss::uint64 addr) |
void | preDWriteCallback (etiss::uint64 addr) |
etiss::int32 | postMemAccessCallback (etiss::int32 exception) |
Public Member Functions inherited from etiss::CoroutinePlugin | |
CoroutinePlugin () | |
virtual | ~CoroutinePlugin () |
virtual void | executionEnd (int32_t code) |
called when the simulation ends but before any deinitialization is done More... | |
virtual bool | isActive () |
indicates if the plugin will do something in execution loop. More... | |
Public Member Functions inherited from etiss::Plugin | |
virtual | ~Plugin () |
unsigned | getType () |
InterruptListenerPlugin * | getInterruptListenerPlugin () |
CoroutinePlugin * | getCoroutinePlugin () |
SystemWrapperPlugin * | getSystemWrapperPlugin () |
RegisterDevicePlugin * | getRegisterDevicePlugin () |
TranslationPlugin * | getTranslationPlugin () |
std::string | getPluginName () const |
const std::string & | getLastAssignedCoreName () |
std::string | toString () const |
Public Member Functions inherited from etiss::ToString | |
ToString () | |
virtual | ~ToString () |
Public Member Functions inherited from etiss::TranslationPlugin | |
TranslationPlugin () | |
virtual | ~TranslationPlugin () |
virtual void | initInstrSet (etiss::instr::ModedInstructionSet &) const |
called to add instructions to the instruction set More... | |
virtual void | initCodeBlock (etiss::CodeBlock &) const |
called before instructions are translated for the code block More... | |
Public Member Functions inherited from etiss::SystemWrapperPlugin | |
SystemWrapperPlugin () | |
virtual | ~SystemWrapperPlugin () |
Static Public Member Functions | |
static Server * | createTCPServer (std::map< std::string, std::string > options) |
static Server * | createTCPServer (int port) |
Protected Member Functions | |
std::string | _getPluginName () const override |
void | handlePacket (bool block) |
Protected Member Functions inherited from etiss::Plugin | |
Plugin (unsigned type=0) | |
void | setCorrespondingCPUCoreName (std::string name) |
virtual void | addedToCPUCore (etiss::CPUCore *core) |
called as soon a plugin has been added to its CPUCore. More... | |
virtual void | removedFromCPUCore (etiss::CPUCore *core) |
called as soon a plugin has been removed from its CPUCore. More... | |
Protected Member Functions inherited from etiss::TranslationPlugin | |
std::string | getPointerCode () const |
returns a C code expression that allows to get or assign a pointer to the variable assigned to this translation plugin. More... | |
Protected Attributes | |
etiss::plugin::gdb::PacketProtocol & | con_ |
CPUArch * | arch_ |
ETISS_CPU * | cpu_ |
ETISS_System * | system_ |
ETISS_System * | unwrappedSys_ |
bool | status_paused_ |
bool | gdb_status_paused_ |
unsigned | status_step_ |
bool | status_pending_jump_ |
bool | status_pending_kill_ |
etiss::uint64 | status_jumpaddr_ |
BreakpointDB | breakpoints_ |
BreakpointDB | watchpoints_ |
unsigned | execute_skip_count |
unsigned | execute_skip_index |
unsigned | minimal_pc_alignment |
Protected Attributes inherited from etiss::Plugin | |
ETISS_CPU * | plugin_cpu_ |
holds a pointer to the cpu structure. will be set before init call and after cleanup call More... | |
ETISS_System * | plugin_system_ |
holds a pointer to the system structure. More... | |
CPUArch * | plugin_arch_ |
holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More... | |
CPUCore * | plugin_core_ |
holds a pointer to the associated CPUCore instance. More... | |
Private Attributes | |
std::shared_ptr< Connection > | cinst_ |
Additional Inherited Members | |
Static Public Attributes inherited from etiss::Plugin | |
static const unsigned | INTERRUPTLISTENER = 1 << 0 |
access to translated code More... | |
static const unsigned | COROUTINE = 1 << 1 |
callback after execution of each translated block More... | |
static const unsigned | SYSTEMWRAPPER = 1 << 2 |
can wrap/change ETISS_System structure at execution start More... | |
static const unsigned | REGISTERDEVICE |
gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) More... | |
static const unsigned | TRANSLATION |
access to translated code during translation phase or when instruction tree is built More... | |
gdb server implementation that is used as a plugin in etiss
Definition at line 124 of file GDBServer.h.
Server::Server | ( | etiss::plugin::gdb::PacketProtocol & | pp | ) |
Definition at line 157 of file GDBServer.cpp.
References arch_, cpu_, execute_skip_count, execute_skip_index, gdb_status_paused_, minimal_pc_alignment, status_jumpaddr_, status_paused_, status_pending_jump_, status_pending_kill_, status_step_, and system_.
Referenced by createTCPServer().
|
overrideprotectedvirtual |
Implements etiss::Plugin.
Definition at line 809 of file GDBServer.cpp.
|
overridevirtual |
this function is called after cpu execution loop (etiss::CPUCore::execute) finished.
Only the SystemWrapperPlugin::unwrap function is called AFTER Plugin::cleanup
Reimplemented from etiss::Plugin.
Definition at line 826 of file GDBServer.cpp.
Definition at line 875 of file GDBServer.cpp.
References etiss::log(), s, Server(), etiss::toString(), and etiss::VERBOSE.
|
static |
Definition at line 833 of file GDBServer.cpp.
References etiss::ERROR, etiss::log(), options, and s.
Referenced by ETISSINCLUDED_createPlugin().
|
overridevirtual |
called before a block and may act in the same way as a block
Implements etiss::CoroutinePlugin.
Definition at line 225 of file GDBServer.cpp.
References execute_skip_count, execute_skip_index, handlePacket(), status_pending_kill_, and unlikely.
|
overridevirtual |
called after all instructions have been translated for the code block
Reimplemented from etiss::TranslationPlugin.
Definition at line 277 of file GDBServer.cpp.
References etiss::CodeBlock::fileglobalCode().
|
overridevirtual |
called after all instructions have been added to allow last changes
Reimplemented from etiss::TranslationPlugin.
Definition at line 269 of file GDBServer.cpp.
References etiss::instr::VariableInstructionSet::foreach(), etiss::instr::ModedInstructionSet::foreach(), etiss::TranslationPlugin::getPointerCode(), and Server_finalizeInstrSet().
|
overridevirtual |
called to get the handle that is available in translated code via getPoinerCode(). [default: this]
Reimplemented from etiss::TranslationPlugin.
Definition at line 814 of file GDBServer.cpp.
|
protected |
Definition at line 284 of file GDBServer.cpp.
References arch_, etiss::plugin::gdb::PacketProtocol::available(), etiss::plugin::gdb::BreakpointDB::BPTYPE_BREAK_HW, etiss::plugin::gdb::BreakpointDB::BPTYPE_BREAK_MEM, etiss::plugin::gdb::BreakpointDB::BPTYPE_WATCH_READ, etiss::plugin::gdb::BreakpointDB::BPTYPE_WATCH_WRITE, breakpoints_, con_, ETISS_System::dbg_read, ETISS_System::dbg_write, etiss::ERROR, etiss::plugin::gdb::hex::fromByte(), etiss::plugin::gdb::hex::fromBytes(), etiss::plugin::gdb::hex::fromHex(), etiss::plugin::gdb::hex::fromInt(), gdb_status_paused_, etiss::plugin::gdb::BreakpointDB::get(), etiss::CPUArch::getGDBCore(), etiss::CPUCore::getStruct(), ETISS_System::handle, etiss::plugin::gdb::GDBCore::isLittleEndian(), length(), etiss::log(), etiss::plugin::gdb::GDBCore::mapRegister(), minimal_pc_alignment, etiss::mm::NOERROR, etiss::Plugin::plugin_core_, etiss::plugin::gdb::PacketProtocol::rcv(), etiss::plugin::gdb::BreakpointDB::set(), etiss::plugin::gdb::PacketProtocol::snd(), status_jumpaddr_, status_paused_, status_pending_jump_, status_pending_kill_, status_step_, system_, etiss::plugin::gdb::hex::toByte(), uint16_t, uint32_t, uint64_t, uint8_t, and watchpoints_.
Referenced by execute(), postMemAccessCallback(), and preInstructionCallback().
|
overridevirtual |
this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute).
Only exception is the SystemWrapperPlugin whose SystemWrapperPlugin::wrap function is called BEFORE Plugin::init
Reimplemented from etiss::Plugin.
Definition at line 819 of file GDBServer.cpp.
etiss::int32 Server::postMemAccessCallback | ( | etiss::int32 | exception | ) |
Definition at line 775 of file GDBServer.cpp.
References con_, cpu_, etiss::plugin::gdb::hex::fromByte(), gdb_status_paused_, handlePacket(), ETISS_CPU::instructionPointer, etiss::mm::NOERROR, etiss::plugin::gdb::PacketProtocol::snd(), status_jumpaddr_, status_paused_, status_pending_jump_, status_pending_kill_, and unlikely.
void Server::preDReadCallback | ( | etiss::uint64 | addr | ) |
Definition at line 754 of file GDBServer.cpp.
References etiss::plugin::gdb::BreakpointDB::BPTYPE_WATCH_READ, etiss::plugin::gdb::BreakpointDB::get(), etiss::plugin::gdb::BreakpointDB::isEmpty(), status_paused_, and watchpoints_.
void Server::preDWriteCallback | ( | etiss::uint64 | addr | ) |
Definition at line 764 of file GDBServer.cpp.
References etiss::plugin::gdb::BreakpointDB::BPTYPE_WATCH_WRITE, etiss::plugin::gdb::BreakpointDB::get(), etiss::plugin::gdb::BreakpointDB::isEmpty(), status_paused_, and watchpoints_.
etiss::int32 Server::preInstructionCallback | ( | ) |
Definition at line 173 of file GDBServer.cpp.
References arch_, etiss::plugin::gdb::BreakpointDB::BPTYPE_BREAK_HW, etiss::plugin::gdb::BreakpointDB::BPTYPE_BREAK_MEM, breakpoints_, con_, cpu_, etiss::plugin::gdb::hex::fromByte(), gdb_status_paused_, etiss::plugin::gdb::BreakpointDB::get(), etiss::CPUArch::getGDBCore(), etiss::plugin::gdb::GDBCore::getInstructionPointer(), handlePacket(), ETISS_CPU::instructionPointer, etiss::plugin::gdb::BreakpointDB::isEmpty(), minimal_pc_alignment, etiss::mm::NOERROR, etiss::plugin::gdb::PacketProtocol::snd(), status_jumpaddr_, status_paused_, status_pending_jump_, status_pending_kill_, status_step_, and unlikely.
|
overridevirtual |
undo wrap function call this function will be called AFTER etiss::Plugin::cleanup
Implements etiss::SystemWrapperPlugin.
Definition at line 146 of file GDBSystemWrapper.cpp.
|
overridevirtual |
SystemWrapper,.
Implements etiss::SystemWrapperPlugin.
Definition at line 116 of file GDBSystemWrapper.cpp.
References ETISS_System::dbg_read, ETISS_System::dbg_write, ETISS_System::dread, ETISS_System::dwrite, gdb_system_call_dbg_read(), gdb_system_call_dbg_write(), gdb_system_call_dread(), gdb_system_call_dwrite(), gdb_system_call_iread(), gdb_system_call_iwrite(), gdb_system_call_syncTime(), ETISS_System::handle, ETISS_System::iread, ETISS_System::iwrite, ETISS_GDBSystem::server_, ETISS_System::syncTime, ETISS_GDBSystem::sys_, and unwrappedSys_.
|
protected |
Definition at line 159 of file GDBServer.h.
Referenced by cleanup(), handlePacket(), init(), preInstructionCallback(), and Server().
|
protected |
Definition at line 169 of file GDBServer.h.
Referenced by handlePacket(), and preInstructionCallback().
|
private |
Definition at line 176 of file GDBServer.h.
|
protected |
Definition at line 158 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), and preInstructionCallback().
|
protected |
Definition at line 160 of file GDBServer.h.
Referenced by cleanup(), init(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 171 of file GDBServer.h.
|
protected |
Definition at line 172 of file GDBServer.h.
|
protected |
Definition at line 164 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 173 of file GDBServer.h.
Referenced by handlePacket(), preInstructionCallback(), and Server().
|
protected |
Definition at line 168 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 163 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preDReadCallback(), preDWriteCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 166 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 167 of file GDBServer.h.
Referenced by execute(), handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 165 of file GDBServer.h.
Referenced by handlePacket(), preInstructionCallback(), and Server().
|
protected |
Definition at line 161 of file GDBServer.h.
Referenced by cleanup(), handlePacket(), init(), and Server().
|
protected |
Definition at line 162 of file GDBServer.h.
Referenced by wrap().
|
protected |
Definition at line 170 of file GDBServer.h.
Referenced by handlePacket(), preDReadCallback(), and preDWriteCallback().