duan ellis target tcl work in progress
[openocd.git] / src / server / gdb_server.c
index 8ebe94395f456468cb39855badfd22d50da4a7d6..8fb3b64f954f1c539516f14cc7024e6585f6600e 100644 (file)
@@ -649,7 +649,7 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
                case TARGET_EVENT_HALTED:
                        gdb_frontend_halted(target, connection);
                        break;
-               case TARGET_EVENT_GDB_PROGRAM:
+               case TARGET_EVENT_GDB_FLASH_ERASE_START:
                        gdb_program_handler(target, event, connection->cmd_ctx);
                        break;
                default:
@@ -1769,7 +1769,7 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
                flash_set_dirty();
 
                /* perform any target specific operations before the erase */
-               target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_PROGRAM);
+               target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_ERASE_START);
 
                /* perform erase */
                if ((result = flash_erase_address_range(gdb_service->target, addr, length)) != ERROR_OK)
@@ -2063,8 +2063,7 @@ int gdb_input(connection_t *connection)
 int gdb_init(void)
 {
        gdb_service_t *gdb_service;
-       target_t *target = targets;
-       int i = 0;
+       target_t *target = all_targets;
 
        if (!target)
        {
@@ -2082,16 +2081,21 @@ int gdb_init(void)
        {
                char service_name[8];
 
-               snprintf(service_name, 8, "gdb-%2.2i", i);
+               snprintf(service_name, 8, "gdb-%2.2i", target->target_number);
 
                gdb_service = malloc(sizeof(gdb_service_t));
                gdb_service->target = target;
 
-               add_service("gdb", CONNECTION_GDB, gdb_port + i, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service);
+               add_service("gdb", CONNECTION_GDB, 
+                           gdb_port + target->target_number, 
+                           1, gdb_new_connection, gdb_input, 
+                           gdb_connection_closed, 
+                           gdb_service);
 
-               LOG_DEBUG("gdb service for target %s at port %i", target->type->name, gdb_port + i);
+               LOG_DEBUG("gdb service for target %s at port %i", 
+                         target->type->name, 
+                         gdb_port + target->target_number);
 
-               i++;
                target = target->next;
        }
 

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)