This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] testsuite: watchthreads-reorder: Linux kernel compat.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 30 May 2010 23:13:26 +0200
- Subject: [patch] testsuite: watchthreads-reorder: Linux kernel compat.
Hi,
since Linux kernel linux-2.6.33 this testcase started to FAIL due to:
http://lkml.org/lkml/2009/12/17/141
464763cf1c6df632dccc8f2f4c7e50163154a2c0
I believe GDB should remain compatible with both Linux kernel variants.
Testing the Linux kernel behavior should not be a goal of the GDB testsuite,
such test has been checked into
cvs -d :pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/systemtap co ptrace-tests
as:
tests/state-tracing-stop.c
OK to check-in?
Thanks,
Jan
2010-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
Accept the new Linux kernel "t (tracing stop)" string.
* gdb.threads/watchthreads-reorder.c (thread1_func, thread2_func):
Update comment.
(proc_string) <T (tracing stop)>: New.
(main): Update the state_wait expect string.
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
@@ -99,7 +99,7 @@ thread1_func (void *unused)
rwatch_store = thread1_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -125,7 +125,7 @@ thread2_func (void *unused)
rwatch_store = thread2_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -165,6 +165,12 @@ proc_string (const char *filename, const char *line)
exit (EXIT_FAILURE);
}
+ /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
+ has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
+ testcase backward compatible with older Linux kernels. */
+ if (strcmp (&buf[line_len], "T (tracing stop)") == 0)
+ buf[line_len] = 't';
+
return &buf[line_len];
}
if (errno != 0)
@@ -336,9 +342,9 @@ main (int argc, char **argv)
{
/* s390x-unknown-linux-gnu will fail with "R (running)". */
- state_wait (thread1_tid, "T (tracing stop)");
+ state_wait (thread1_tid, "t (tracing stop)");
- state_wait (thread2_tid, "T (tracing stop)");
+ state_wait (thread2_tid, "t (tracing stop)");
}
cleanup ();