xsvf: add missing error propagation
authorØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 7 Nov 2011 06:24:42 +0000 (07:24 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 7 Nov 2011 20:35:42 +0000 (20:35 +0000)
Change-Id: Ibc70deb980d6d18ceb376b72d9104e6180b16acf
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/176
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/xsvf/xsvf.c

index 31c39499380c494dbd71d6df9bbd9137abe43193..14b9e28d89c56a7a00c6e379a74921599ec429aa 100644 (file)
@@ -510,14 +510,19 @@ COMMAND_HANDLER(handle_xsvf_command)
                                if (xruntest)
                                {
                                        result = svf_add_statemove(TAP_IDLE);
                                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);
 
                                        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);
                                        result = svf_add_statemove(xenddr);
+                                       if (result != ERROR_OK)
+                                               return result;
+                               }
                        }
                        break;
 
                        }
                        break;
 
@@ -790,8 +795,12 @@ COMMAND_HANDLER(handle_xsvf_command)
                                {
                                        /* FIXME handle statemove errors ... */
                                        result = svf_add_statemove(wait_state);
                                {
                                        /* 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);
                                        jtag_add_sleep(delay);
                                        result = svf_add_statemove(end_state);
+                                       if (result != ERROR_OK)
+                                               return result;
                                }
                        }
                        break;
                                }
                        }
                        break;
@@ -846,12 +855,16 @@ COMMAND_HANDLER(handle_xsvf_command)
 
                                /* FIXME handle statemove errors ... */
                                result = svf_add_statemove(wait_state);
 
                                /* 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);
 
                                jtag_add_clocks(clock_count);
 
                                jtag_add_sleep(usecs);
 
                                result = svf_add_statemove(end_state);
+                               if (result != ERROR_OK)
+                                       return result;
                        }
                        break;
 
                        }
                        break;
 
@@ -925,6 +938,8 @@ COMMAND_HANDLER(handle_xsvf_command)
                                        struct scan_field field;
 
                                        result = svf_add_statemove(loop_state);
                                        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);
 
                                        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);
 
                        /* 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();
                        result = jtag_execute_queue();
+                       if (result != ERROR_OK)
+                               return result;
                        break;
                }
        }
                        break;
                }
        }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)