target: added events TARGET_EVENT_STEP_START and _END
[openocd.git] / src / target / arc_cmd.c
index 3f6caf7512ccb587f1338f5d2b08eda4248b7597..a8c3bb43a713a5bd87c71ff6daae190ed8dd3e01 100644 (file)
@@ -163,7 +163,8 @@ static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        struct arc_reg_data_type *type = calloc(1, sizeof(*type));
        struct reg_data_type_flags *flags = &type->data_type_flags;
        struct reg_data_type_flags_field *fields = calloc(fields_sz, sizeof(*fields));
-       struct arc_reg_bitfield *bitfields = calloc(fields_sz, sizeof(*type));
+       type->reg_type_flags_field = fields;
+       struct arc_reg_bitfield *bitfields = calloc(fields_sz, sizeof(*bitfields));
        if (!(type && fields && bitfields)) {
                Jim_SetResultFormatted(goi.interp, "Failed to allocate memory.");
                goto fail;
@@ -528,7 +529,8 @@ static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        struct arc_reg_data_type *type = calloc(1, sizeof(*type));
        struct reg_data_type_struct *struct_type = &type->data_type_struct;
        struct reg_data_type_struct_field *fields = calloc(fields_sz, sizeof(*fields));
-       struct arc_reg_bitfield *bitfields = calloc(fields_sz, sizeof(*type));
+       type->reg_type_struct_field = fields;
+       struct arc_reg_bitfield *bitfields = calloc(fields_sz, sizeof(*bitfields));
        if (!(type && fields && bitfields)) {
                Jim_SetResultFormatted(goi.interp, "Failed to allocate memory.");
                goto fail;
@@ -676,13 +678,15 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
        int type_name_len = strlen(type_name);
        int e = ERROR_OK;
 
-       /* At least we need to specify 4 parameters: name, number, type and gdb_feature,
-        * which means there should be 8 arguments */
-       if (goi.argc < 8) {
+       /* At least we need to specify 4 parameters: name, number and gdb_feature,
+        * which means there should be 6 arguments. Also there can be additional paramters
+        * "-type <type>", "-g" and  "-core" or "-bcr" which makes maximum 10 parameters. */
+       if (goi.argc < 6 || goi.argc > 10) {
                free_reg_desc(reg);
                Jim_SetResultFormatted(goi.interp,
-                       "Should be at least 8 argnuments: -name <name> "
-                       "-num <num> -type <type> -feature <gdb_feature>.");
+                       "Should be at least 6 argnuments and not greater than 10: "
+                       " -name <name> -num <num> -feature <gdb_feature> "
+                       " [-type <type_name>] [-core|-bcr] [-g].");
                return JIM_ERR;
        }
 
@@ -789,6 +793,7 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
        target = get_current_target(ctx);
        if (!target) {
                Jim_SetResultFormatted(goi.interp, "No current target");
+               free_reg_desc(reg);
                return JIM_ERR;
        }
 

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)