simulavr  1.1.0
GdbServer Class Reference

GDB server instance to give the possibility to debug target by debugger. More...

#include <gdb.h>

Inheritance diagram for GdbServer:

Public Member Functions

int Step (bool &trueHwStep, SystemClockOffset *timeToNextStepIn_ns=0)
 Return nonzero if a breakpoint was hit. More...
 
int InternalStep (bool &trueHwStep, SystemClockOffset *timeToNextStepIn_ns=0)
 
void TryConnectGdb ()
 
void SendPosition (int signal)
 
int SleepStep ()
 
 GdbServer (AvrDevice *, int port, int debugOn, int WaitForGdbConnection=true)
 
virtual ~GdbServer ()
 
void Run ()
 
- Public Member Functions inherited from SimulationMember
virtual ~SimulationMember ()
 

Protected Member Functions

bool avr_core_flash_read (int addr, word &val)
 
void avr_core_flash_write (int addr, word val)
 
void avr_core_flash_write_hi8 (int addr, byte val)
 
void avr_core_flash_write_lo8 (int addr, byte val)
 
void avr_core_remove_breakpoint (dword pc)
 
void avr_core_insert_breakpoint (dword pc)
 
int signal_has_occurred (int signo)
 
void signal_watch_start (int signo)
 
void signal_watch_stop (int signo)
 
int avr_core_step ()
 
int hex2nib (char hex)
 
const char * gdb_last_reply (const char *reply)
 
void gdb_send_ack ()
 
void gdb_send_reply (const char *reply)
 
void gdb_send_hex_reply (const char *reply, const char *reply_to_encode)
 
void gdb_read_registers ()
 
void gdb_write_registers (const char *pkt)
 
int gdb_extract_hex_num (const char **pkt, char stop)
 
void gdb_read_register (const char *pkt)
 
void gdb_write_register (const char *pkt)
 
int gdb_get_addr_len (const char *pkt, char a_end, char l_end, unsigned int *addr, int *len)
 
void gdb_read_memory (const char *pkt)
 
void gdb_write_memory (const char *pkt)
 
void gdb_break_point (const char *pkt)
 
void gdb_select_thread (const char *pkt)
 
void gdb_is_thread_alive (const char *pkt)
 
void gdb_get_thread_list (const char *pkt)
 
int gdb_get_signal (const char *pkt)
 
int gdb_parse_packet (const char *pkt)
 
int gdb_receive_and_process_packet (int blocking)
 
void gdb_main_loop ()
 
void gdb_interact (int port, int debug_on)
 
void IdleStep ()
 

Protected Attributes

AvrDevicecore
 
GdbServerSocketserver
 the server socket wrapper More...
 
bool connState
 result of server->Connect() More...
 
time_t oldTime
 
int global_debug_on
 debugging the debugger interface More...
 
int waitForGdbConnection
 
bool exitOnKillRequest
 flag for regression test to shutdown simulator on kill request from gdb More...
 
int runMode
 
bool lastCoreStepFinished
 
char * last_reply
 
char buf [MAX_BUF]
 
int m_gdb_thread_id
 For queries by GDB. First thread ID is 1. See http://sources.redhat.com/gdb/current/onlinedocs/gdb/Packets.html#thread-id. More...
 

Static Protected Attributes

static std::vector< GdbServer * > allGdbServers
 

Detailed Description

GDB server instance to give the possibility to debug target by debugger.

Definition at line 82 of file gdb.h.

Constructor & Destructor Documentation

◆ GdbServer()

GdbServer::GdbServer ( AvrDevice ,
int  port,
int  debugOn,
int  WaitForGdbConnection = true 
)

◆ ~GdbServer()

virtual GdbServer::~GdbServer ( )
virtual

Member Function Documentation

◆ avr_core_flash_read()

bool GdbServer::avr_core_flash_read ( int  addr,
word val 
)
protected

◆ avr_core_flash_write()

void GdbServer::avr_core_flash_write ( int  addr,
word  val 
)
protected

◆ avr_core_flash_write_hi8()

void GdbServer::avr_core_flash_write_hi8 ( int  addr,
byte  val 
)
protected

◆ avr_core_flash_write_lo8()

void GdbServer::avr_core_flash_write_lo8 ( int  addr,
byte  val 
)
protected

◆ avr_core_insert_breakpoint()

void GdbServer::avr_core_insert_breakpoint ( dword  pc)
protected

◆ avr_core_remove_breakpoint()

void GdbServer::avr_core_remove_breakpoint ( dword  pc)
protected

◆ avr_core_step()

int GdbServer::avr_core_step ( )
protected

◆ gdb_break_point()

void GdbServer::gdb_break_point ( const char *  pkt)
protected

◆ gdb_extract_hex_num()

int GdbServer::gdb_extract_hex_num ( const char **  pkt,
char  stop 
)
protected

◆ gdb_get_addr_len()

int GdbServer::gdb_get_addr_len ( const char *  pkt,
char  a_end,
char  l_end,
unsigned int *  addr,
int *  len 
)
protected

◆ gdb_get_signal()

int GdbServer::gdb_get_signal ( const char *  pkt)
protected

◆ gdb_get_thread_list()

void GdbServer::gdb_get_thread_list ( const char *  pkt)
protected

◆ gdb_interact()

void GdbServer::gdb_interact ( int  port,
int  debug_on 
)
protected

◆ gdb_is_thread_alive()

void GdbServer::gdb_is_thread_alive ( const char *  pkt)
protected

◆ gdb_last_reply()

const char* GdbServer::gdb_last_reply ( const char *  reply)
protected

◆ gdb_main_loop()

void GdbServer::gdb_main_loop ( )
protected

◆ gdb_parse_packet()

int GdbServer::gdb_parse_packet ( const char *  pkt)
protected

◆ gdb_read_memory()

void GdbServer::gdb_read_memory ( const char *  pkt)
protected

◆ gdb_read_register()

void GdbServer::gdb_read_register ( const char *  pkt)
protected

◆ gdb_read_registers()

void GdbServer::gdb_read_registers ( )
protected

◆ gdb_receive_and_process_packet()

int GdbServer::gdb_receive_and_process_packet ( int  blocking)
protected

◆ gdb_select_thread()

void GdbServer::gdb_select_thread ( const char *  pkt)
protected

◆ gdb_send_ack()

void GdbServer::gdb_send_ack ( )
protected

◆ gdb_send_hex_reply()

void GdbServer::gdb_send_hex_reply ( const char *  reply,
const char *  reply_to_encode 
)
protected

◆ gdb_send_reply()

void GdbServer::gdb_send_reply ( const char *  reply)
protected

◆ gdb_write_memory()

void GdbServer::gdb_write_memory ( const char *  pkt)
protected

◆ gdb_write_register()

void GdbServer::gdb_write_register ( const char *  pkt)
protected

◆ gdb_write_registers()

void GdbServer::gdb_write_registers ( const char *  pkt)
protected

◆ hex2nib()

int GdbServer::hex2nib ( char  hex)
protected

◆ IdleStep()

void GdbServer::IdleStep ( )
protected

◆ InternalStep()

int GdbServer::InternalStep ( bool &  trueHwStep,
SystemClockOffset timeToNextStepIn_ns = 0 
)

◆ Run()

void GdbServer::Run ( )

◆ SendPosition()

void GdbServer::SendPosition ( int  signal)

◆ signal_has_occurred()

int GdbServer::signal_has_occurred ( int  signo)
protected

◆ signal_watch_start()

void GdbServer::signal_watch_start ( int  signo)
protected

◆ signal_watch_stop()

void GdbServer::signal_watch_stop ( int  signo)
protected

◆ SleepStep()

int GdbServer::SleepStep ( )

◆ Step()

int GdbServer::Step ( bool &  trueHwStep,
SystemClockOffset timeToNextStepIn_ns = 0 
)
virtual

Return nonzero if a breakpoint was hit.

Implements SimulationMember.

◆ TryConnectGdb()

void GdbServer::TryConnectGdb ( )

Member Data Documentation

◆ allGdbServers

std::vector<GdbServer*> GdbServer::allGdbServers
staticprotected

Definition at line 85 of file gdb.h.

◆ buf

char GdbServer::buf[MAX_BUF]
protected

Definition at line 103 of file gdb.h.

◆ connState

bool GdbServer::connState
protected

result of server->Connect()

Definition at line 88 of file gdb.h.

◆ core

AvrDevice* GdbServer::core
protected

Definition at line 86 of file gdb.h.

◆ exitOnKillRequest

bool GdbServer::exitOnKillRequest
protected

flag for regression test to shutdown simulator on kill request from gdb

Definition at line 96 of file gdb.h.

◆ global_debug_on

int GdbServer::global_debug_on
protected

debugging the debugger interface

Definition at line 94 of file gdb.h.

◆ last_reply

char* GdbServer::last_reply
protected

Definition at line 102 of file gdb.h.

◆ lastCoreStepFinished

bool GdbServer::lastCoreStepFinished
protected

Definition at line 98 of file gdb.h.

◆ m_gdb_thread_id

int GdbServer::m_gdb_thread_id
protected

For queries by GDB. First thread ID is 1. See http://sources.redhat.com/gdb/current/onlinedocs/gdb/Packets.html#thread-id.

Definition at line 104 of file gdb.h.

◆ oldTime

time_t GdbServer::oldTime
protected

remember when we have tried to open a tcp connection last time. Only one try per second

Definition at line 92 of file gdb.h.

◆ runMode

int GdbServer::runMode
protected

Definition at line 97 of file gdb.h.

◆ server

GdbServerSocket* GdbServer::server
protected

the server socket wrapper

Definition at line 87 of file gdb.h.

◆ waitForGdbConnection

int GdbServer::waitForGdbConnection
protected

Definition at line 95 of file gdb.h.


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