target/arm_cti: Fix error handling in 'cti create'

Handle JIM_CONTINUE return value of adiv5_jim_mem_ap_spot_configure(),
otherwise OpenOCD silently quits when an unknown option is provided.

Change-Id: I9b1351c0911e74999d8dd1260ede9760088510d7
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/6944
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink 2022-04-23 13:13:06 +02:00 committed by Antonio Borneo
parent 9eddc21a58
commit 8789513fa9
1 changed files with 6 additions and 1 deletions

View File

@ -435,8 +435,13 @@ static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti)
/* parse config or cget options ... */
while (goi->argc > 0) {
int e = adiv5_jim_mem_ap_spot_configure(&cti->spot, goi);
if (e == JIM_CONTINUE)
Jim_SetResultFormatted(goi->interp, "unknown option '%s'",
Jim_String(goi->argv[0]));
if (e != JIM_OK)
return e;
return JIM_ERR;
}
if (!cti->spot.dap) {