From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24840 invoked by alias); 28 Sep 2004 21:43:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24828 invoked from network); 28 Sep 2004 21:43:40 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Sep 2004 21:43:40 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i8SLhe1j000656 for ; Tue, 28 Sep 2004 17:43:40 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i8SLher00521 for ; Tue, 28 Sep 2004 17:43:40 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i8SLhe1l026200 for ; Tue, 28 Sep 2004 17:43:40 -0400 Received: from [172.16.14.72] (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 094F280052E for ; Tue, 28 Sep 2004 17:43:40 -0400 (EDT) Message-ID: <4159DB0B.60907@redhat.com> Date: Tue, 28 Sep 2004 21:43:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [RFA]: Fix to watchthreads test case Content-Type: multipart/mixed; boundary="------------090001020407070104000206" X-SW-Source: 2004-09/txt/msg00463.txt.bz2 This is a multi-part message in MIME format. --------------090001020407070104000206 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 589 The following fixes problems introduced by changes to schedlock.c which watchthreads.exp also uses. It switches to use gdb_get_line_number so that the file can change freely without affecting the watchthreads.exp test case. Ok to commit? -- Jeff J. 2004-09-28 Jeff Johnston * gdb.threads/schedlock.c: Add comment markers to use to find line numbers. * gdb.threads/schedlock.exp: Adjust regex to handle the new comments. * gdb.threads/watchthreads.exp: Use gdb_get_line_number to find breakpoint lines. --------------090001020407070104000206 Content-Type: text/plain; name="watchthreadsfix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="watchthreadsfix.patch" Content-length: 3669 Index: gdb.threads/schedlock.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.c,v retrieving revision 1.5 diff -u -p -r1.5 schedlock.c --- gdb.threads/schedlock.c 27 Aug 2004 11:13:28 -0000 1.5 +++ gdb.threads/schedlock.c 28 Sep 2004 21:37:43 -0000 @@ -36,7 +36,7 @@ int main() { for (i = 0; i < NUM; i++) { - args[i] = 1; + args[i] = 1; /* Init value. */ res = pthread_create(&threads[i], NULL, thread_function, @@ -58,7 +58,7 @@ void *thread_function(void *arg) { while (*myp > 0) { /* schedlock.exp: main loop. */ - (*myp) ++; + (*myp) ++; /* Loop increment. */ } pthread_exit(NULL); Index: gdb.threads/schedlock.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.exp,v retrieving revision 1.4 diff -u -p -r1.4 schedlock.exp --- gdb.threads/schedlock.exp 8 May 2003 19:23:29 -0000 1.4 +++ gdb.threads/schedlock.exp 28 Sep 2004 21:37:43 -0000 @@ -125,7 +125,7 @@ proc step_ten_loops { msg } { send_gdb "step\n" set other_step 0 gdb_expect { - -re ".*myp\\) \\+\\+;\[\r\n\]+$gdb_prompt $" { + -re ".*myp\\) \\+\\+;.*Loop increment.*\[\r\n\]+$gdb_prompt $" { pass "step to increment ($msg $i)" } -re "$gdb_prompt $" { Index: gdb.threads/watchthreads.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/watchthreads.exp,v retrieving revision 1.1 diff -u -p -r1.1 watchthreads.exp --- gdb.threads/watchthreads.exp 27 Jul 2004 23:40:49 -0000 1.1 +++ gdb.threads/watchthreads.exp 28 Sep 2004 21:37:43 -0000 @@ -60,17 +60,20 @@ set args_1 0 gdb_test "watch args\[0\]" "Hardware watchpoint 2: args\\\[0\\\]" gdb_test "watch args\[1\]" "Hardware watchpoint 3: args\\\[1\\\]" +set init_line [expr [gdb_get_line_number "Init value"]+1] +set inc_line [gdb_get_line_number "Loop increment"] + # Loop and continue to allow both watchpoints to be triggered. for {set i 0} {$i < 30} {incr i} { set test_flag 0 gdb_test_multiple "continue" "threaded watch loop" { - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:$init_line.*$gdb_prompt $" { set args_0 1; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:$init_line.*$gdb_prompt $" { set args_1 1; set test_flag 1 } - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*schedlock.c:42.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*schedlock.c:$inc_line.*$gdb_prompt $" { set args_0 [expr $args_0+1]; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*schedlock.c:42.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*schedlock.c:$inc_line.*$gdb_prompt $" { set args_1 [expr $args_1+1]; set test_flag 1 } } # If we fail above, don't bother continuing loop --------------090001020407070104000206--