From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25655 invoked by alias); 29 Oct 2004 20:54:20 -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 25638 invoked from network); 29 Oct 2004 20:54:19 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 29 Oct 2004 20:54:19 -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.11) with ESMTP id i9TKsDma020475 for ; Fri, 29 Oct 2004 16:54:13 -0400 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9TKsCr22261; Fri, 29 Oct 2004 16:54:13 -0400 To: gdb-patches@sources.redhat.com Subject: RFA: adapt gdb.threads/linux-dp.exp to remote protocol and NPTL From: Jim Blandy Date: Fri, 29 Oct 2004 20:54:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-10/txt/msg00483.txt.bz2 The remote protocol doesn't announce thread creation. NPTL has no manager threads. With this patch, linux-dp has no failures debugging NPTL programs over the remote protocol. 2004-10-29 Jim Blandy * gdb.threads/linux-dp.exp: Tolerate the absence of "[New thread]" messages, and the absence of the manager thread. Index: gdb/testsuite/gdb.threads/linux-dp.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v retrieving revision 1.9 diff -c -r1.9 linux-dp.exp *** gdb/testsuite/gdb.threads/linux-dp.exp 14 May 2003 19:36:56 -0000 1.9 --- gdb/testsuite/gdb.threads/linux-dp.exp 29 Oct 2004 05:10:41 -0000 *************** *** 91,97 **** return -1 } -re "$gdb_prompt $" { ! fail "create philosopher: $i" } timeout { fail "(timeout) create philosopher: $i" --- 91,102 ---- return -1 } -re "$gdb_prompt $" { ! # We used to fail here, but not all targets announce new ! # threads as they are created. For example, the GDB ! # remote protocol target only finds out about threads when ! # they actually report some event like a breakpoint hit, ! # or when the user types 'info threads'. ! unresolved "create philosopher: $i" } timeout { fail "(timeout) create philosopher: $i" *************** *** 99,109 **** } } ! if {$expect_manager} { ! set nthreads 7 ! } else { ! set nthreads 6 ! } # Run until there are some threads. gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"] --- 104,110 ---- } } ! set nthreads 6 # Run until there are some threads. gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"] *************** *** 112,118 **** for {set i $nthreads} {$i > 0} {incr i -1} { append info_threads_ptn "$i Thread .*" } ! gdb_test "info threads" $info_threads_ptn "info threads 2" # Try setting a thread-specific breakpoint. gdb_breakpoint "print_philosopher thread 5" --- 113,163 ---- for {set i $nthreads} {$i > 0} {incr i -1} { append info_threads_ptn "$i Thread .*" } ! append info_threads_ptn "\[\r\n\]+$gdb_prompt $" ! set info_threads_manager_ptn "[expr $nthreads + 1] Thread .*$info_threads_ptn" ! ! gdb_test_multiple "info threads" "info threads 2" { ! -re "$info_threads_manager_ptn" { ! # We did see a manager thread. Check that against what we expected. ! switch -exact -- $expect_manager { ! -1 { ! # We weren't sure whether to expect a manager thread. ! pass "info threads 2" ! } ! 1 { ! # We were expecting a manager thread. ! pass "info threads 2" ! } ! 0 { ! # We were not expecting to see the manager thread. ! fail "info threads 2" ! } ! } ! set expect_manager 1 ! incr nthreads ! } ! -re "$info_threads_ptn" { ! # We did not see a manager thread. Check that against what we ! # expected. ! switch -exact -- $expect_manager { ! -1 { ! # We weren't sure whether to expect a manager thread. ! # Don't expect it from here on out. ! pass "info threads 2" ! } ! 1 { ! # We were expecting a manager thread, but we didn't see one. ! fail "info threads 2" ! } ! 0 { ! # We were not expecting to see the manager thread. ! pass "info threads 2" ! } ! } ! set expect_manager 0 ! } ! } ! # Try setting a thread-specific breakpoint. gdb_breakpoint "print_philosopher thread 5"