aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-12-29 19:41:06 +0000
committerPedro Alves <palves@redhat.com>2015-01-09 14:41:15 +0000
commit8af756ef818acb875865a21131a30e52cbcf15ce (patch)
tree39990b5e754f4d32c2b253f45485dedebc4544cf /gdb/x86-linux-nat.c
parent8a99810d42b1b4539112c7a50183f3dd807773c2 (diff)
downloadfsf-binutils-gdb-8af756ef818acb875865a21131a30e52cbcf15ce.zip
fsf-binutils-gdb-8af756ef818acb875865a21131a30e52cbcf15ce.tar.gz
fsf-binutils-gdb-8af756ef818acb875865a21131a30e52cbcf15ce.tar.bz2
linux-nat.c: always mark execing LWP as resumed
A subsequent patch will make the Linux backend's target_wait method pull all events out of the kernel (with waitpid) and store them as pending status in the LWP structure if no pending status was already available. Then, the backend goes over the pending statuses and pick one to report to the core. With that, the existing thread-execl.exp test exposes a bug, like: (gdb) set scheduler-locking on (gdb) PASS: gdb.threads/thread-execl.exp: schedlock on: set scheduler-locking on next FAIL: gdb.threads/thread-execl.exp: schedlock on: get to main in new image (timeout) Recall that when the non-leader thread execs, all threads in the process die, the execing thread changes its pid to the tgid, and then waitpid returns an exec event to the tgid. If GDB didn't resume the leader LWP, then GDB sees an event for an LWP that was supposedly stopped, and thus not marked as resumed. Because the code that picks a pending event to report to the core ignores not-resumed LWPs: /* Return non-zero if LP has a wait status pending. */ static int status_callback (struct lwp_info *lp, void *data) { /* Only report a pending wait status if we pretend that this has indeed been resumed. */ if (!lp->resumed) return 0; the event ends up pending forever, thus the timeout. gdb/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_handle_extended_wait) <PTRACE_EVENT_EXEC>: Set the LWP's 'resumed' flag.
Diffstat (limited to 'gdb/x86-linux-nat.c')
0 files changed, 0 insertions, 0 deletions