On Thursday 04 June 2009, Øyvind Harboe wrote:
> > It won't work,  but is is not an error. Return ERROR_OK so other targets in
> > the chain can be examined.
> 
> How about fixing this in the calling code?

... although this touches on some other glitches in the
vicinity of tap enable/disable logic.  The "tapenable"
code paths don't seem to have an obvious way to fail and
report that the tap was not enabled.

--- a/src/target/target.c
+++ b/src/target/target.c
@@ -481,12 +481,14 @@ int target_examine_one(struct target_s *target)
 int target_examine(void)
 {
 	int retval = ERROR_OK;
-	target_t *target = all_targets;
-	while (target)
+	target_t *target;
+
+	for (target = all_targets; target; target = target->next)
 	{
+		if (!target->tap->enabled)
+			continue;
 		if ((retval = target_examine_one(target)) != ERROR_OK)
 			return retval;
-		target = target->next;
 	}
 	return retval;
 }
@@ -1478,6 +1480,14 @@ DumpTargets:
 	command_print(cmd_ctx, "--  ---------- ---------- ---------- ----------- ------------- ----------");
 	while (target)
 	{
+		const char *state;
+
+		if (target->tap->enabled)
+			state = Jim_Nvp_value2name_simple(nvp_target_state,
+					target->state)->name;
+		else
+			state = "tap-disabled";
+
 		/* XX: abcdefghij abcdefghij abcdefghij abcdefghij */
 		command_print(cmd_ctx, "%2d: %-10s %-10s %-10s %10d %14s %s",
 					  target->target_number,
@@ -1486,7 +1496,7 @@ DumpTargets:
 					  Jim_Nvp_value2name_simple( nvp_target_endian, target->endianness )->name,
 					  target->tap->abs_chain_position,
 					  target->tap->dotted_name,
-					  Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+					  state);
 		target = target->next;
 	}
 
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to