From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems
Date: Fri, 25 Jun 2004 13:17:00 -0000 [thread overview]
Message-ID: <20040625131649.GR19325@cygbert.vinschen.de> (raw)
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.
next reply other threads:[~2004-06-25 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-25 13:17 Corinna Vinschen [this message]
2004-06-25 13:34 ` Daniel Jacobowitz
2004-06-25 13:55 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040625131649.GR19325@cygbert.vinschen.de \
--to=vinschen@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox