diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-12-02 20:36:41 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2017-12-02 20:36:41 -0500 |
commit | 5a6b0a41dfc9b860f285ddb3a1e518299f614cd3 (patch) | |
tree | 0f3c57dc5e8edbf4ed96390c846bd53b335303ec /gdb/gdbserver | |
parent | 39a64da5fc9ce6decd7e5ba0bacfeb2144d2bd63 (diff) | |
download | gdb-5a6b0a41dfc9b860f285ddb3a1e518299f614cd3.zip gdb-5a6b0a41dfc9b860f285ddb3a1e518299f614cd3.tar.gz gdb-5a6b0a41dfc9b860f285ddb3a1e518299f614cd3.tar.bz2 |
Remove usage of find_inferior in linux_stabilize_threads
Replace with find_thread.
gdb/gdbserver/ChangeLog:
* linux-low.c (lwp_running): Return bool, remove unused
argument.
(linux_stabilize_threads): Use find_thread.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7c59c46..88319ae 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,11 @@ 2017-12-02 Simon Marchi <simon.marchi@polymtl.ca> + * linux-low.c (lwp_running): Return bool, remove unused + argument. + (linux_stabilize_threads): Use find_thread. + +2017-12-02 Simon Marchi <simon.marchi@polymtl.ca> + * linux-low.c (select_singlestep_lwp_callback): Remove. (count_events_callback): Remove. (select_event_lwp_callback): Remove. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7b176ec..840bf69 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -2919,7 +2919,7 @@ unsuspend_all_lwps (struct lwp_info *except) static void move_out_of_jump_pad_callback (thread_info *thread); static bool stuck_in_jump_pad_callback (thread_info *thread); -static int lwp_running (thread_info *thread, void *data); +static bool lwp_running (thread_info *thread); static ptid_t linux_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, int target_options); @@ -2975,7 +2975,7 @@ linux_stabilize_threads (void) for_each_inferior (&all_threads, move_out_of_jump_pad_callback); /* Loop until all are stopped out of the jump pads. */ - while (find_inferior (&all_threads, lwp_running, NULL) != NULL) + while (find_thread (lwp_running) != NULL) { struct target_waitstatus ourstatus; struct lwp_info *lwp; @@ -4121,16 +4121,15 @@ move_out_of_jump_pad_callback (thread_info *thread) current_thread = saved_thread; } -static int -lwp_running (thread_info *thread, void *data) +static bool +lwp_running (thread_info *thread) { struct lwp_info *lwp = get_thread_lwp (thread); if (lwp_is_marked_dead (lwp)) - return 0; - if (lwp->stopped) - return 0; - return 1; + return false; + + return !lwp->stopped; } /* Stop all lwps that aren't stopped yet, except EXCEPT, if not NULL. |