]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
rtos/hwthread: Hide unavailable targets from thread list.
authorTim Newsome <tim@sifive.com>
Wed, 7 Sep 2022 18:55:52 +0000 (11:55 -0700)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 Jun 2025 08:17:14 +0000 (08:17 +0000)
Imported from
https://github.com/riscv-collab/riscv-openocd/pull/767

Change-Id: I53c6e2876d9bab70800a0f080e72a2abe0499120
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8919
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/rtos/hwthread.c

index 76571c6b6016ed6ade27c3f0df64cf4f09ad025e..cc43a07b426f91885c4703d8d6fcbb3a8dff6b19 100644 (file)
@@ -105,7 +105,8 @@ static int hwthread_update_threads(struct rtos *rtos)
                foreach_smp_target(head, target->smp_targets) {
                        struct target *curr = head->target;
 
-                       if (!target_was_examined(curr))
+                       if (!target_was_examined(curr) ||
+                                       curr->state == TARGET_UNAVAILABLE)
                                continue;
 
                        ++thread_list_size;
@@ -130,7 +131,8 @@ static int hwthread_update_threads(struct rtos *rtos)
                foreach_smp_target(head, target->smp_targets) {
                        struct target *curr = head->target;
 
-                       if (!target_was_examined(curr))
+                       if (!target_was_examined(curr) ||
+                                       curr->state == TARGET_UNAVAILABLE)
                                continue;
 
                        threadid_t tid = threadid_from_target(curr);