David Brownell <david-b@pacbell.net>
[openocd.git] / src / target / target.c
index 1c32fdbb132ac2e3141a8aa930c4c548bd416235..eac8763388e0c71d98e61aa81bbfd6c2932f5eae 100644 (file)
@@ -1467,6 +1467,12 @@ static int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd,
                        command_print(cmd_ctx,"Target: %s is unknown, try one of:\n", args[0] );
                        goto DumpTargets;
                }
+               if (!target->tap->enabled) {
+                       command_print(cmd_ctx,"Target: TAP %s is disabled, "
+                                       "can't be the current target\n",
+                                       target->tap->dotted_name);
+                       return ERROR_FAIL;
+               }
 
                cmd_ctx->current_target = target->target_number;
                return ERROR_OK;
@@ -1474,19 +1480,32 @@ static int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd,
 DumpTargets:
 
        target = all_targets;
-       command_print(cmd_ctx, "    CmdName    Type       Endian     AbsChainPos Name          State     ");
-       command_print(cmd_ctx, "--  ---------- ---------- ---------- ----------- ------------- ----------");
+       command_print(cmd_ctx, "    TargetName         Type       Endian TapName            State       ");
+       command_print(cmd_ctx, "--  ------------------ ---------- ------ ------------------ ------------");
        while (target)
        {
-               /* XX: abcdefghij abcdefghij abcdefghij abcdefghij */
-               command_print(cmd_ctx, "%2d: %-10s %-10s %-10s %10d %14s %s",
+               const char *state;
+               char marker = ' ';
+
+               if (target->tap->enabled)
+                       state = Jim_Nvp_value2name_simple(nvp_target_state,
+                                       target->state)->name;
+               else
+                       state = "tap-disabled";
+
+               if (cmd_ctx->current_target == target->target_number)
+                       marker = '*';
+
+               /* keep columns lined up to match the headers above */
+               command_print(cmd_ctx, "%2d%c %-18s %-10s %-6s %-18s %s",
                                          target->target_number,
+                                         marker,
                                          target->cmd_name,
                                          target_get_name(target),
-                                         Jim_Nvp_value2name_simple( nvp_target_endian, target->endianness )->name,
-                                         target->tap->abs_chain_position,
+                                         Jim_Nvp_value2name_simple(nvp_target_endian,
+                                                               target->endianness)->name,
                                          target->tap->dotted_name,
-                                         Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+                                         state);
                target = target->next;
        }
 

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)