From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8177 invoked by alias); 25 Jun 2004 13:17:03 -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 8085 invoked from network); 25 Jun 2004 13:16:56 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 25 Jun 2004 13:16:56 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5PDGte1022804 for ; Fri, 25 Jun 2004 09:16:55 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5PDGsw27044 for ; Fri, 25 Jun 2004 09:16:54 -0400 Received: from cygbert.vinschen.de (vpn50-2.rdu.redhat.com [172.16.50.2]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i5PDGrP16314 for ; Fri, 25 Jun 2004 06:16:53 -0700 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 0BCFC582E2; Fri, 25 Jun 2004 15:16:49 +0200 (CEST) Date: Fri, 25 Jun 2004 13:17:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems Message-ID: <20040625131649.GR19325@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-SW-Source: 2004-06/txt/msg00529.txt.bz2 Hi, on Cygwin, some of the attach tests are simply failing because the corresponding output string isn't correctly checked for. The below patch fixes that partly. Some of the tests will need changes in GDB so I didn't care for them as part of this testsuite fix. Ok to check in? Corinna * gdb.base/attach.exp: Set testpid to Windows PID for Cygwin. (do_attach_tests): Add Cygwin specific strings to check for in the nonsense test, the boguspid test and the attach1 test. Index: gdb.base/attach.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/attach.exp,v retrieving revision 1.12 diff -u -p -r1.12 attach.exp --- gdb.base/attach.exp 7 Aug 2003 17:55:41 -0000 1.12 +++ gdb.base/attach.exp 25 Jun 2004 13:09:39 -0000 @@ -88,6 +88,11 @@ proc do_attach_tests {} { # that it can be attached to. # set testpid [eval exec $binfile &] + if { [istarget "*-*-cygwin*"] } { + # testpid is the Cygwin PID, GDB uses the Windows PID, which might be + # different due to the way fork/exec works. + set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ] + } exec sleep 2 # Verify that we cannot attach to nonsense. @@ -101,6 +106,11 @@ proc do_attach_tests {} { # Response expected from /proc-based systems. pass "attach to nonsense is prohibited" } + -re ".*Can't attach to process..*$gdb_prompt $"\ + { + # Response expected on Cygwin + pass "attach to nonsense is prohibited" + } -re "Attaching to.*$gdb_prompt $"\ {fail "attach to nonsense is prohibited (bogus pid allowed)"} -re "$gdb_prompt $" {fail "attach to nonsense is prohibited"} @@ -140,6 +150,11 @@ proc do_attach_tests {} { # Response expected from /proc-based systems. pass "attach to nonexistent process is prohibited" } + -re ".*Can't attach to process..*$gdb_prompt $"\ + { + # Response expected on Cygwin + pass "attach to nonexistent process is prohibited" + } -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"} timeout { fail "(timeout) attach to nonexistent process is prohibited" @@ -175,6 +190,11 @@ proc do_attach_tests {} { gdb_expect { -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\ {pass "attach1, after setting file"} + -re "Attaching to program.*`?$escapedbinfile\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $"\ + { + # Response expected on Cygwin + pass "attach1, after setting file" + } -re "$gdb_prompt $" {fail "attach1, after setting file"} timeout {fail "(timeout) attach1, after setting file"} } @@ -288,6 +308,11 @@ proc do_attach_tests {} { # that it can be attached to. # set testpid [eval exec $binfile &] + if { [istarget "*-*-cygwin*"] } { + # testpid is the Cygwin PID, GDB uses the Windows PID, which might be + # different due to the way fork/exec works. + set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ] + } exec sleep 2 # Verify that we can attach to the process, and find its a.out @@ -365,6 +393,11 @@ proc do_call_attach_tests {} { # that it can be attached to. # set testpid [eval exec $binfile2 &] + if { [istarget "*-*-cygwin*"] } { + # testpid is the Cygwin PID, GDB uses the Windows PID, which might be + # different due to the way fork/exec works. + set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ] + } exec sleep 2 # Attach -- Corinna Vinschen Cygwin Co-Project Leader Red Hat, Inc.