aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/lynx-low.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/lynx-low.c')
-rw-r--r--gdb/gdbserver/lynx-low.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index 2940ce5..2821ff0 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -546,16 +546,36 @@ lynx_detach (int pid)
return 0;
}
+/* A callback for find_inferior which removes from the thread list
+ all threads belonging to process PROC. */
+
+static int
+lynx_delete_thread_callback (struct inferior_list_entry *entry, void *proc)
+{
+ struct process_info *process = (struct process_info *) proc;
+
+ if (ptid_get_pid (entry->id) == pid_of (process))
+ {
+ struct thread_info *thr = find_thread_ptid (entry->id);
+
+ remove_thread (thr);
+ }
+
+ return 0;
+}
+
/* Implement the mourn target_ops method. */
static void
lynx_mourn (struct process_info *proc)
{
+ find_inferior (&all_threads, lynx_delete_thread_callback, proc);
+
/* Free our private data. */
free (proc->priv);
proc->priv = NULL;
- clear_inferiors ();
+ remove_process (proc);
}
/* Implement the join target_ops method. */