aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:36:32 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:36:32 -0500
commitc91bb56b06b52d45de7c8871a6d44ddae61ae977 (patch)
tree76e0f609450a7ddb342f976f6fa62cdf92f4b4ca /gdb
parent634a3254c8fe1728c0202289afe594928094d860 (diff)
downloadgdb-c91bb56b06b52d45de7c8871a6d44ddae61ae977.zip
gdb-c91bb56b06b52d45de7c8871a6d44ddae61ae977.tar.gz
gdb-c91bb56b06b52d45de7c8871a6d44ddae61ae977.tar.bz2
Remove usage of find_inferior in lynx_mourn
Replace it with for_each_thread with pid filtering. We can remove lynx_delete_thread_callback and pass remove_thread directly. I can't build/test this change, but it should be obvious enough. gdb/gdbserver/ChangeLog: * lynx.low (lynx_delete_thread_callback): Remove. (lynx_mourn): Use for_each_thread.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/lynx-low.c16
2 files changed, 6 insertions, 15 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5ebb90c..5464033 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+ * lynx.low (lynx_delete_thread_callback): Remove.
+ (lynx_mourn): Use for_each_thread.
+
+2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+
* regcache.c (regcache_invalidate_one): Remove.
(regcache_invalidate_pid): use for_each_thread.
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index ca9adc4..6039364 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -555,26 +555,12 @@ 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 (thread_info *thread, void *proc)
-{
- struct process_info *process = (struct process_info *) proc;
-
- if (thread->id.pid () == pid_of (process))
- remove_thread (thread);
-
- 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);
+ for_each_thread (proc->pid, remove_thread);
/* Free our private data. */
free (proc->priv);