mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 12:24:38 +08:00
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.
This commit is contained in:
parent
f004534791
commit
c0e15c9bfd
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
* inferiors.c (for_each_inferior): Remove.
|
* inferiors.c (for_each_inferior): Remove.
|
||||||
|
@ -30,18 +30,6 @@ struct thread_info *current_thread;
|
|||||||
/* The current working directory used to start the inferior. */
|
/* The current working directory used to start the inferior. */
|
||||||
static const char *current_inferior_cwd = NULL;
|
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 *
|
struct thread_info *
|
||||||
add_thread (ptid_t thread_id, void *target_data)
|
add_thread (ptid_t thread_id, void *target_data)
|
||||||
{
|
{
|
||||||
|
@ -140,10 +140,6 @@ int have_attached_inferiors_p (void);
|
|||||||
|
|
||||||
void clear_inferiors (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 *);
|
void *thread_target_data (struct thread_info *);
|
||||||
struct regcache *thread_regcache_data (struct thread_info *);
|
struct regcache *thread_regcache_data (struct thread_info *);
|
||||||
void set_thread_regcache_data (struct thread_info *, struct regcache *);
|
void set_thread_regcache_data (struct thread_info *, struct regcache *);
|
||||||
|
@ -1650,9 +1650,8 @@ handle_qxfer_statictrace (const char *annex,
|
|||||||
Emit the XML to describe the thread of INF. */
|
Emit the XML to describe the thread of INF. */
|
||||||
|
|
||||||
static void
|
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);
|
ptid_t ptid = ptid_of (thread);
|
||||||
char ptid_s[100];
|
char ptid_s[100];
|
||||||
int core = target_core_of_thread (ptid);
|
int core = target_core_of_thread (ptid);
|
||||||
@ -1692,8 +1691,10 @@ handle_qxfer_threads_proper (struct buffer *buffer)
|
|||||||
{
|
{
|
||||||
buffer_grow_str (buffer, "<threads>\n");
|
buffer_grow_str (buffer, "<threads>\n");
|
||||||
|
|
||||||
for_each_inferior_with_data (&all_threads, handle_qxfer_threads_worker,
|
for_each_thread ([&] (thread_info *thread)
|
||||||
buffer);
|
{
|
||||||
|
handle_qxfer_threads_worker (thread, buffer);
|
||||||
|
});
|
||||||
|
|
||||||
buffer_grow_str0 (buffer, "</threads>\n");
|
buffer_grow_str0 (buffer, "</threads>\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user