From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19259 invoked by alias); 30 May 2010 21:13:38 -0000 Received: (qmail 19251 invoked by uid 22791); 30 May 2010 21:13:37 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 30 May 2010 21:13:31 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4ULDTfS017710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 30 May 2010 17:13:30 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4ULDRqa014447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 30 May 2010 17:13:29 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o4ULDR6R012354 for ; Sun, 30 May 2010 23:13:27 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o4ULDQBb012353 for gdb-patches@sourceware.org; Sun, 30 May 2010 23:13:26 +0200 Date: Mon, 31 May 2010 02:10:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] testsuite: watchthreads-reorder: Linux kernel compat. Message-ID: <20100530211326.GA12218@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00695.txt.bz2 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 Accept the new Linux kernel "t (tracing stop)" string. * gdb.threads/watchthreads-reorder.c (thread1_func, thread2_func): Update comment. (proc_string) : 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 ();