aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/lynx-low.c22
2 files changed, 27 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a80a088..dd19262 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2015-12-22 Joel Brobecker <brobecker@adacore.com>
+ * lynx-low.c (lynx_delete_thread_callback): New function.
+ (lynx_mourn): Properly delete our process and all of its
+ threads. Remove call to clear_inferiors.
+
+2015-12-22 Joel Brobecker <brobecker@adacore.com>
+
* target.c (thread_search_callback): Add check that
the thread_stopped target callback is not NULL before
calling it.
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. */