From 3bab8990635af47de01e86c32a8ee9fe87789190 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Mon, 7 Nov 2011 07:24:42 +0100 Subject: [PATCH] xsvf: add missing error propagation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ibc70deb980d6d18ceb376b72d9104e6180b16acf Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/176 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/xsvf/xsvf.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index 31c39499..14b9e28d 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -510,14 +510,19 @@ COMMAND_HANDLER(handle_xsvf_command) if (xruntest) { result = svf_add_statemove(TAP_IDLE); + if (result != ERROR_OK) + return result; if (runtest_requires_tck) jtag_add_clocks(xruntest); else jtag_add_sleep(xruntest); - } - else if (xendir != TAP_DRPAUSE) /* we are already in TAP_DRPAUSE */ + } else if (xendir != TAP_DRPAUSE) { + /* we are already in TAP_DRPAUSE */ result = svf_add_statemove(xenddr); + if (result != ERROR_OK) + return result; + } } break; @@ -790,8 +795,12 @@ COMMAND_HANDLER(handle_xsvf_command) { /* FIXME handle statemove errors ... */ result = svf_add_statemove(wait_state); + if (result != ERROR_OK) + return result; jtag_add_sleep(delay); result = svf_add_statemove(end_state); + if (result != ERROR_OK) + return result; } } break; @@ -846,12 +855,16 @@ COMMAND_HANDLER(handle_xsvf_command) /* FIXME handle statemove errors ... */ result = svf_add_statemove(wait_state); + if (result != ERROR_OK) + return result; jtag_add_clocks(clock_count); jtag_add_sleep(usecs); result = svf_add_statemove(end_state); + if (result != ERROR_OK) + return result; } break; @@ -925,6 +938,8 @@ COMMAND_HANDLER(handle_xsvf_command) struct scan_field field; result = svf_add_statemove(loop_state); + if (result != ERROR_OK) + return result; jtag_add_clocks(loop_clocks); jtag_add_sleep(loop_usecs); @@ -1003,7 +1018,11 @@ COMMAND_HANDLER(handle_xsvf_command) /* upon error, return the TAPs to a reasonable state */ result = svf_add_statemove(TAP_IDLE); + if (result != ERROR_OK) + return result; result = jtag_execute_queue(); + if (result != ERROR_OK) + return result; break; } } -- 2.39.5