old-cross-binutils/gdb/testsuite/gdb.threads
Pedro Alves 8bf3b159e5 gdbserver/Linux: unbreak thread event randomization
Wanting to make sure the new continue-pending-status.exp test tests
both cases of threads 2 and 3 reporting an event, I added counters to
the test, to make it FAIL if events for both threads aren't seen.
Assuming a well behaved backend, and given a reasonable number of
iterations, it should PASS.

However, running that against GNU/Linux gdbserver, I found that
surprisingly, that FAILed.  GDBserver always reported the breakpoint
hit for the same thread.

Turns out that I broke gdbserver's thread event randomization
recently, with git commit 582511be ([gdbserver] linux-low.c: better
starvation avoidance, handle non-stop mode too).  In that commit I
missed that the thread structure also has a status_pending_p field...
The end result was that count_events_callback always returns 0, and
then if no thread is stepping, select_event_lwp always returns the
event thread.  IOW, no randomization is happening at all.  Quite
curious how all the other changes in that patch were sufficient to fix
non-stop-fair-events.exp anyway even with that broken.

Tested on x86_64 Fedora 20, native and gdbserver.

gdb/gdbserver/ChangeLog:
2015-03-19 Pedro Alves  <palves@redhat.com>

	* linux-low.c (count_events_callback, select_event_lwp_callback):
	Use the lwp's status_pending_p field, not the thread's.

gdb/testsuite/ChangeLog:
2015-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.threads/continue-pending-status.exp (saw_thread_2)
	(saw_thread_3): New globals.
	(top level): Increment them when an event for the corresponding
	thread is seen.
	(no thread starvation): New test.
2015-03-19 12:38:05 +00:00
..
attach-into-signal.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
attach-into-signal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
attach-many-short-lived-threads.c Improve gdb.threads/attach-many-short-lived-threads.exp timeout handling 2015-02-06 13:24:32 +01:00
attach-many-short-lived-threads.exp Improve gdb.threads/attach-many-short-lived-threads.exp timeout handling 2015-02-06 13:24:32 +01:00
attach-stopped.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
attach-stopped.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
bp_in_thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
bp_in_thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
break-while-running.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
break-while-running.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
clone-new-thread-event.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
clone-new-thread-event.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
clone-thread_db.c gdb.threads/clone-thread_db.c: Add missing includes and fix pthread_join call 2015-03-04 09:13:49 +00:00
clone-thread_db.exp PR18006: internal error if threaded program calls clone(CLONE_VM) 2015-02-20 19:00:21 +00:00
continue-pending-after-query.c Linux: make target_is_async_p return false when async is off 2015-01-23 11:12:39 +00:00
continue-pending-after-query.exp Linux: make target_is_async_p return false when async is off 2015-01-23 11:12:39 +00:00
continue-pending-status.c native/Linux: internal error if resume is short-circuited 2015-03-19 12:26:49 +00:00
continue-pending-status.exp gdbserver/Linux: unbreak thread event randomization 2015-03-19 12:38:05 +00:00
corethreads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
corethreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
create-fail.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
create-fail.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
current-lwp-dead.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
current-lwp-dead.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dlopen-libpthread-lib.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dlopen-libpthread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dlopen-libpthread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
execl.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
execl.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
execl1.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
fork-child-threads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
fork-child-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
fork-thread-pending.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
fork-thread-pending.exp Linux: Skip thread_db thread event reporting if PTRACE_EVENT_CLONE is supported 2015-01-09 11:42:57 +00:00
gcore-stale-thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gcore-stale-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gcore-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
hand-call-in-threads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
hand-call-in-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
ia64-sigill.c gdb.threads/{siginfo-thread.c,watchthreads-reorder.c,ia64-sigill.c} races with GDB 2015-01-09 13:58:29 +00:00
ia64-sigill.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
info-threads-cur-sal-2.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
info-threads-cur-sal.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
info-threads-cur-sal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
interrupted-hand-call.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
interrupted-hand-call.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
kill.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
kill.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
killed.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
killed.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
leader-exit.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
leader-exit.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
linux-dp.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
linux-dp.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
local-watch-wrong-thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
local-watch-wrong-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
Makefile.in
manythreads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
manythreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
multi-create-ns-info-thr.exp gdb.threads/multi-create-ns-info-thr.exp and native-extended-remote board 2015-02-21 12:03:23 +00:00
multi-create.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
multi-create.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
multiple-step-overs.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
multiple-step-overs.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
next-bp-other-thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
next-bp-other-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
no-unwaited-for-left.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
no-unwaited-for-left.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-ldr-exc-1.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
non-ldr-exc-1.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-ldr-exc-2.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
non-ldr-exc-2.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-ldr-exc-3.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
non-ldr-exc-3.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-ldr-exc-4.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
non-ldr-exc-4.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-stop-fair-events.c add non-stop test that stresses thread starvation issues 2015-01-09 14:44:42 +00:00
non-stop-fair-events.exp add non-stop test that stresses thread starvation issues 2015-01-09 14:44:42 +00:00
pending-step.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pending-step.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
print-threads.c
print-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pthread_cond_wait.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
pthread_cond_wait.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pthreads.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
pthreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
queue-signal.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
queue-signal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
reconnect-signal.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
reconnect-signal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
schedlock.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
schedlock.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
siginfo-threads.c gdb.threads/{siginfo-thread.c,watchthreads-reorder.c,ia64-sigill.c} races with GDB 2015-01-09 13:58:29 +00:00
siginfo-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-command-handle-nopass.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-command-handle-nopass.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-command-multiple-signals-pending.c Linux: Skip thread_db thread event reporting if PTRACE_EVENT_CLONE is supported 2015-01-09 11:42:57 +00:00
signal-command-multiple-signals-pending.exp Linux: Skip thread_db thread event reporting if PTRACE_EVENT_CLONE is supported 2015-01-09 11:42:57 +00:00
signal-delivered-right-thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-delivered-right-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-sigtrap.c Add "signal SIGTRAP" test 2015-02-10 19:30:55 +00:00
signal-sigtrap.exp Add "signal SIGTRAP" test 2015-02-10 19:30:55 +00:00
signal-while-stepping-over-bp-other-thread.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signal-while-stepping-over-bp-other-thread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
sigstep-threads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
sigstep-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
sigthread.c
sigthread.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
staticthreads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
staticthreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
step-bg-decr-pc-switch-thread.c Fix adjust_pc_after_break, remove still current thread check 2015-02-11 09:45:41 +00:00
step-bg-decr-pc-switch-thread.exp Fix adjust_pc_after_break, remove still current thread check 2015-02-11 09:45:41 +00:00
step-over-lands-on-breakpoint.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
step-over-lands-on-breakpoint.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
step-over-trips-on-watchpoint.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
step-over-trips-on-watchpoint.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
stepi-random-signal.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
stepi-random-signal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
switch-threads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
switch-threads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-execl.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-execl.exp follow-exec: delete all non-execing threads 2015-03-03 01:25:17 +00:00
thread-find.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-specific-bp.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-specific-bp.exp Fix gdb.threads/thread-specific-bp.exp race 2015-03-04 17:23:55 +00:00
thread-specific.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-specific.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread-unwindonsignal.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread_check.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread_check.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread_events.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
thread_events.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
threadapply.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
threadapply.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
threxit-hop-specific.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
threxit-hop-specific.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls-main.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
tls-nodebug.c
tls-nodebug.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls-shared.c
tls-shared.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls-var-main.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls-var.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls-var.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls.c
tls.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tls2.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchpoint-fork-child.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchpoint-fork-mt.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
watchpoint-fork-parent.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchpoint-fork-st.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchpoint-fork.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchpoint-fork.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchthreads-reorder.c gdb.threads/{siginfo-thread.c,watchthreads-reorder.c,ia64-sigill.c} races with GDB 2015-01-09 13:58:29 +00:00
watchthreads-reorder.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchthreads.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchthreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchthreads2.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
watchthreads2.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
wp-replication.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
wp-replication.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00