aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
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
commit634a3254c8fe1728c0202289afe594928094d860 (patch)
treeac333b130739dfeae092fcea823b80d0784513b3 /gdb/gdbserver
parent6d83e819df0c71868d04db46c60ff0ecf8cf1914 (diff)
downloadgdb-634a3254c8fe1728c0202289afe594928094d860.zip
gdb-634a3254c8fe1728c0202289afe594928094d860.tar.gz
gdb-634a3254c8fe1728c0202289afe594928094d860.tar.bz2
Remove usage of find_inferior in regcache_invalidate_pid
Replace with for_each_thread with pid filtering. regcache_invalidate_one is not longer needed, as it was only used to filter the pid. We can call regcache_invalidate_thread directly. gdb/gdbserver/ChangeLog: * regcache.c (regcache_invalidate_one): Remove. (regcache_invalidate_pid): use for_each_thread.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/regcache.c15
2 files changed, 7 insertions, 13 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 6ed0fc2..5ebb90c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * regcache.c (regcache_invalidate_one): Remove.
+ (regcache_invalidate_pid): use for_each_thread.
+
2017-11-26 Tom Tromey <tom@tromey.com>
* linux-low.c (linux_create_inferior): Update.
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index e45e60e..5f71523 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -93,24 +93,13 @@ regcache_invalidate_thread (struct thread_info *thread)
regcache->registers_valid = 0;
}
-static int
-regcache_invalidate_one (thread_info *thread, void *pid_p)
-{
- int pid = *(int *) pid_p;
-
- /* Only invalidate the regcaches of threads of this process. */
- if (thread->id.pid () == pid)
- regcache_invalidate_thread (thread);
-
- return 0;
-}
-
/* See regcache.h. */
void
regcache_invalidate_pid (int pid)
{
- find_inferior (&all_threads, regcache_invalidate_one, &pid);
+ /* Only invalidate the regcaches of threads of this process. */
+ for_each_thread (pid, regcache_invalidate_thread);
}
/* See regcache.h. */