diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-08 06:16:43 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-08 06:16:43 +0000 |
commit | a405fd158175e48682407eb6b8566c5182f00423 (patch) | |
tree | dde76950ed1d8f48c658cb54d3d8193d1c6a4910 /src | |
parent | a221892f605c38b3f9916b86ddebf497f81af584 (diff) | |
download | openocd_libswd-a405fd158175e48682407eb6b8566c5182f00423.tar.gz openocd_libswd-a405fd158175e48682407eb6b8566c5182f00423.tar.bz2 openocd_libswd-a405fd158175e48682407eb6b8566c5182f00423.tar.xz openocd_libswd-a405fd158175e48682407eb6b8566c5182f00423.zip |
David Brownell <david-b@pacbell.net>
- Don't let disabled TAPs be set as the current target
- Improve "targets" output:
* Remove undesirable "chain position" number; we discourage using them
* TAP and Target column updates:
+ make them long enough for current usage
+ improve labels, removing guesswork
+ "TapName" label patches scan_chain output
* Highlight the "current" target
* Display "tap disabled" as a new pseudo-state
* Update docs accordingly
git-svn-id: svn://svn.berlios.de/openocd/trunk@2107 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/target/target.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/target/target.c b/src/target/target.c index 1c32fdbb..eac87633 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -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; } |