diff options
author | Peter Griffin <peter.griffin@linaro.org> | 2016-09-28 19:48:38 +0100 |
---|---|---|
committer | Peter Griffin <peter.griffin@linaro.org> | 2016-09-28 19:48:38 +0100 |
commit | 3912db8e4b7c0e4fd00d0101bb2666be18fc0904 (patch) | |
tree | db1acb5ab63e9d73ab1aa155bf232084ba67a036 | |
parent | 7ec5c9d10664aa1ce5966f9a0cfbebc8ab410d20 (diff) |
gdb/linux-kthread: Implement proper to_thread_alive
If lkd_proc_get_by_ptid() can't find the Linux process
anymore, then prune the thread.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r-- | gdb/linux-kthread.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/linux-kthread.c b/gdb/linux-kthread.c index fff6dccf8d..438a910915 100644 --- a/gdb/linux-kthread.c +++ b/gdb/linux-kthread.c @@ -1384,12 +1384,21 @@ linux_kthread_thread_alive (struct target_ops *ops, ptid_t ptid) { enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); struct target_ops *beneath = find_target_beneath (ops); + process_t *ps; // DEBUG (INIT, 1, "()+\n"); // DEBUG (INIT, 1, "()-\n"); //return beneath->to_thread_alive (beneath, ptid); - return (lkd_proc_get_by_ptid (ptid) != NULL); + ps = lkd_proc_get_by_ptid (ptid); + + if (!ps) + { + DEBUG (INIT, 1, "Prune thread ps(%p)\n",ps); + return 0; + } + + return 1; } static void |