ipdbg: fix double free of virtual-ir data
[openocd.git] / src / target / target.c
index 920511e963ac0277559ed1eb52ff22a672986019..5168305dee36ed9fe06d4743b2ff170090bd3b44 100644 (file)
@@ -244,7 +244,7 @@ static const struct nvp nvp_reset_modes[] = {
        { .name = NULL,      .value = -1 },
 };
 
-const char *debug_reason_name(struct target *t)
+const char *debug_reason_name(const struct target *t)
 {
        const char *cp;
 
@@ -257,7 +257,7 @@ const char *debug_reason_name(struct target *t)
        return cp;
 }
 
-const char *target_state_name(struct target *t)
+const char *target_state_name(const struct target *t)
 {
        const char *cp;
        cp = nvp_value2name(nvp_target_state, t->state)->name;
@@ -733,7 +733,7 @@ int target_examine(void)
        return retval;
 }
 
-const char *target_type_name(struct target *target)
+const char *target_type_name(const struct target *target)
 {
        return target->type->name;
 }
@@ -1358,7 +1358,7 @@ int target_hit_watchpoint(struct target *target,
        return target->type->hit_watchpoint(target, hit_watchpoint);
 }
 
-const char *target_get_gdb_arch(struct target *target)
+const char *target_get_gdb_arch(const struct target *target)
 {
        if (!target->type->get_gdb_arch)
                return NULL;
@@ -1398,7 +1398,7 @@ int target_get_gdb_reg_list_noread(struct target *target,
        return target_get_gdb_reg_list(target, reg_list, reg_list_size, reg_class);
 }
 
-bool target_supports_gdb_connection(struct target *target)
+bool target_supports_gdb_connection(const struct target *target)
 {
        /*
         * exclude all the targets that don't provide get_gdb_reg_list
@@ -4851,7 +4851,7 @@ static int target_jim_set_reg(Jim_Interp *interp, int argc,
 /**
  * Returns true only if the target has a handler for the specified event.
  */
-bool target_has_event_action(struct target *target, enum target_event event)
+bool target_has_event_action(const struct target *target, enum target_event event)
 {
        struct target_event_action *teap;
 
@@ -6736,6 +6736,13 @@ static const struct command_registration target_exec_command_handlers[] = {
                .help = "Write Tcl list of 8/16/32/64 bit numbers to target memory",
                .usage = "address width data ['phys']",
        },
+       {
+               .name = "debug_reason",
+               .mode = COMMAND_EXEC,
+               .handler = handle_target_debug_reason,
+               .help = "displays the debug reason of this target",
+               .usage = "",
+       },
        {
                .name = "reset_nag",
                .handler = handle_target_reset_nag,

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)