aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-17 12:02:55 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-17 12:02:55 +0000
commit5fefa83d078bfea4338f4bb2112c5ef98c54656e (patch)
tree6fd67eb5284951992e3e2a29bc9a0d588e6d50d3 /src/openocd.c
parent5a3712072f995567ea1aa11fcce25b3158c2f9bf (diff)
downloadriscv-openocd-5fefa83d078bfea4338f4bb2112c5ef98c54656e.zip
riscv-openocd-5fefa83d078bfea4338f4bb2112c5ef98c54656e.tar.gz
riscv-openocd-5fefa83d078bfea4338f4bb2112c5ef98c54656e.tar.bz2
Collect output from openocd commands into openocd_output local variable
git-svn-id: svn://svn.berlios.de/openocd/trunk@820 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/openocd.c b/src/openocd.c
index a3b0fe1..29b8d58 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -485,59 +485,6 @@ static int Jim_Command_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *a
}
-static int openocd_retval;
-
-/* try to execute as Jim command, otherwise fall back to standard command.
- * Note that even if the Jim command caused an error, then we succeeded
- * to execute it, hence this fn pretty much always returns ERROR_OK. */
-int jim_command(command_context_t *context, char *line)
-{
- int retval=ERROR_OK;
- int retcode;
-
- active_cmd_ctx = context;
- openocd_retval=ERROR_OK;
- retcode = Jim_Eval(interp, line);
-
- if (retcode == JIM_ERR) {
- if (openocd_retval!=ERROR_COMMAND_CLOSE_CONNECTION)
- {
- /* We do not print the connection closed error message */
- Jim_PrintErrorMessage(interp);
- }
- if (openocd_retval==ERROR_OK)
- {
- /* It wasn't a low level OpenOCD command that failed */
- return ERROR_FAIL;
- }
- return openocd_retval;
- }
- const char *result;
- int reslen;
- result = Jim_GetString(Jim_GetResult(interp), &reslen);
-
- if (retcode == JIM_EXIT) {
- /* ignore. */
- /* exit(Jim_GetExitCode(interp)); */
- } else {
- if (reslen) {
- 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("%s", "\n");
- }
- }
- return retval;
-}
/* find full path to file */
static int Jim_Command_find(Jim_Interp *interp, int argc, Jim_Obj *const *argv)