ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
etiss::plugin::gdb::Server Class Reference

gdb server implementation that is used as a plugin in etiss More...

#include <GDBServer.h>

Inheritance diagram for etiss::plugin::gdb::Server:
Inheritance graph
[legend]
Collaboration diagram for etiss::plugin::gdb::Server:
Collaboration graph
[legend]

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_Systemwrap (ETISS_CPU *cpu, ETISS_System *system) override
 SystemWrapper,. More...
 
ETISS_Systemunwrap (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 ()
 
InterruptListenerPlugingetInterruptListenerPlugin ()
 
CoroutinePlugingetCoroutinePlugin ()
 
SystemWrapperPlugingetSystemWrapperPlugin ()
 
RegisterDevicePlugingetRegisterDevicePlugin ()
 
TranslationPlugingetTranslationPlugin ()
 
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 ServercreateTCPServer (std::map< std::string, std::string > options)
 
static ServercreateTCPServer (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::PacketProtocolcon_
 
CPUArcharch_
 
ETISS_CPUcpu_
 
ETISS_Systemsystem_
 
ETISS_SystemunwrappedSys_
 
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_CPUplugin_cpu_
 holds a pointer to the cpu structure. will be set before init call and after cleanup call More...
 
ETISS_Systemplugin_system_
 holds a pointer to the system structure. More...
 
CPUArchplugin_arch_
 holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More...
 
CPUCoreplugin_core_
 holds a pointer to the associated CPUCore instance. More...
 

Private Attributes

std::shared_ptr< Connectioncinst_
 

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

Detailed Description

gdb server implementation that is used as a plugin in etiss

Definition at line 124 of file GDBServer.h.

Constructor & Destructor Documentation

◆ Server()

Server::Server ( etiss::plugin::gdb::PacketProtocol pp)

Member Function Documentation

◆ _getPluginName()

std::string Server::_getPluginName ( ) const
overrideprotectedvirtual

Implements etiss::Plugin.

Definition at line 809 of file GDBServer.cpp.

◆ cleanup()

void Server::cleanup ( )
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.

References arch_, cpu_, and system_.

◆ createTCPServer() [1/2]

Server * Server::createTCPServer ( int  port)
static

Definition at line 875 of file GDBServer.cpp.

References etiss::log(), s, Server(), etiss::toString(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ createTCPServer() [2/2]

Server * Server::createTCPServer ( std::map< std::string, std::string >  options)
static

Definition at line 833 of file GDBServer.cpp.

References etiss::ERROR, etiss::log(), options, and s.

Referenced by ETISSINCLUDED_createPlugin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

etiss::int32 Server::execute ( )
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.

Here is the call graph for this function:

◆ finalizeCodeBlock()

void Server::finalizeCodeBlock ( etiss::CodeBlock ) const
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().

Here is the call graph for this function:

◆ finalizeInstrSet()

void Server::finalizeInstrSet ( etiss::instr::ModedInstructionSet ) const
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().

Here is the call graph for this function:

◆ getPluginHandle()

void * Server::getPluginHandle ( )
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.

◆ handlePacket()

void Server::handlePacket ( bool  block)
protected

◆ init()

void Server::init ( ETISS_CPU cpu,
ETISS_System system,
etiss::CPUArch arch 
)
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.

References arch_, cpu_, and system_.

◆ postMemAccessCallback()

etiss::int32 Server::postMemAccessCallback ( etiss::int32  exception)

◆ preDReadCallback()

void Server::preDReadCallback ( etiss::uint64  addr)

◆ preDWriteCallback()

void Server::preDWriteCallback ( etiss::uint64  addr)

◆ preInstructionCallback()

etiss::int32 Server::preInstructionCallback ( )

◆ unwrap()

ETISS_System * Server::unwrap ( ETISS_CPU cpu,
ETISS_System system 
)
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.

◆ wrap()

ETISS_System * Server::wrap ( ETISS_CPU cpu,
ETISS_System system 
)
overridevirtual

Member Data Documentation

◆ arch_

CPUArch* etiss::plugin::gdb::Server::arch_
protected

Definition at line 159 of file GDBServer.h.

Referenced by cleanup(), handlePacket(), init(), preInstructionCallback(), and Server().

◆ breakpoints_

BreakpointDB etiss::plugin::gdb::Server::breakpoints_
protected

Definition at line 169 of file GDBServer.h.

Referenced by handlePacket(), and preInstructionCallback().

◆ cinst_

std::shared_ptr<Connection> etiss::plugin::gdb::Server::cinst_
private

Definition at line 176 of file GDBServer.h.

◆ con_

etiss::plugin::gdb::PacketProtocol& etiss::plugin::gdb::Server::con_
protected

Definition at line 158 of file GDBServer.h.

Referenced by handlePacket(), postMemAccessCallback(), and preInstructionCallback().

◆ cpu_

ETISS_CPU* etiss::plugin::gdb::Server::cpu_
protected

Definition at line 160 of file GDBServer.h.

Referenced by cleanup(), init(), postMemAccessCallback(), preInstructionCallback(), and Server().

◆ execute_skip_count

unsigned etiss::plugin::gdb::Server::execute_skip_count
protected

Definition at line 171 of file GDBServer.h.

Referenced by execute(), and Server().

◆ execute_skip_index

unsigned etiss::plugin::gdb::Server::execute_skip_index
protected

Definition at line 172 of file GDBServer.h.

Referenced by execute(), and Server().

◆ gdb_status_paused_

bool etiss::plugin::gdb::Server::gdb_status_paused_
protected

Definition at line 164 of file GDBServer.h.

Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().

◆ minimal_pc_alignment

unsigned etiss::plugin::gdb::Server::minimal_pc_alignment
protected

Definition at line 173 of file GDBServer.h.

Referenced by handlePacket(), preInstructionCallback(), and Server().

◆ status_jumpaddr_

etiss::uint64 etiss::plugin::gdb::Server::status_jumpaddr_
protected

Definition at line 168 of file GDBServer.h.

Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().

◆ status_paused_

bool etiss::plugin::gdb::Server::status_paused_
protected

◆ status_pending_jump_

bool etiss::plugin::gdb::Server::status_pending_jump_
protected

Definition at line 166 of file GDBServer.h.

Referenced by handlePacket(), postMemAccessCallback(), preInstructionCallback(), and Server().

◆ status_pending_kill_

bool etiss::plugin::gdb::Server::status_pending_kill_
protected

◆ status_step_

unsigned etiss::plugin::gdb::Server::status_step_
protected

Definition at line 165 of file GDBServer.h.

Referenced by handlePacket(), preInstructionCallback(), and Server().

◆ system_

ETISS_System* etiss::plugin::gdb::Server::system_
protected

Definition at line 161 of file GDBServer.h.

Referenced by cleanup(), handlePacket(), init(), and Server().

◆ unwrappedSys_

ETISS_System* etiss::plugin::gdb::Server::unwrappedSys_
protected

Definition at line 162 of file GDBServer.h.

Referenced by wrap().

◆ watchpoints_

BreakpointDB etiss::plugin::gdb::Server::watchpoints_
protected

Definition at line 170 of file GDBServer.h.

Referenced by handlePacket(), preDReadCallback(), and preDWriteCallback().


The documentation for this class was generated from the following files: