aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.c
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-08-14 11:56:44 -0700
committerGitHub <noreply@github.com>2019-08-14 11:56:44 -0700
commitefce094b409179acbaa7726c112a10fcf8343503 (patch)
treee27b3b0a97f75126fd36450afb925b4c0ea3eb81 /src/rtos/rtos.c
parent7eaf60f1b58da45087fb8e5c5808b84b3451c990 (diff)
downloadriscv-openocd-efce094b409179acbaa7726c112a10fcf8343503.zip
riscv-openocd-efce094b409179acbaa7726c112a10fcf8343503.tar.gz
riscv-openocd-efce094b409179acbaa7726c112a10fcf8343503.tar.bz2
Don't fake step for hwthread rtos. (#393)
Fake step is a hack introduced to make things work with real RTOSs that have a concept of a current thread. The hwthread rtos always has access to all threads, so doesn't need it. This fixes a bug when running my MulticoreRegTest against HiFive Unleashed where OpenOCD would return the registers of the wrong thread after gdb stepped a hart. Change-Id: I64f538a133fb078c05a0c6b8121388b0b9d7f1b8
Diffstat (limited to 'src/rtos/rtos.c')
-rw-r--r--src/rtos/rtos.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index d4eff5b..96dc99b 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -673,3 +673,10 @@ void rtos_free_threadlist(struct rtos *rtos)
rtos->current_thread = 0;
}
}
+
+bool rtos_needs_fake_step(struct target *target, int64_t thread_id)
+{
+ if (target->rtos->type->needs_fake_step)
+ return target->rtos->type->needs_fake_step(target, thread_id);
+ return target->rtos->current_thread != thread_id;
+}