* [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems
@ 2004-06-25 13:17 Corinna Vinschen
2004-06-25 13:34 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2004-06-25 13:17 UTC (permalink / raw)
To: gdb-patches
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems
2004-06-25 13:17 [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems Corinna Vinschen
@ 2004-06-25 13:34 ` Daniel Jacobowitz
2004-06-25 13:55 ` Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-06-25 13:34 UTC (permalink / raw)
To: gdb-patches
On Fri, Jun 25, 2004 at 03:16:49PM +0200, Corinna Vinschen wrote:
> 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.
OK.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems
2004-06-25 13:34 ` Daniel Jacobowitz
@ 2004-06-25 13:55 ` Corinna Vinschen
0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2004-06-25 13:55 UTC (permalink / raw)
To: gdb-patches
On Jun 25 09:34, Daniel Jacobowitz wrote:
> On Fri, Jun 25, 2004 at 03:16:49PM +0200, Corinna Vinschen wrote:
> > 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.
>
> OK.
Thanks for the quick review.
Unfortunately I just found that this change is useless, unless some
changes in win32-nat.c are made. I'll defer to apply this change until
I have fixed the related problem in win32-nat.c
Corinna
--
Corinna Vinschen
Cygwin Co-Project Leader
Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-25 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-25 13:17 [RFA] testsuite/gdb.base/attach.exp: Fix some Cygwin problems Corinna Vinschen
2004-06-25 13:34 ` Daniel Jacobowitz
2004-06-25 13:55 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox