Change jtag_add_pathmove to set jtag_error rather than call exit():
[fw/openocd] / src / helper / command.c
index 9d4956c777fc348f81426f03b75a052d4671d3dd..a82eb4dae5cdfca911c3a8bb2a744cd5d87ae9d5 100644 (file)
@@ -221,7 +221,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
        free((void *)full_name);
 
        /* we now need to add an overrideable proc */
-       const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval \"ocd_%s%s%s $args\"}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
+       const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval ocd_%s%s%s $args}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
        Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__ );
        free((void *)override_name);
 
@@ -392,7 +392,7 @@ int run_command(command_context_t *context, command_t *c, char *words[], int num
        if (!((context->mode == COMMAND_CONFIG) || (c->mode == COMMAND_ANY) || (c->mode == context->mode) ))
        {
                /* Config commands can not run after the config stage */
-               LOG_ERROR("Illegal mode for command");
+               LOG_ERROR("Command '%s' only runs during configuration stage", c->name);
                return ERROR_FAIL;
        }