aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:36:46 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-12-02 20:38:37 -0500
commitc0e15c9bfd6fb4bf36e5240838f6ebed1e1f4a7e (patch)
tree9d3d0006c4f71d5c7664e8c1be8b0cff5bc353fd
parentf004534791145669d7765f8122e48f21e1deeb94 (diff)
downloadgdb-c0e15c9bfd6fb4bf36e5240838f6ebed1e1f4a7e.zip
gdb-c0e15c9bfd6fb4bf36e5240838f6ebed1e1f4a7e.tar.gz
gdb-c0e15c9bfd6fb4bf36e5240838f6ebed1e1f4a7e.tar.bz2
Remove for_each_inferior_with_data
Remove for_each_inferior_with_data, replacing its sole usage with for_each_thread. gdb/gdbserver/ChangeLog: * inferiors.c (for_each_inferior_with_data): Remove. * inferiors.h (for_each_inferior_with_data): Remove. * server.c (handle_qxfer_threads_worker): Change parameter type. (handle_qxfer_threads_proper): Use for_each_thread.
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/inferiors.c12
-rw-r--r--gdb/gdbserver/inferiors.h4
-rw-r--r--gdb/gdbserver/server.c9
4 files changed, 12 insertions, 20 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index e852020..ccab17e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,12 @@
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+ * inferiors.c (for_each_inferior_with_data): Remove.
+ * inferiors.h (for_each_inferior_with_data): Remove.
+ * server.c (handle_qxfer_threads_worker): Change parameter type.
+ (handle_qxfer_threads_proper): Use for_each_thread.
+
+2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+
* inferiors.c (for_each_inferior): Remove.
(clear_inferiors): Use for_each_thread.
* inferiors.h (for_each_inferior): Remove.
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 093080d..6f4427c 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -30,18 +30,6 @@ struct thread_info *current_thread;
/* The current working directory used to start the inferior. */
static const char *current_inferior_cwd = NULL;
-void
-for_each_inferior_with_data (std::list<thread_info *> *thread_list,
- void (*action) (thread_info *, void *),
- void *data)
-{
- gdb_assert (thread_list == &all_threads);
-
- for_each_thread ([&] (thread_info *thread) {
- action (thread, data);
- });
-}
-
struct thread_info *
add_thread (ptid_t thread_id, void *target_data)
{
diff --git a/gdb/gdbserver/inferiors.h b/gdb/gdbserver/inferiors.h
index 030d9c3..947b56e 100644
--- a/gdb/gdbserver/inferiors.h
+++ b/gdb/gdbserver/inferiors.h
@@ -140,10 +140,6 @@ int have_attached_inferiors_p (void);
void clear_inferiors (void);
-void for_each_inferior_with_data (std::list<thread_info *> *thread_list,
- void (*action) (thread_info *, void *),
- void *data);
-
void *thread_target_data (struct thread_info *);
struct regcache *thread_regcache_data (struct thread_info *);
void set_thread_regcache_data (struct thread_info *, struct regcache *);
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index cfc4a12..e2b7537 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1650,9 +1650,8 @@ handle_qxfer_statictrace (const char *annex,
Emit the XML to describe the thread of INF. */
static void
-handle_qxfer_threads_worker (thread_info *thread, void *arg)
+handle_qxfer_threads_worker (thread_info *thread, struct buffer *buffer)
{
- struct buffer *buffer = (struct buffer *) arg;
ptid_t ptid = ptid_of (thread);
char ptid_s[100];
int core = target_core_of_thread (ptid);
@@ -1692,8 +1691,10 @@ handle_qxfer_threads_proper (struct buffer *buffer)
{
buffer_grow_str (buffer, "<threads>\n");
- for_each_inferior_with_data (&all_threads, handle_qxfer_threads_worker,
- buffer);
+ for_each_thread ([&] (thread_info *thread)
+ {
+ handle_qxfer_threads_worker (thread, buffer);
+ });
buffer_grow_str0 (buffer, "</threads>\n");
}