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:
Simon Marchi 2017-12-02 20:36:46 -05:00
parent f004534791
commit c0e15c9bfd
4 changed files with 12 additions and 20 deletions

View file

@ -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");
}