diff --git a/src/rtos/riscv_debug.c b/src/rtos/riscv_debug.c index d6458e9da..3abdf74f0 100644 --- a/src/rtos/riscv_debug.c +++ b/src/rtos/riscv_debug.c @@ -30,7 +30,6 @@ static int riscv_create_rtos(struct target *target) target->rtos->current_threadid = 1; target->rtos->current_thread = 1; - riscv_update_threads(target->rtos); target->rtos->gdb_thread_packet = riscv_gdb_thread_packet; target->rtos->gdb_v_packet = riscv_gdb_v_packet; @@ -42,6 +41,8 @@ int riscv_update_threads(struct rtos *rtos) { LOG_DEBUG("Updating the RISC-V Hart List"); + struct target *target = rtos->target; + /* Figures out how many harts there are on the system. */ int hart_count = riscv_count_harts(rtos->target); if (rtos->thread_count != hart_count) { @@ -54,7 +55,8 @@ int riscv_update_threads(struct rtos *rtos) rtos->thread_details[i].exists = true; if (asprintf(&rtos->thread_details[i].thread_name_str, "Hart %d", i) < 0) LOG_ERROR("riscv_update_threads() failed asprintf"); - if (asprintf(&rtos->thread_details[i].extra_info_str, "RV64") < 0) + if (asprintf(&rtos->thread_details[i].extra_info_str, "RV%d", + riscv_xlen_of_hart(target, i)) < 0) LOG_ERROR("riscv_update_threads() failed asprintf"); } }