X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fserver%2Ftcl_server.c;h=1ec45ffbb1856f13b980090f1b768858c454afd3;hp=0077339f23c915abd0c92e8d52a72bf99b64f483;hb=5202d82a954627c6706529a82447aad4c63aefcc;hpb=69ff7354d9c9accf09374772310098f1f00e8ccb diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index 0077339f23..1ec45ffbb1 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -157,7 +157,7 @@ static int tcl_new_connection(struct connection *connection) connection->priv = tclc; - struct target *target = get_target_by_num(connection->cmd_ctx->current_target); + struct target *target = get_current_target_or_null(connection->cmd_ctx); if (target != NULL) tclc->tc_laststate = target->state; @@ -246,7 +246,7 @@ static int tcl_input(struct connection *connection) retval = tcl_output(connection, result, reslen); if (retval != ERROR_OK) return retval; - /* Always output ctrl-d as end of line to allow multiline results */ + /* Always output ctrl-z as end of line to allow multiline results */ tcl_output(connection, "\x1a", 1); } @@ -359,3 +359,8 @@ int tcl_register_commands(struct command_context *cmd_ctx) tcl_port = strdup("6666"); return register_commands(cmd_ctx, NULL, tcl_command_handlers); } + +void tcl_service_free(void) +{ + free(tcl_port); +}