SEGFAULT fix for syntax error.
[openocd.git] / src / openocd.c
index b2a8ade561065d5c97b1e5c79dcb83dd5b1b5fc5..f4aa451728a050cea16230440f2a919c00149676 100644 (file)
@@ -357,35 +357,24 @@ int jim_command(command_context_t *context, char *line)
        int retval=ERROR_OK;
        int retcode=Jim_Eval(interp, line);
        
-       const char *result;
-       int reslen;
-       result = Jim_GetString(Jim_GetResult(interp), &reslen);
        if (retcode == JIM_ERR) {
-               int len, i;
-               
-               LOG_USER_N("Runtime error, file \"%s\", line %d:" JIM_NL, interp->errorFileName, interp->errorLine);
-               LOG_USER_N("    %s" JIM_NL,
-               Jim_GetString(interp->result, NULL));
-               Jim_ListLength(interp, interp->stackTrace, &len);
-               for (i = 0; i < len; i += 3) {
-                       Jim_Obj *objPtr;
-                       const char *proc, *file, *line;
-                       
-                       Jim_ListIndex(interp, interp->stackTrace, i, &objPtr, JIM_NONE);
-                       proc = Jim_GetString(objPtr, NULL);
-                       Jim_ListIndex(interp, interp->stackTrace, i+1, &objPtr, JIM_NONE);
-                       file = Jim_GetString(objPtr, NULL);
-                       Jim_ListIndex(interp, interp->stackTrace, i+2, &objPtr, JIM_NONE);
-                       line = Jim_GetString(objPtr, NULL);
-                       LOG_USER_N("In procedure '%s' called at file \"%s\", line %s" JIM_NL, proc, file, line);
-           }
+               Jim_PrintErrorMessage(interp);
            long t;
-           if (Jim_GetLong(interp, Jim_GetVariableStr(interp, "openocd_result", JIM_ERRMSG), &t)==JIM_OK)
+           Jim_Obj *openocd_result=Jim_GetVariableStr(interp, "openocd_result", JIM_ERRMSG);
+           if (openocd_result)
            {
-               return t;
-           }
+                   if (Jim_GetLong(interp, openocd_result, &t)==JIM_OK)
+                   {
+                       return t;
+                   }
+               }
            return ERROR_FAIL;
-       } else if (retcode == JIM_EXIT) {
+       } 
+       const char *result;
+       int reslen;
+       result = Jim_GetString(Jim_GetResult(interp), &reslen);
+               
+       if (retcode == JIM_EXIT) {
                /* ignore. */
        /* exit(Jim_GetExitCode(interp)); */
        } else {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)