aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-11-19 22:23:26 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-11-19 22:23:27 -0500
commit25c28b4d153ced950cc8702aafb054d6f14f6a02 (patch)
tree8612413a4fda1da50e49cde7bd838b4568cdf658 /gdb
parent5fdda39248cc4a3311efbff3cf2350123d638232 (diff)
downloadgdb-25c28b4d153ced950cc8702aafb054d6f14f6a02.zip
gdb-25c28b4d153ced950cc8702aafb054d6f14f6a02.tar.gz
gdb-25c28b4d153ced950cc8702aafb054d6f14f6a02.tar.bz2
Remove usage of find_thread when calling resume_status_pending_p
Replace with find_thread. Instead of setting the flag in the callback, make the callback return true/false, and check the result against NULL in the caller. gdb/gdbserver/ChangeLog: * linux-low.c (resume_status_pending_p): Return bool, remove flag_p argument. (linux_resume): Use find_thread.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-low.c16
2 files changed, 12 insertions, 10 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 0f9a639..859d18f 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
+ * linux-low.c (resume_status_pending_p): Return bool, remove
+ flag_p argument.
+ (linux_resume): Use find_thread.
+
+2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
+
* linux-low.c (struct thread_resume_array): Remove.
(linux_set_resume_request): Return void, take arguments
directly.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index c1d17f1..ed897e9 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4684,20 +4684,17 @@ linux_set_resume_request (thread_info *thread, thread_resume *resume, size_t n)
/* find_inferior callback for linux_resume.
Set *FLAG_P if this lwp has an interesting status pending. */
-static int
-resume_status_pending_p (thread_info *thread, void *flag_p)
+static bool
+resume_status_pending_p (thread_info *thread)
{
struct lwp_info *lwp = get_thread_lwp (thread);
/* LWPs which will not be resumed are not interesting, because
we might not wait for them next time through linux_wait. */
if (lwp->resume == NULL)
- return 0;
+ return false;
- if (thread_still_has_status_pending_p (thread))
- * (int *) flag_p = 1;
-
- return 0;
+ return thread_still_has_status_pending_p (thread);
}
/* Return 1 if this lwp that GDB wants running is stopped at an
@@ -5092,7 +5089,6 @@ static void
linux_resume (struct thread_resume *resume_info, size_t n)
{
struct thread_info *need_step_over = NULL;
- int any_pending;
int leave_all_stopped;
if (debug_threads)
@@ -5112,9 +5108,9 @@ linux_resume (struct thread_resume *resume_info, size_t n)
would otherwise be sent. In non-stop mode, we'll apply this
logic to each thread individually. We consume all pending events
before considering to start a step-over (in all-stop). */
- any_pending = 0;
+ bool any_pending = false;
if (!non_stop)
- find_inferior (&all_threads, resume_status_pending_p, &any_pending);
+ any_pending = find_thread (resume_status_pending_p) != NULL;
/* If there is a thread which would otherwise be resumed, which is
stopped at a breakpoint that needs stepping over, then don't