mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 07:08:01 +08:00
Remove usage of find_inferior in linux_resume
Replace with for_each_thread. gdb/gdbserver/ChangeLog: * linux-low.c (linux_resume_one_thread): Return void, take parameter directly. (linux_resume): Use for_each_thread.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
|
* linux-low.c (linux_resume_one_thread): Return void, take
|
||||||
|
parameter directly.
|
||||||
|
(linux_resume): Use for_each_thread.
|
||||||
|
|
||||||
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
|
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
* linux-low.c (send_sigstop_callback): Return void, change
|
* linux-low.c (send_sigstop_callback): Return void, change
|
||||||
|
@ -4923,15 +4923,14 @@ complete_ongoing_step_over (void)
|
|||||||
event to report, so we don't need to preserve any step requests;
|
event to report, so we don't need to preserve any step requests;
|
||||||
they should be re-issued if necessary. */
|
they should be re-issued if necessary. */
|
||||||
|
|
||||||
static int
|
static void
|
||||||
linux_resume_one_thread (thread_info *thread, void *arg)
|
linux_resume_one_thread (thread_info *thread, bool leave_all_stopped)
|
||||||
{
|
{
|
||||||
struct lwp_info *lwp = get_thread_lwp (thread);
|
struct lwp_info *lwp = get_thread_lwp (thread);
|
||||||
int leave_all_stopped = * (int *) arg;
|
|
||||||
int leave_pending;
|
int leave_pending;
|
||||||
|
|
||||||
if (lwp->resume == NULL)
|
if (lwp->resume == NULL)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
if (lwp->resume->kind == resume_stop)
|
if (lwp->resume->kind == resume_stop)
|
||||||
{
|
{
|
||||||
@ -4978,7 +4977,7 @@ linux_resume_one_thread (thread_info *thread, void *arg)
|
|||||||
/* For stop requests, we're done. */
|
/* For stop requests, we're done. */
|
||||||
lwp->resume = NULL;
|
lwp->resume = NULL;
|
||||||
thread->last_status.kind = TARGET_WAITKIND_IGNORE;
|
thread->last_status.kind = TARGET_WAITKIND_IGNORE;
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this thread which is about to be resumed has a pending status,
|
/* If this thread which is about to be resumed has a pending status,
|
||||||
@ -5026,14 +5025,12 @@ linux_resume_one_thread (thread_info *thread, void *arg)
|
|||||||
|
|
||||||
thread->last_status.kind = TARGET_WAITKIND_IGNORE;
|
thread->last_status.kind = TARGET_WAITKIND_IGNORE;
|
||||||
lwp->resume = NULL;
|
lwp->resume = NULL;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linux_resume (struct thread_resume *resume_info, size_t n)
|
linux_resume (struct thread_resume *resume_info, size_t n)
|
||||||
{
|
{
|
||||||
struct thread_info *need_step_over = NULL;
|
struct thread_info *need_step_over = NULL;
|
||||||
int leave_all_stopped;
|
|
||||||
|
|
||||||
if (debug_threads)
|
if (debug_threads)
|
||||||
{
|
{
|
||||||
@ -5065,7 +5062,7 @@ linux_resume (struct thread_resume *resume_info, size_t n)
|
|||||||
if (!any_pending && supports_breakpoints ())
|
if (!any_pending && supports_breakpoints ())
|
||||||
need_step_over = find_thread (need_step_over_p);
|
need_step_over = find_thread (need_step_over_p);
|
||||||
|
|
||||||
leave_all_stopped = (need_step_over != NULL || any_pending);
|
bool leave_all_stopped = (need_step_over != NULL || any_pending);
|
||||||
|
|
||||||
if (debug_threads)
|
if (debug_threads)
|
||||||
{
|
{
|
||||||
@ -5080,7 +5077,10 @@ linux_resume (struct thread_resume *resume_info, size_t n)
|
|||||||
|
|
||||||
/* Even if we're leaving threads stopped, queue all signals we'd
|
/* Even if we're leaving threads stopped, queue all signals we'd
|
||||||
otherwise deliver. */
|
otherwise deliver. */
|
||||||
find_inferior (&all_threads, linux_resume_one_thread, &leave_all_stopped);
|
for_each_thread ([&] (thread_info *thread)
|
||||||
|
{
|
||||||
|
linux_resume_one_thread (thread, leave_all_stopped);
|
||||||
|
});
|
||||||
|
|
||||||
if (need_step_over)
|
if (need_step_over)
|
||||||
start_step_over (get_thread_lwp (need_step_over));
|
start_step_over (get_thread_lwp (need_step_over));
|
||||||
|
Reference in New Issue
Block a user