target/arm_adiv5: print DAP name if not found

If a DAP is not found, include its name in the error message.

Change-Id: Icffc52894a1c5573f938b1f3e3b53441167f085e
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8636
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2024-12-04 08:26:04 +01:00
committed by Antonio Borneo
parent 80b1c9aff8
commit d892a4d763

View File

@@ -2367,7 +2367,9 @@ static int adiv5_jim_spot_configure(struct jim_getopt_info *goi,
return e;
dap = dap_instance_by_jim_obj(goi->interp, o_t);
if (!dap) {
Jim_SetResultString(goi->interp, "DAP name invalid!", -1);
const char *dap_name = Jim_GetString(o_t, NULL);
Jim_SetResultFormatted(goi->interp, "DAP '%s' not found",
dap_name);
return JIM_ERR;
}
if (*dap_p && *dap_p != dap) {