target: Examine subsequent targets after failure
authorKevin Yang <kangyang@google.com>
Mon, 12 Oct 2020 22:33:47 +0000 (15:33 -0700)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 Nov 2020 20:52:26 +0000 (20:52 +0000)
When a target examination fails, continue to examine subsequent targets.
Return the number of targets that failed to examine.

Change-Id: I883a0c445edc7eb00f496b79271d773771ec6b66
Signed-off-by: Kevin Yang <kangyang@google.com>
Reviewed-on: http://openocd.zylin.com/5855
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/target.c

index 39575b01c41cbb225dfdd3cdce28bde3f9a52c9b..3b1c666e5e0d8ec6c5ef06c624c5453ef0be7eb1 100644 (file)
@@ -766,9 +766,11 @@ int target_examine(void)
                if (target->defer_examine)
                        continue;
 
-               retval = target_examine_one(target);
-               if (retval != ERROR_OK)
-                       return retval;
+               int retval2 = target_examine_one(target);
+               if (retval2 != ERROR_OK) {
+                       LOG_WARNING("target %s examination failed", target_name(target));
+                       retval = retval2;
+               }
        }
        return retval;
 }