aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-09-01 11:29:15 -0700
committerTim Newsome <tim@sifive.com>2017-09-01 11:29:15 -0700
commitce740d02d6fdfcb1f403d41238d5322ab710c10c (patch)
tree93d475933d9daf4b27151b753c17d1c2759bd448
parent48cda642829f58974ed2156b73321bfd550d0592 (diff)
downloadriscv-openocd-ce740d02d6fdfcb1f403d41238d5322ab710c10c.zip
riscv-openocd-ce740d02d6fdfcb1f403d41238d5322ab710c10c.tar.gz
riscv-openocd-ce740d02d6fdfcb1f403d41238d5322ab710c10c.tar.bz2
Properly show XLEN for each thread.
-rw-r--r--src/rtos/riscv_debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rtos/riscv_debug.c b/src/rtos/riscv_debug.c
index d6458e9..3abdf74 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");
}
}