From d892a4d763c283ca775213d4148b76d5b0fde520 Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Wed, 4 Dec 2024 08:26:04 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.openocd.org/c/openocd/+/8636 Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/target/arm_adi_v5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 0c7633bea..df897b80e 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -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) { -- 2.49.0