This is an automated email from Gerrit. Antonio Borneo ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5093
-- gerrit commit d9b25fcfe0689cd984bc8df969dc5e22db2329e5 Author: Antonio Borneo <[email protected]> Date: Sun Apr 7 05:12:31 2019 +0200 helper/command: send command output only to the right server When opening multiple telnet connections, the command output on one console is broadcast to all the other console. Send the command output only to the output handler that has been set for that context. For the moment, still broadcast the errors. Note that contexts which doesn't explicitly set the output handler (e.g. gdb_server), will inherit the global output handler configuration_output_handler() that will broadcast the output. Change-Id: I1f2d6e6a3bbf730f5fa77246730fce1445742a1e Signed-off-by: Antonio Borneo <[email protected]> diff --git a/src/helper/command.c b/src/helper/command.c index 234a553..b866428 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -687,20 +687,8 @@ int command_run_line(struct command_context *context, char *line) int reslen; result = Jim_GetString(Jim_GetResult(interp), &reslen); - if (reslen > 0) { - int i; - char buff[256 + 1]; - for (i = 0; i < reslen; i += 256) { - int chunk; - chunk = reslen - i; - if (chunk > 256) - chunk = 256; - strncpy(buff, result + i, chunk); - buff[chunk] = 0; - LOG_USER_N("%s", buff); - } - LOG_USER_N("\n"); - } + if (reslen > 0) + command_output_text(context, result); retval = ERROR_OK; } else if (retcode == JIM_EXIT) { /* ignore. @@ -709,6 +697,7 @@ int command_run_line(struct command_context *context, char *line) return retcode; } else { Jim_MakeErrorMessage(interp); + /* error is broadcast */ LOG_USER("%s", Jim_GetString(Jim_GetResult(interp), NULL)); if (retval == ERROR_OK) { -- _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
