30 #include <sys/socket.h> 31 #include <sys/types.h> 32 #include <netinet/in.h> 33 #include <netinet/tcp.h> 34 #include <arpa/inet.h> 46 #define GDB_SIGHUP 1 // Hangup (POSIX). 47 #define GDB_SIGINT 2 // Interrupt (ANSI). 48 #define GDB_SIGILL 4 // Illegal instruction (ANSI). 49 #define GDB_SIGTRAP 5 // Trace trap (POSIX). 54 virtual void Close(
void) = 0;
56 virtual void Write(
const void* buf,
size_t count) = 0;
68 struct sockaddr_in address[1];
73 virtual void Close(
void);
75 virtual void Write(
const void* buf,
size_t count);
107 bool avr_core_flash_read(
int addr,
word& val) ;
108 void avr_core_flash_write(
int addr,
word val) ;
109 void avr_core_flash_write_hi8(
int addr,
byte val) ;
110 void avr_core_flash_write_lo8(
int addr,
byte val) ;
111 void avr_core_remove_breakpoint(
dword pc) ;
112 void avr_core_insert_breakpoint(
dword pc) ;
113 int signal_has_occurred(
int signo);
114 void signal_watch_start(
int signo);
115 void signal_watch_stop(
int signo);
116 int avr_core_step() ;
117 int hex2nib(
char hex);
118 const char* gdb_last_reply(
const char *reply);
120 void gdb_send_reply(
const char *reply);
121 void gdb_send_hex_reply(
const char *reply,
const char *reply_to_encode);
122 void gdb_read_registers();
123 void gdb_write_registers(
const char *pkt);
124 int gdb_extract_hex_num(
const char **pkt,
char stop);
125 void gdb_read_register(
const char *pkt);
126 void gdb_write_register(
const char *pkt);
127 int gdb_get_addr_len(
const char *pkt,
char a_end,
char l_end,
unsigned int *addr,
int *len);
128 void gdb_read_memory(
const char *pkt);
129 void gdb_write_memory(
const char *pkt);
130 void gdb_break_point(
const char *pkt);
131 void gdb_select_thread(
const char *pkt);
132 void gdb_is_thread_alive(
const char *pkt);
133 void gdb_get_thread_list(
const char *pkt);
134 int gdb_get_signal(
const char *pkt);
135 int gdb_parse_packet(
const char *pkt);
136 int gdb_receive_and_process_packet(
int blocking);
137 void gdb_main_loop();
138 void gdb_interact(
int port,
int debug_on);
144 void TryConnectGdb();
145 void SendPosition(
int signal);
Basic AVR device, contains the core functionality.
int m_gdb_thread_id
For queries by GDB. First thread ID is 1. See http://sources.redhat.com/gdb/current/onlinedocs/gdb/Pa...
bool lastCoreStepFinished
int global_debug_on
debugging the debugger interface
virtual ~GdbServerSocket()
int conn
the TCP connection from gdb client
virtual void Write(const void *buf, size_t count)=0
virtual bool Connect(void)=0
virtual int ReadByte(void)=0
bool connState
result of server->Connect()
static std::vector< GdbServer * > allGdbServers
Interface implementation for server socket wrapper on unix systems.
int sock
socket for listening for a new client
long long SystemClockOffset
GdbServerSocket * server
the server socket wrapper
virtual void SetBlockingMode(int mode)=0
virtual void CloseConnection(void)=0
virtual void Close(void)=0
GDB server instance to give the possibility to debug target by debugger.
bool exitOnKillRequest
flag for regression test to shutdown simulator on kill request from gdb
Interface for server socket wrapper.