command: fix the mode for command "jtag configure" 86/4886/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 7 Feb 2019 08:56:10 +0000 (09:56 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 7 Feb 2019 19:01:15 +0000 (19:01 +0000)
Before commit 877cec20dca6e78f9f029f0f173879cda101a6c2 ("command:
check command mode for native jim commands") all the jim commands
were erroneously treated as they had mode COMMAND_ANY.
The commit above fixes the code in order to check the mode and
permit running the commands only if the mode is respected.

Those jim commands that have incorrect mode were not detected nor
fixes because the wrong mode was masked by the missing mode check.
After the commit above, the wrong mode triggers error in several
existing configuration scripts.
A complete list of commands that now does not run anymore as
CONFIG_ANY is reported in ticket 225, but most of them have the
mode set correctly.
At least two instances of command "jtag configure" have the wrong
mode.

Fix the mode to CONFIG_ANY for command "jtag configure" in files
src/jtag/aice/aice_transport.c and src/jtag/tcl.c

Change-Id: I3f96c5fd24d7d463712cbaf1295284fe0dc56b23
Ticket: https://sourceforge.net/p/openocd/tickets/225/
Reported-by: Bill Paul <wpaul@users.sourceforge.net>
Fixes: 877cec20dca6 ("command: check command mode for native jim commands")
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4886
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
src/jtag/aice/aice_transport.c
src/jtag/tcl.c

index 57c93f2a15977d5a7474e422537e78a69ced99e0..06583183d25c79790f6bf193ee91384afa376c9f 100644 (file)
@@ -340,7 +340,7 @@ aice_transport_jtag_subcommand_handlers[] = {
        },
        {
                .name = "configure",
        },
        {
                .name = "configure",
-               .mode = COMMAND_EXEC,
+               .mode = COMMAND_ANY,
                .jim_handler = jim_jtag_configure,
                .help = "Provide a Tcl handler for the specified "
                        "TAP event.",
                .jim_handler = jim_jtag_configure,
                .help = "Provide a Tcl handler for the specified "
                        "TAP event.",
index e32f0ca078ceb2436568a9b5f699539996fd2c85..768301470d2d90447afe13ce3cc99e5739fb11b9 100644 (file)
@@ -894,7 +894,7 @@ static const struct command_registration jtag_subcommand_handlers[] = {
        },
        {
                .name = "configure",
        },
        {
                .name = "configure",
-               .mode = COMMAND_EXEC,
+               .mode = COMMAND_ANY,
                .jim_handler = jim_jtag_configure,
                .help = "Provide a Tcl handler for the specified "
                        "TAP event.",
                .jim_handler = jim_jtag_configure,
                .help = "Provide a Tcl handler for the specified "
                        "TAP event.",

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)