static int gdb_breakpoint_override;
static enum breakpoint_type gdb_breakpoint_override_type;
-extern int gdb_error(connection_t *connection, int retval);
+extern int gdb_error(struct connection *connection, int retval);
static unsigned short gdb_port = 3333;
static const char *DIGITS = "0123456789abcdef";
}
}
-int check_pending(connection_t *connection, int timeout_s, int *got_data)
+int check_pending(struct connection *connection, int timeout_s, int *got_data)
{
/* a non-blocking socket will block if there is 0 bytes available on the socket,
* but return with as many bytes as are available immediately
return ERROR_OK;
}
-int gdb_get_char(connection_t *connection, int* next_char)
+int gdb_get_char(struct connection *connection, int* next_char)
{
struct gdb_connection *gdb_con = connection->priv;
int retval = ERROR_OK;
return retval;
}
-int gdb_putback_char(connection_t *connection, int last_char)
+int gdb_putback_char(struct connection *connection, int last_char)
{
struct gdb_connection *gdb_con = connection->priv;
/* The only way we can detect that the socket is closed is the first time
* we write to it, we will fail. Subsequent write operations will
* succeed. Shudder! */
-int gdb_write(connection_t *connection, void *data, int len)
+int gdb_write(struct connection *connection, void *data, int len)
{
struct gdb_connection *gdb_con = connection->priv;
if (gdb_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
}
-int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
+int gdb_put_packet_inner(struct connection *connection, char *buffer, int len)
{
int i;
unsigned char my_checksum = 0;
return ERROR_OK;
}
-int gdb_put_packet(connection_t *connection, char *buffer, int len)
+int gdb_put_packet(struct connection *connection, char *buffer, int len)
{
struct gdb_connection *gdb_con = connection->priv;
gdb_con->busy = 1;
return retval;
}
-static __inline__ int fetch_packet(connection_t *connection, int *checksum_ok, int noack, int *len, char *buffer)
+static __inline__ int fetch_packet(struct connection *connection, int *checksum_ok, int noack, int *len, char *buffer)
{
unsigned char my_checksum = 0;
char checksum[3];
return ERROR_OK;
}
-int gdb_get_packet_inner(connection_t *connection, char *buffer, int *len)
+int gdb_get_packet_inner(struct connection *connection, char *buffer, int *len)
{
int character;
int retval;
return ERROR_OK;
}
-int gdb_get_packet(connection_t *connection, char *buffer, int *len)
+int gdb_get_packet(struct connection *connection, char *buffer, int *len)
{
struct gdb_connection *gdb_con = connection->priv;
gdb_con->busy = 1;
return retval;
}
-int gdb_output_con(connection_t *connection, const char* line)
+int gdb_output_con(struct connection *connection, const char* line)
{
char *hex_buffer;
int i, bin_size;
}
-static void gdb_frontend_halted(struct target_s *target, connection_t *connection)
+static void gdb_frontend_halted(struct target_s *target, struct connection *connection)
{
struct gdb_connection *gdb_connection = connection->priv;
int gdb_target_callback_event_handler(struct target_s *target, enum target_event event, void *priv)
{
int retval;
- connection_t *connection = priv;
+ struct connection *connection = priv;
target_handle_event(target, event);
switch (event)
return ERROR_OK;
}
-int gdb_new_connection(connection_t *connection)
+int gdb_new_connection(struct connection *connection)
{
struct gdb_connection *gdb_connection = malloc(sizeof(struct gdb_connection));
struct gdb_service *gdb_service = connection->service->priv;
return ERROR_OK;
}
-int gdb_connection_closed(connection_t *connection)
+int gdb_connection_closed(struct connection *connection)
{
struct gdb_service *gdb_service = connection->service->priv;
struct gdb_connection *gdb_connection = connection->priv;
return ERROR_OK;
}
-void gdb_send_error(connection_t *connection, uint8_t the_error)
+void gdb_send_error(struct connection *connection, uint8_t the_error)
{
char err[4];
snprintf(err, 4, "E%2.2X", the_error);
gdb_put_packet(connection, err, 3);
}
-int gdb_last_signal_packet(connection_t *connection, target_t *target, char* packet, int packet_size)
+int gdb_last_signal_packet(struct connection *connection, target_t *target, char* packet, int packet_size)
{
char sig_reply[4];
int signal;
}
}
-int gdb_get_registers_packet(connection_t *connection, target_t *target, char* packet, int packet_size)
+int gdb_get_registers_packet(struct connection *connection, target_t *target, char* packet, int packet_size)
{
reg_t **reg_list;
int reg_list_size;
return ERROR_OK;
}
-int gdb_set_registers_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_set_registers_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
int i;
reg_t **reg_list;
return ERROR_OK;
}
-int gdb_get_register_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_get_register_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
char *reg_packet;
int reg_num = strtoul(packet + 1, NULL, 16);
return ERROR_OK;
}
-int gdb_set_register_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_set_register_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
char *separator;
uint8_t *bin_buf;
return ERROR_OK;
}
-int gdb_error(connection_t *connection, int retval)
+int gdb_error(struct connection *connection, int retval)
{
switch (retval)
{
*
* 8191 bytes by the looks of it. Why 8191 bytes instead of 8192?????
*/
-int gdb_read_memory_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_read_memory_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
char *separator;
uint32_t addr = 0;
return retval;
}
-int gdb_write_memory_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_write_memory_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
char *separator;
uint32_t addr = 0;
return retval;
}
-int gdb_write_memory_binary_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_write_memory_binary_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
char *separator;
uint32_t addr = 0;
return ERROR_OK;
}
-int gdb_step_continue_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_step_continue_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
int current = 0;
uint32_t address = 0x0;
return retval;
}
-int gdb_breakpoint_watchpoint_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_breakpoint_watchpoint_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
int type;
enum breakpoint_type bp_type = BKPT_SOFT /* dummy init to avoid warning */;
}
}
-int gdb_query_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_query_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
command_context_t *cmd_ctx = connection->cmd_ctx;
struct gdb_connection *gdb_connection = connection->priv;
return ERROR_OK;
}
-int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+int gdb_v_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{
struct gdb_connection *gdb_connection = connection->priv;
struct gdb_service *gdb_service = connection->service->priv;
return ERROR_OK;
}
-int gdb_detach(connection_t *connection, target_t *target)
+int gdb_detach(struct connection *connection, target_t *target)
{
struct gdb_service *gdb_service = connection->service->priv;
static void gdb_log_callback(void *priv, const char *file, unsigned line,
const char *function, const char *string)
{
- connection_t *connection = priv;
+ struct connection *connection = priv;
struct gdb_connection *gdb_con = connection->priv;
if (gdb_con->busy)
/* Do not allocate this on the stack */
char gdb_packet_buffer[GDB_BUFFER_SIZE];
-static void gdb_sig_halted(connection_t *connection)
+static void gdb_sig_halted(struct connection *connection)
{
char sig_reply[4];
snprintf(sig_reply, 4, "T%2.2x", 2);
}
-int gdb_input_inner(connection_t *connection)
+int gdb_input_inner(struct connection *connection)
{
struct gdb_service *gdb_service = connection->service->priv;
target_t *target = gdb_service->target;
return ERROR_OK;
}
-int gdb_input(connection_t *connection)
+int gdb_input(struct connection *connection)
{
int retval = gdb_input_inner(connection);
struct gdb_connection *gdb_con = connection->priv;
* we write to it, we will fail. Subsequent write operations will
* succeed. Shudder!
*/
-int telnet_write(connection_t *connection, const void *data, int len)
+int telnet_write(struct connection *connection, const void *data, int len)
{
struct telnet_connection *t_con = connection->priv;
if (t_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
}
-int telnet_prompt(connection_t *connection)
+int telnet_prompt(struct connection *connection)
{
struct telnet_connection *t_con = connection->priv;
return telnet_write(connection, t_con->prompt, strlen(t_con->prompt));
}
-int telnet_outputline(connection_t *connection, const char *line)
+int telnet_outputline(struct connection *connection, const char *line)
{
int len;
int telnet_output(struct command_context_s *cmd_ctx, const char* line)
{
- connection_t *connection = cmd_ctx->output_handler_priv;
+ struct connection *connection = cmd_ctx->output_handler_priv;
return telnet_outputline(connection, line);
}
void telnet_log_callback(void *priv, const char *file, unsigned line,
const char *function, const char *string)
{
- connection_t *connection = priv;
+ struct connection *connection = priv;
struct telnet_connection *t_con = connection->priv;
int i;
telnet_write(connection, "\b", 1);
}
-int telnet_new_connection(connection_t *connection)
+int telnet_new_connection(struct connection *connection)
{
struct telnet_connection *telnet_connection = malloc(sizeof(struct telnet_connection));
struct telnet_service *telnet_service = connection->service->priv;
return ERROR_OK;
}
-void telnet_clear_line(connection_t *connection, struct telnet_connection *t_con)
+void telnet_clear_line(struct connection *connection, struct telnet_connection *t_con)
{
/* move to end of line */
if (t_con->line_cursor < t_con->line_size)
t_con->line_cursor = 0;
}
-int telnet_input(connection_t *connection)
+int telnet_input(struct connection *connection)
{
int bytes_read;
char buffer[TELNET_BUFFER_SIZE];
return ERROR_OK;
}
-int telnet_connection_closed(connection_t *connection)
+int telnet_connection_closed(struct connection *connection)
{
struct telnet_connection *t_con = connection->priv;
int i;
return ERROR_OK;
}
-int telnet_set_prompt(connection_t *connection, char *prompt)
+int telnet_set_prompt(struct connection *connection, char *prompt)
{
struct telnet_connection *t_con = connection->priv;