gdb_connection_t -> struct gdb_connection
[openocd.git] / src / server / gdb_server.c
index 284def3ca755827f509602e7bc5a2e05cf3f6586..4d20a7dfee1fb22f4d1081efdbfa98508d9ab1cc 100644 (file)
@@ -40,7 +40,7 @@
 #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;
@@ -49,7 +49,7 @@ extern int gdb_error(connection_t *connection, int retval);
 static unsigned short gdb_port = 3333;
 static const char *DIGITS = "0123456789abcdef";
 
-static void gdb_log_callback(void *priv, const char *file, int line,
+static void gdb_log_callback(void *priv, const char *file, unsigned line,
                const char *function, const char *string);
 
 /* number of gdb connections, mainly to supress gdb related debugging spam
@@ -94,7 +94,7 @@ int check_pending(connection_t *connection, int timeout_s, int *got_data)
         */
        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;
@@ -130,7 +130,7 @@ int check_pending(connection_t *connection, int timeout_s, int *got_data)
 
 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_
@@ -238,7 +238,7 @@ int gdb_get_char(connection_t *connection, int* next_char)
 
 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)
        {
@@ -258,7 +258,7 @@ int gdb_putback_char(connection_t *connection, int last_char)
  * 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;
 
@@ -290,7 +290,7 @@ int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
 #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];
@@ -424,7 +424,7 @@ int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
 
 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;
@@ -442,7 +442,7 @@ static __inline__ int fetch_packet(connection_t *connection, int *checksum_ok, i
        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;
@@ -548,7 +548,7 @@ int gdb_get_packet_inner(connection_t *connection, char *buffer, int *len)
 {
        int character;
        int retval;
-       gdb_connection_t *gdb_con = connection->priv;
+       struct gdb_connection *gdb_con = connection->priv;
 
        while (1)
        {
@@ -621,7 +621,7 @@ int gdb_get_packet_inner(connection_t *connection, char *buffer, int *len)
 
 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;
@@ -660,7 +660,7 @@ int gdb_output(struct command_context_s *context, const char* line)
 
 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
@@ -725,7 +725,7 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
 
 int gdb_new_connection(connection_t *connection)
 {
-       gdb_connection_t *gdb_connection = malloc(sizeof(gdb_connection_t));
+       struct gdb_connection *gdb_connection = malloc(sizeof(struct gdb_connection));
        gdb_service_t *gdb_service = connection->service->priv;
        int retval;
        int initial_ack;
@@ -782,7 +782,7 @@ int gdb_new_connection(connection_t *connection)
 int gdb_connection_closed(connection_t *connection)
 {
        gdb_service_t *gdb_service = connection->service->priv;
-       gdb_connection_t *gdb_connection = connection->priv;
+       struct gdb_connection *gdb_connection = connection->priv;
 
        /* we're done forwarding messages. Tear down callback before
         * cleaning up connection.
@@ -1557,7 +1557,7 @@ static int compare_bank (const void * a, const void * b)
 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,"))
        {
@@ -1812,7 +1812,7 @@ int gdb_query_packet(connection_t *connection, target_t *target, char *packet, i
 
 int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
 {
-       gdb_connection_t *gdb_connection = connection->priv;
+       struct gdb_connection *gdb_connection = connection->priv;
        gdb_service_t *gdb_service = connection->service->priv;
        int result;
 
@@ -1956,11 +1956,11 @@ int gdb_detach(connection_t *connection, target_t *target)
        return gdb_put_packet(connection, "OK", 2);
 }
 
-static void gdb_log_callback(void *priv, const char *file, int line,
+static void gdb_log_callback(void *priv, const char *file, unsigned line,
                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)
        {
@@ -1989,7 +1989,7 @@ int gdb_input_inner(connection_t *connection)
        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 */
@@ -2063,7 +2063,7 @@ int gdb_input_inner(connection_t *connection)
                                        {
                                                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;
@@ -2183,7 +2183,7 @@ int gdb_input_inner(connection_t *connection)
 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;
 
@@ -2249,7 +2249,7 @@ int gdb_init(void)
        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)
        {
@@ -2269,12 +2269,12 @@ static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd,
 }
 
 /* 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)
        {
@@ -2295,7 +2295,7 @@ static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char
        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)
        {
@@ -2316,7 +2316,7 @@ static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, c
        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)
        {
@@ -2338,7 +2338,7 @@ static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ct
 }
 
 /* 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)
        {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)