linux-nat.c: clean up pending status checking and resuming LWPs
authorPedro Alves <palves@redhat.com>
Wed, 7 Jan 2015 19:41:06 +0000 (19:41 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 9 Jan 2015 14:40:53 +0000 (14:40 +0000)
commit8a99810d42b1b4539112c7a50183f3dd807773c2
tree66e3ecfa29a5d80e3edc4b597184a7f5c12a9d28
parentf7ce857f51e33c66100bcf91b346ee1baf734e53
linux-nat.c: clean up pending status checking and resuming LWPs

Whenever we resume an LWP, we must clear a few flags and flush the
LWP's register cache.  We actually currently flush the register cache
of all LWPs, but that's unnecessary.  This patch makes us flush the
register cache of only the LWP that is resumed.  Instead of open
coding all that in many places, we use a helper function.

Likewise, we have two fields in the LWP structure where a pending
status may be recorded.  Add a helper predicate that checks both and
use it throughout instead of open coding the checks.

gdb/
2015-01-09  Pedro Alves  <palves@redhat.com>

* linux-nat.c (linux_resume_one_lwp): New function.
(resume_lwp): Use lwp_status_pending_p and linux_resume_one_lwp.
(linux_nat_resume): Use lwp_status_pending_p and
linux_resume_one_lwp.
(linux_handle_syscall_trap): Use linux_resume_one_lwp.
(linux_handle_extended_wait): Use linux_resume_one_lwp.
(status_callback, running_callback): Use lwp_status_pending_p.
(lwp_status_pending_p): New function.
(stop_and_resume_callback): Use lwp_status_pending_p.
(linux_nat_filter_event): Use linux_resume_one_lwp.
(linux_nat_wait_1): Always use status_callback to look for an LWP
with a pending status.  Use linux_resume_one_lwp.
(resume_stopped_resumed_lwps): Use lwp_status_pending_p and
linux_resume_one_lwp.
gdb/ChangeLog
gdb/linux-nat.c
This page took 0.033476 seconds and 4 git commands to generate.