rtos: check symbol list when updating uCOS-III
[openocd.git] / src / rtos / uCOS-III.c
index 0a0fb3e9e7e785f56cebe6dfe6ebbead2dd3b33d..304d07c59117693d5a5f7af4a448b73b6fdfdb4c 100644 (file)
@@ -68,6 +68,20 @@ static const struct uCOS_III_params uCOS_III_params_list[] = {
                &rtos_uCOS_III_Cortex_M_stacking,       /* stacking_info */
                0,                                                                      /* num_threads */
        },
+       {
+               "esirisc",                                                      /* target_name */
+               sizeof(uint32_t),                                       /* pointer_width */
+               0,                                                                      /* thread_stack_offset */
+               0,                                                                      /* thread_name_offset */
+               0,                                                                      /* thread_state_offset */
+               0,                                                                      /* thread_priority_offset */
+               0,                                                                      /* thread_prev_offset */
+               0,                                                                      /* thread_next_offset */
+               false,                                                          /* thread_offsets_updated */
+               1,                                                                      /* threadid_start */
+               &rtos_uCOS_III_eSi_RISC_stacking,       /* stacking_info */
+               0,                                                                      /* num_threads */
+       },
 };
 
 static const char * const uCOS_III_symbol_list[] = {
@@ -241,7 +255,7 @@ static int uCOS_III_update_thread_offsets(struct rtos *rtos)
        return ERROR_OK;
 }
 
-static int uCOS_III_detect_rtos(struct target *target)
+static bool uCOS_III_detect_rtos(struct target *target)
 {
        return target->rtos->symbols != NULL &&
                        target->rtos->symbols[uCOS_III_VAL_OSRunning].address != 0;
@@ -286,6 +300,11 @@ static int uCOS_III_update_threads(struct rtos *rtos)
        struct uCOS_III_params *params = rtos->rtos_specific_params;
        int retval;
 
+       if (rtos->symbols == NULL) {
+               LOG_ERROR("uCOS-III: symbol list not loaded");
+               return ERROR_FAIL;
+       }
+
        /* free previous thread details */
        rtos_free_threadlist(rtos);
 
@@ -454,7 +473,8 @@ static int uCOS_III_update_threads(struct rtos *rtos)
        return ERROR_OK;
 }
 
-static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid, char **hex_reg_list)
+static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid,
+               struct rtos_reg **reg_list, int *num_regs)
 {
        struct uCOS_III_params *params = rtos->rtos_specific_params;
        int retval;
@@ -484,7 +504,8 @@ static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid,
        return rtos_generic_stack_read(rtos->target,
                        params->stacking_info,
                        stack_address,
-                       hex_reg_list);
+                       reg_list,
+                       num_regs);
 }
 
 static int uCOS_III_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])

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)