|
ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
|
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). | |
| void | cleanup () override |
| this function is called after cpu execution loop (etiss::CPUCore::execute) finished. | |
| etiss::int32 | execute () override |
| called before a block and may act in the same way as a block | |
| void | finalizeInstrSet (etiss::instr::ModedInstructionSet &) const override |
| called after all instructions have been added to allow last changes | |
| void | finalizeCodeBlock (etiss::CodeBlock &) const override |
| called after all instructions have been translated for the code block | |
| void * | getPluginHandle () override |
| called to get the handle that is available in translated code via getPoinerCode(). [default: this] | |
| ETISS_System * | wrap (ETISS_CPU *cpu, ETISS_System *system) override |
| SystemWrapper,. | |
| ETISS_System * | unwrap (ETISS_CPU *cpu, ETISS_System *system) override |
| undo wrap function call this function will be called AFTER etiss::Plugin::cleanup | |
| 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 | |
| virtual bool | isActive () |
| indicates if the plugin will do something in execution loop. | |
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 | |
| virtual void | initCodeBlock (etiss::CodeBlock &) const |
| called before instructions are translated for the code block | |
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. | |
| virtual void | removedFromCPUCore (etiss::CPUCore *core) |
| called as soon a plugin has been removed from its CPUCore. | |
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. | |
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 | |
| ETISS_System * | plugin_system_ |
| holds a pointer to the system structure. | |
| CPUArch * | plugin_arch_ |
| holds a pointer to the CPUArch instance. will be set before init call and after cleanup call | |
| CPUCore * | plugin_core_ |
| holds a pointer to the associated CPUCore instance. | |
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 | |
| static const unsigned | COROUTINE = 1 << 1 |
| callback after execution of each translated block | |
| static const unsigned | SYSTEMWRAPPER = 1 << 2 |
| can wrap/change ETISS_System structure at execution start | |
| static const unsigned | REGISTERDEVICE |
| gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) | |
| static const unsigned | TRANSLATION |
| access to translated code during translation phase or when instruction tree is built | |
gdb server implementation that is used as a plugin in etiss
Definition at line 84 of file GDBServer.h.
| Server::Server | ( | etiss::plugin::gdb::PacketProtocol & | pp | ) |
Definition at line 123 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_.
|
overrideprotectedvirtual |
Implements etiss::Plugin.
Definition at line 778 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 795 of file GDBServer.cpp.
Definition at line 844 of file GDBServer.cpp.
References etiss::log(), s, etiss::toString(), and etiss::VERBOSE.

|
static |
Definition at line 802 of file GDBServer.cpp.
References createTCPServer(), etiss::ERROR, etiss::log(), options, and s.
Referenced by createTCPServer(), and ETISSINCLUDED_createPlugin().


|
overridevirtual |
called before a block and may act in the same way as a block
Implements etiss::CoroutinePlugin.
Definition at line 191 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 246 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 238 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 783 of file GDBServer.cpp.
|
protected |
Definition at line 253 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::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 788 of file GDBServer.cpp.
| etiss::int32 Server::postMemAccessCallback | ( | etiss::int32 | exception | ) |
Definition at line 744 of file GDBServer.cpp.
References con_, cpu_, etiss::plugin::gdb::hex::fromByte(), gdb_status_paused_, handlePacket(), ETISS_CPU::instructionPointer, 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 723 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 733 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 139 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::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 108 of file GDBSystemWrapper.cpp.
References ETISS_GDBSystem::sys_.
|
overridevirtual |
SystemWrapper,.
Implements etiss::SystemWrapperPlugin.
Definition at line 78 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 118 of file GDBServer.h.
Referenced by cleanup(), handlePacket(), init(), preInstructionCallback(), and Server().
|
protected |
Definition at line 128 of file GDBServer.h.
Referenced by handlePacket(), and preInstructionCallback().
|
private |
Definition at line 135 of file GDBServer.h.
|
protected |
Definition at line 117 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), and preInstructionCallback().
|
protected |
Definition at line 119 of file GDBServer.h.
Referenced by cleanup(), init(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 130 of file GDBServer.h.
|
protected |
Definition at line 131 of file GDBServer.h.
|
protected |
Definition at line 123 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 132 of file GDBServer.h.
Referenced by handlePacket(), preInstructionCallback(), and Server().
|
protected |
Definition at line 127 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 122 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preDReadCallback(), preDWriteCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 125 of file GDBServer.h.
Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 126 of file GDBServer.h.
Referenced by execute(), handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().
|
protected |
Definition at line 124 of file GDBServer.h.
Referenced by handlePacket(), preInstructionCallback(), and Server().
|
protected |
Definition at line 120 of file GDBServer.h.
Referenced by cleanup(), handlePacket(), init(), and Server().
|
protected |
Definition at line 121 of file GDBServer.h.
Referenced by wrap().
|
protected |
Definition at line 129 of file GDBServer.h.
Referenced by handlePacket(), preDReadCallback(), and preDWriteCallback().