From 2653b8030722c85393974cd6c0ebcdbd1ae27c72 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 25 Nov 2009 16:38:08 -0800 Subject: target: create and use target_name() Several of the sites now using target_type_name() really ought to be using an instance-specific name. Create a function called target_name(), accessing the instance's own (command) name. Use it in several places that really should be displaying instance-specific names. Also in several places which were already doing so, but which had no wrapper to call. Signed-off-by: David Brownell --- src/server/gdb_server.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server') diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index f733e7b..bd1d047 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -774,7 +774,7 @@ int gdb_new_connection(struct connection *connection) gdb_actual_connections++; LOG_DEBUG("New GDB Connection: %d, Target %s, state: %s", gdb_actual_connections, - gdb_service->target->cmd_name, + target_name(gdb_service->target), target_state_name(gdb_service->target)); return ERROR_OK; @@ -792,7 +792,7 @@ int gdb_connection_closed(struct connection *connection) gdb_actual_connections--; LOG_DEBUG("GDB Close, Target: %s, state: %s, gdb_actual_connections=%d", - gdb_service->target->cmd_name, + target_name(gdb_service->target), target_state_name(gdb_service->target), gdb_actual_connections); @@ -2138,7 +2138,7 @@ int gdb_input_inner(struct connection *connection) watchpoint_clear_target(gdb_service->target); command_run_linef(connection->cmd_ctx, "ocd_gdb_restart %s", - target->cmd_name); + target_name(target)); break; default: /* ignore unkown packets */ @@ -2216,7 +2216,7 @@ int gdb_init(void) add_service("gdb", CONNECTION_PIPE, 0, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s using pipes", - target_type_name(target)); + target_name(target)); } else { @@ -2233,7 +2233,7 @@ int gdb_init(void) gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s at TCP port %i", - target_type_name(target), + target_name(target), port); target = target->next; port++; -- cgit v1.1