#define _DEBUG_GDB_IO_
#endif
-static gdb_connection_t *current_gdb_connection;
+static struct gdb_connection *current_gdb_connection;
static int gdb_breakpoint_override;
static enum breakpoint_type gdb_breakpoint_override_type;
*/
struct timeval tv;
fd_set read_fds;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
int t;
if (got_data == NULL)
got_data=&t;
int gdb_get_char(connection_t *connection, int* next_char)
{
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
int retval = ERROR_OK;
#ifdef _DEBUG_GDB_IO_
int gdb_putback_char(connection_t *connection, int last_char)
{
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
if (gdb_con->buf_p > gdb_con->buffer)
{
* succeed. Shudder! */
int gdb_write(connection_t *connection, void *data, int len)
{
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
if (gdb_con->closed)
return ERROR_SERVER_REMOTE_CLOSED;
#endif
int reply;
int retval;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
for (i = 0; i < len; i++)
my_checksum += buffer[i];
int gdb_put_packet(connection_t *connection, char *buffer, int len)
{
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
gdb_con->busy = 1;
int retval = gdb_put_packet_inner(connection, buffer, len);
gdb_con->busy = 0;
int character;
int retval;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
my_checksum = 0;
int count = 0;
count = 0;
{
int character;
int retval;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
while (1)
{
int gdb_get_packet(connection_t *connection, char *buffer, int *len)
{
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
gdb_con->busy = 1;
int retval = gdb_get_packet_inner(connection, buffer, len);
gdb_con->busy = 0;
static void gdb_frontend_halted(struct target_s *target, connection_t *connection)
{
- gdb_connection_t *gdb_connection = connection->priv;
+ struct gdb_connection *gdb_connection = connection->priv;
/* In the GDB protocol when we are stepping or continuing execution,
* we have a lingering reply. Upon receiving a halted event
int gdb_new_connection(connection_t *connection)
{
- gdb_connection_t *gdb_connection = malloc(sizeof(gdb_connection_t));
- gdb_service_t *gdb_service = connection->service->priv;
+ struct gdb_connection *gdb_connection = malloc(sizeof(struct gdb_connection));
+ struct gdb_service *gdb_service = connection->service->priv;
int retval;
int initial_ack;
int gdb_connection_closed(connection_t *connection)
{
- gdb_service_t *gdb_service = connection->service->priv;
- gdb_connection_t *gdb_connection = connection->priv;
+ struct gdb_service *gdb_service = connection->service->priv;
+ struct gdb_connection *gdb_connection = connection->priv;
/* we're done forwarding messages. Tear down callback before
* cleaning up connection.
int gdb_query_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
{
command_context_t *cmd_ctx = connection->cmd_ctx;
- gdb_connection_t *gdb_connection = connection->priv;
+ struct gdb_connection *gdb_connection = connection->priv;
if (strstr(packet, "qRcmd,"))
{
int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
{
- gdb_connection_t *gdb_connection = connection->priv;
- gdb_service_t *gdb_service = connection->service->priv;
+ struct gdb_connection *gdb_connection = connection->priv;
+ struct gdb_service *gdb_service = connection->service->priv;
int result;
/* if flash programming disabled - send a empty reply */
int gdb_detach(connection_t *connection, target_t *target)
{
- gdb_service_t *gdb_service = connection->service->priv;
+ struct gdb_service *gdb_service = connection->service->priv;
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_DETACH);
const char *function, const char *string)
{
connection_t *connection = priv;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
if (gdb_con->busy)
{
int gdb_input_inner(connection_t *connection)
{
- gdb_service_t *gdb_service = connection->service->priv;
+ struct gdb_service *gdb_service = connection->service->priv;
target_t *target = gdb_service->target;
char *packet = gdb_packet_buffer;
int packet_size;
int retval;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
static int extended_protocol = 0;
/* drain input buffer */
{
int retval = ERROR_OK;
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
log_add_callback(gdb_log_callback, connection);
bool nostep = false;
int gdb_input(connection_t *connection)
{
int retval = gdb_input_inner(connection);
- gdb_connection_t *gdb_con = connection->priv;
+ struct gdb_connection *gdb_con = connection->priv;
if (retval == ERROR_SERVER_REMOTE_CLOSED)
return retval;
int gdb_init(void)
{
- gdb_service_t *gdb_service;
+ struct gdb_service *gdb_service;
target_t *target = all_targets;
if (!target)
{
/* only a single gdb connection when using a pipe */
- gdb_service = malloc(sizeof(gdb_service_t));
+ gdb_service = malloc(sizeof(struct gdb_service));
gdb_service->target = target;
add_service("gdb", CONNECTION_PIPE, 0, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service);
while (target)
{
- gdb_service = malloc(sizeof(gdb_service_t));
+ gdb_service = malloc(sizeof(struct gdb_service));
gdb_service->target = target;
add_service("gdb", CONNECTION_TCP,
return ERROR_OK;
}
-static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_sync_command)
{
if (argc != 0)
{
}
/* daemon configuration command gdb_port */
-static int handle_gdb_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_port_command)
{
- return server_port_command(cmd_ctx, cmd, args, argc, &gdb_port);
+ return CALL_COMMAND_HANDLER(server_port_command, &gdb_port);
}
-static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_memory_map_command)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_flash_program_command)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_report_data_abort_command)
{
if (argc == 1)
{
}
/* gdb_breakpoint_override */
-static int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_breakpoint_override_command)
{
if (argc == 0)
{