target: rewrite jim_target_event_list to handle_target_event_list
[openocd.git] / src / target / target.c
index 084a2cffc27adaf0220471a2fe641e49ec189a12..4395454161911bce553fa61dab1907f8f1eba563 100644 (file)
@@ -4831,7 +4831,7 @@ no_params:
                                if (goi->argc != 0)
                                        goto no_params;
                        }
-                       Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->working_area_size));
+                       Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->coreid));
                        /* loop for more */
                        break;
 
@@ -5364,27 +5364,25 @@ static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *a
 /* List for human, Events defined for this target.
  * scripts/programs should use 'name cget -event NAME'
  */
-static int jim_target_event_list(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_event_list)
 {
-       struct command_context *cmd_ctx = current_command_context(interp);
-       assert(cmd_ctx != NULL);
-
-       struct target *target = Jim_CmdPrivData(interp);
+       struct target *target = get_current_target(CMD_CTX);
        struct target_event_action *teap = target->event_action;
-       command_print(cmd_ctx, "Event actions for target (%d) %s\n",
+
+       command_print(CMD_CTX, "Event actions for target (%d) %s\n",
                                   target->target_number,
                                   target_name(target));
-       command_print(cmd_ctx, "%-25s | Body", "Event");
-       command_print(cmd_ctx, "------------------------- | "
+       command_print(CMD_CTX, "%-25s | Body", "Event");
+       command_print(CMD_CTX, "------------------------- | "
                        "----------------------------------------");
        while (teap) {
                Jim_Nvp *opt = Jim_Nvp_value2name_simple(nvp_target_event, teap->event);
-               command_print(cmd_ctx, "%-25s | %s",
+               command_print(CMD_CTX, "%-25s | %s",
                                opt->name, Jim_GetString(teap->body, NULL));
                teap = teap->next;
        }
-       command_print(cmd_ctx, "***END***");
-       return JIM_OK;
+       command_print(CMD_CTX, "***END***");
+       return ERROR_OK;
 }
 static int jim_target_current_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
@@ -5491,9 +5489,10 @@ static const struct command_registration target_instance_command_handlers[] = {
        },
        {
                .name = "eventlist",
+               .handler = handle_target_event_list,
                .mode = COMMAND_EXEC,
-               .jim_handler = jim_target_event_list,
                .help = "displays a table of events defined for this target",
+               .usage = "",
        },
        {
                .name = "curstate",
@@ -5890,6 +5889,7 @@ static const struct command_registration target_subcommand_handlers[] = {
                .mode = COMMAND_CONFIG,
                .handler = handle_target_init_command,
                .help = "initialize targets",
+               .usage = "",
        },
        {
                .name = "create",

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)