Remove long-deprecated "target count" and "target number" commands. 60/1860/4
authorRobert P. J. Day <rpjday@crashcourse.ca>
Thu, 9 Jan 2014 16:59:37 +0000 (11:59 -0500)
committerPaul Fertser <fercerpav@gmail.com>
Sun, 22 Feb 2015 17:56:16 +0000 (17:56 +0000)
Given that the manual states that these two subcommands are
deprecated and were scheduled to be removed back in 2010,
remove them and the corresponding documentation from the
manual.

Change-Id: Iaac633349d7fcb8b7f964109c7d26dd0cc5fc233
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-on: http://openocd.zylin.com/1860
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
doc/openocd.texi
src/target/target.c

index e22ff1f61e3b04e9ada039a21ee32fe8112c5a8a..9adc80f34e538337aabfc86dba539392a3ef3b54 100644 (file)
@@ -4133,22 +4133,6 @@ are examples; and there are many more.
 
 Several commands let you examine the list of targets:
 
-@deffn Command {target count}
-@emph{Note: target numbers are deprecated; don't use them.
-They will be removed shortly after August 2010, including this command.
-Iterate target using @command{target names}, not by counting.}
-
-Returns the number of targets, @math{N}.
-The highest numbered target is @math{N - 1}.
-@example
-set c [target count]
-for @{ set x 0 @} @{ $x < $c @} @{ incr x @} @{
-    # Assuming you have created this function
-    print_target_details $x
-@}
-@end example
-@end deffn
-
 @deffn Command {target current}
 Returns the name of the current target.
 @end deffn
@@ -4162,18 +4146,6 @@ foreach t [target names] @{
 @end example
 @end deffn
 
-@deffn Command {target number} number
-@emph{Note: target numbers are deprecated; don't use them.
-They will be removed shortly after August 2010, including this command.}
-
-The list of targets is numbered starting at zero.
-This command returns the name of the target at index @var{number}.
-@example
-set thename [target number $x]
-puts [format "Target %d is: %s\n" $x $thename]
-@end example
-@end deffn
-
 @c yep, "target list" would have been better.
 @c plus maybe "target setdefault".
 
index 9f12704a5c2c767c2b8afe179458cc2eba289e5a..c87c88986c9f22678666af6d5611d1f81904a540 100644 (file)
@@ -5333,55 +5333,6 @@ static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        return target_create(&goi);
 }
 
-static int jim_target_number(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
-
-       /* It's OK to remove this mechanism sometime after August 2010 or so */
-       LOG_WARNING("don't use numbers as target identifiers; use names");
-       if (goi.argc != 1) {
-               Jim_SetResultFormatted(goi.interp, "usage: target number <number>");
-               return JIM_ERR;
-       }
-       jim_wide w;
-       int e = Jim_GetOpt_Wide(&goi, &w);
-       if (e != JIM_OK)
-               return JIM_ERR;
-
-       struct target *target;
-       for (target = all_targets; NULL != target; target = target->next) {
-               if (target->target_number != w)
-                       continue;
-
-               Jim_SetResultString(goi.interp, target_name(target), -1);
-               return JIM_OK;
-       }
-       {
-               Jim_Obj *wObj = Jim_NewIntObj(goi.interp, w);
-               Jim_SetResultFormatted(goi.interp,
-                       "Target: number %#s does not exist", wObj);
-               Jim_FreeNewObj(interp, wObj);
-       }
-       return JIM_ERR;
-}
-
-static int jim_target_count(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
-       if (argc != 1) {
-               Jim_WrongNumArgs(interp, 1, argv, "<no parameters>");
-               return JIM_ERR;
-       }
-       unsigned count = 0;
-       struct target *target = all_targets;
-       while (NULL != target) {
-               target = target->next;
-               count++;
-       }
-       Jim_SetResult(interp, Jim_NewIntObj(interp, count));
-       return JIM_OK;
-}
-
 static const struct command_registration target_subcommand_handlers[] = {
        {
                .name = "init",
@@ -5416,21 +5367,6 @@ static const struct command_registration target_subcommand_handlers[] = {
                .jim_handler = jim_target_names,
                .help = "Returns the names of all targets as a list of strings",
        },
-       {
-               .name = "number",
-               .mode = COMMAND_ANY,
-               .jim_handler = jim_target_number,
-               .usage = "number",
-               .help = "Returns the name of the numbered target "
-                       "(DEPRECATED)",
-       },
-       {
-               .name = "count",
-               .mode = COMMAND_ANY,
-               .jim_handler = jim_target_count,
-               .help = "Returns the number of targets as an integer "
-                       "(DEPRECATED)",
-       },
        {
                .name = "smp",
                .mode = COMMAND_ANY,

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)