I'm working on stm32 and found that the jim error messages could be
more helpful in pointing towards the location of the problem.

I'm not very confident in the attached code, change, but have a look
at the result below, notice how the line #'s in the tcl files show up.


Before:


> reset init
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part:
0xba00, ver: 0x3)
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part:
0x6410, ver: 0x1)
Halt timed out, wake up GDB.
timed out while waiting for target halted
TARGET: stm32.cpu - Not halted
Command handler execution failed
in procedure 'reset' called at file "command.c", line 638
called at file "command.c", line 352


After:

> reset init
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part:
0xba00, ver: 0x3)
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part:
0x6410, ver: 0x1)
Halt timed out, wake up GDB.
timed out while waiting for target halted
Runtime error, file "embedded:startup.tcl", line 151:
    TARGET: stm32.cpu - Not halted
in procedure 'ocd_process_reset'
called at file "embedded:startup.tcl", line 148
Runtime error, file "embedded:startup.tcl", line 34:
    Command handler execution failed
in procedure 'reset' called at file "command.c", line 638
called at file "command.c", line 352
in procedure 'ocd_bouncer'




-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
diff --git a/src/helper/jim.c b/src/helper/jim.c
index 53d1a75..50b5b4f 100644
--- a/src/helper/jim.c
+++ b/src/helper/jim.c
@@ -10982,7 +10982,7 @@ static int Jim_ReturnCoreCommand(Jim_Interp *interp, 
int argc,
         interp->returnCode = returnCode;
         if (argc == 4)
             Jim_SetResult(interp, argv[3]);
-        return JIM_RETURN;
+        return interp->returnCode;
     } else {
         Jim_WrongNumArgs(interp, 1, argv, "?-code code? ?result?");
         return JIM_ERR;
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to