diff options
author | Peter Griffin <peter.griffin@linaro.org> | 2016-09-28 19:17:12 +0100 |
---|---|---|
committer | Peter Griffin <peter.griffin@linaro.org> | 2016-09-28 19:17:12 +0100 |
commit | e25128374d61af5ee503d5a878e85360f0f05619 (patch) | |
tree | 46b0a987573a25b401b6420fb8ec01c211123e67 | |
parent | fba63ee9209a10b635cd3f60770ac07e506ab8da (diff) |
gdb/linux-kthread: Correctly prune old GDB threads
This fixes linux-kthread thread management when connceted
to a OpenOCD GDB remote stub. GDB threads representing
Linux threads which no longer exist are correctly pruned
from the GDB thread list.
This works well when connected to OpenOCD gdbremote stub.
However there is an issue when connected to QEMU GDB remote
stub whereby all the newly created kthreads are deleted.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r-- | gdb/linux-kthread.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/linux-kthread.c b/gdb/linux-kthread.c index 1c013f379e..cbbfe84041 100644 --- a/gdb/linux-kthread.c +++ b/gdb/linux-kthread.c @@ -886,11 +886,14 @@ lkd_proc_refresh_info (int cur_core) /* Update the process_list now, so that init_task is in there. */ (void) lkd_proc_get_list (); - /* Call update to prune gdb_thread no longer linked to a linux task.*/ - // if (lkd_private.loaded == LKD_LOADED) - - /* this actually ends up deleting all the threads again :-( */ - // update_thread_list(); + /* Call update_thread_list() to prune GDB threads which are no longer linked + * to a Linux task no longer linked to a linux task. */ + + /* TODO: This API call can end up deleting all the kthreads when connected + * to QEMU gdbremote. But without it we don't correctly prune threads + * when connected to OpenOCD. Needs further debugging. + */ + update_thread_list(); /* Set the running process * |