|
From: OpenOCD-Gerrit <ope...@us...> - 2022-11-11 20:23:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 09731b69a6f50c7e0e2f6fa0ba245374034217cb (commit)
from 3da0c2504c14ea0736b973fa0b5085c42a9c6ce8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 09731b69a6f50c7e0e2f6fa0ba245374034217cb
Author: Tomas Vanek <va...@fb...>
Date: Sun Oct 30 08:22:37 2022 +0000
Revert "Remove duplicate of a counter in hwthread_update_threads"
Commit 0cedf10f8fd6 ("Remove duplicate of a counter in
hwthread_update_threads") introduced a code bug.
In the second foreach_smp_target() loop, variable "threads_found"
gets passed to routine hwthread_fill_thread(). By removing the
counting of threads_found from the second loop, the
incorrect thread counter value gets passed to hwthread_fill_thread().
Change-Id: Ie89e53ccd28bb72b6838ef2f12106a1fe8d00994
Suggested-by: Daniel Goehring <dgo...@os...>
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7307
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index bdd5835c2..e5eaf425f 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -78,6 +78,7 @@ static int hwthread_fill_thread(struct rtos *rtos, struct target *curr, int thre
static int hwthread_update_threads(struct rtos *rtos)
{
int threads_found = 0;
+ int thread_list_size = 0;
struct target_list *head;
struct target *target;
int64_t current_thread = 0;
@@ -99,13 +100,13 @@ static int hwthread_update_threads(struct rtos *rtos)
if (!target_was_examined(curr))
continue;
- ++threads_found;
+ ++thread_list_size;
}
} else
- threads_found = 1;
+ thread_list_size = 1;
/* create space for new thread details */
- rtos->thread_details = malloc(sizeof(struct thread_detail) * threads_found);
+ rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size);
if (target->smp) {
/* loop over all threads */
@@ -170,10 +171,13 @@ static int hwthread_update_threads(struct rtos *rtos)
default:
break;
}
+
+ threads_found++;
}
} else {
hwthread_fill_thread(rtos, target, threads_found);
current_thread = threadid_from_target(target);
+ threads_found++;
}
rtos->thread_count = threads_found;
-----------------------------------------------------------------------
Summary of changes:
src/rtos/hwthread.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|