summaryrefslogtreecommitdiff
path: root/src/server/gdb_server.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-08-30 17:30:14 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-08-30 17:30:14 +0000
commitd879faa3cb8200c1c31e1a52c42e9bbacb9fac40 (patch)
treef4615c0c22e50f94c61a292ce3d582132ca2d789 /src/server/gdb_server.c
parent4b9bdd664a79d5713b22a178086b071abc049d01 (diff)
downloadopenocd_libswd-d879faa3cb8200c1c31e1a52c42e9bbacb9fac40.tar.gz
openocd_libswd-d879faa3cb8200c1c31e1a52c42e9bbacb9fac40.tar.bz2
openocd_libswd-d879faa3cb8200c1c31e1a52c42e9bbacb9fac40.tar.xz
openocd_libswd-d879faa3cb8200c1c31e1a52c42e9bbacb9fac40.zip
David Brownell <david-b@pacbell.net> start phasing out integers as target IDs
git-svn-id: svn://svn.berlios.de/openocd/trunk@2650 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/server/gdb_server.c')
-rw-r--r--src/server/gdb_server.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 48144f26..948e44ba 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -2156,7 +2156,9 @@ int gdb_input_inner(connection_t *connection)
/* handle extended restart packet */
breakpoint_clear_target(gdb_service->target);
watchpoint_clear_target(gdb_service->target);
- command_run_linef(connection->cmd_ctx, "ocd_gdb_restart %d", get_num_by_target(target));
+ command_run_linef(connection->cmd_ctx,
+ "ocd_gdb_restart %s",
+ target->cmd_name);
break;
default:
/* ignore unkown packets */
@@ -2230,17 +2232,23 @@ int gdb_init(void)
}
else
{
+ unsigned short port = gdb_port;
+
while (target)
{
gdb_service = malloc(sizeof(gdb_service_t));
gdb_service->target = target;
- add_service("gdb", CONNECTION_TCP, gdb_port + target->target_number, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service);
+ add_service("gdb", CONNECTION_TCP,
+ port, 1,
+ gdb_new_connection, gdb_input,
+ gdb_connection_closed, gdb_service);
- LOG_DEBUG("gdb service for target %s at port %i",
+ LOG_DEBUG("gdb service for target %s at TCP port %i",
target_get_name(target),
- gdb_port + target->target_number);
+ port);
target = target->next;
+ port++;
}
}