Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Testsuite: fix attach.exp test for FreeBSD 5.0
@ 2003-02-15 11:01 Mark Kettenis
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Kettenis @ 2003-02-15 11:01 UTC (permalink / raw)
  To: gdb-patches

This fixes some testsuite failures on FreeBSD 5.0, where PID 0 is an
existing process.  I also tweaked the comments a bit such that they
don't imply that the various pattaerns are completely HP-specific.

OK to check this in?

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.base/attach.exp: When trying to attach to a nonexistent
	process, make it possible to specify the PID based on the target.

Index: gdb.base/attach.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/attach.exp,v
retrieving revision 1.8
diff -u -p -r1.8 attach.exp
--- gdb.base/attach.exp 22 Dec 2002 23:53:48 -0000 1.8
+++ gdb.base/attach.exp 15 Feb 2003 10:59:35 -0000
@@ -106,30 +106,39 @@ proc do_attach_tests {} {
    }
 
    # Verify that we cannot attach to what appears to be a valid
-   # process ID, but is a process that doesn't exist.  (I don't
-   # believe any process is ever assigned #0, at least on HPUX.)
+   # process ID, but is a process that doesn't exist.  Traditionally,
+   # most systems didn't have a process with ID 0, so we take that as
+   # the default.  However, there are a few exceptions.
    #
-   send_gdb "attach 0\n"
+   set boguspid 0
+   if { [istarget "*-*-freebsd*"] } {
+       # In FreeBSD 5.0, PID 0 is used for "swapper".  Use -1 instead
+       # (which should have the desired effect on any version of FreeBSD).
+       set boguspid -1
+   }
+   send_gdb "attach $boguspid\n"
    gdb_expect {
-      -re "Attaching to.*, process 0.*No such process.*$gdb_prompt $"\
-                      {
-                        # Response expected on HP-UX 10.20 (i.e., ptrace-based).
-                        pass "attach to nonexistent process is prohibited"
-                      }
-      -re "Attaching to.*, process 0 failed.*Hint.*$gdb_prompt $"\
-                      {
-                        # Response expected on HP-UX 11.0 (i.e., ttrace-based).
-                        pass "attach to nonexistent process is prohibited"
-                      }
-      -re "Attaching to.*, process 0.*denied.*$gdb_prompt $"\
-                      {pass "attach to nonexistent process is prohibited"}
-      -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
-                      {
-                        # Response expected from /proc-based systems.
-                        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"}
+       -re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $"\
+	       {
+	   # Response expected on ptrace-based systems (i.e. HP-UX 10.20).
+	   pass "attach to nonexistent process is prohibited"
+       }
+       -re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $"\
+	       {
+	   # Response expected on ttrace-based systems (i.e. HP-UX 11.0).
+	   pass "attach to nonexistent process is prohibited"
+       }
+       -re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $"\
+	       {pass "attach to nonexistent process is prohibited"}
+       -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
+	       {
+	   # Response expected from /proc-based systems.
+	   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"
+       }
    }
 
    # Verify that we can attach to the process by first giving its


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [RFA] Testsuite: fix attach.exp test for FreeBSD 5.0
@ 2003-02-15 16:09 Michael Elizabeth Chastain
  2003-02-15 17:05 ` Mark Kettenis
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-15 16:09 UTC (permalink / raw)
  To: gdb-patches, kettenis

It looks good to me.  I have two issues:

. add '2003' to the copyright years.

. please say what system(s) you tested it on.

I proofread it and ran it through my test bed with no problems
(native i686-pc-linux-gnu, red hat 8.0, glibc 2.2.93-5,
gcc v2 and v3, dwarf-2 and stabs+).

After those two issues, I would recommend this patch for approval
(I can only recommend, I can't approve).

Michael C

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.base/attach.exp: When trying to attach to a nonexistent
	process, make it possible to specify the PID based on the target.


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [RFA] Testsuite: fix attach.exp test for FreeBSD 5.0
@ 2003-02-15 17:34 Michael Elizabeth Chastain
  2003-02-19 23:58 ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-15 17:34 UTC (permalink / raw)
  To: kettenis; +Cc: gdb-patches

Recommended for approval.

Is Fernando Nasser around?  I haven't seen him in weeks.

Michael C

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.base/attach.exp: When trying to attach to a nonexistent
	process, make it possible to specify the PID based on the target.


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [RFA] Testsuite: fix attach.exp test for FreeBSD 5.0
@ 2003-02-23 18:58 Michael Elizabeth Chastain
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-23 18:58 UTC (permalink / raw)
  To: ac131313; +Cc: gdb-patches, kettenis

mec> Is Fernando Nasser around?  I haven't seen him in weeks.
ac> You've not seen fernando for years!  Yes, he is around.

To be precise, the last e-mail I saw from Fernando N on gdb or
gdb-patches was 2003-01-20.

Mark K's patch is still waiting for approval, and I've got another patch
which has been waiting for review for a week.  I'm about to ping
Fernando and the list about it.

Michael C

> Index: ChangeLog
> from  Mark Kettenis  <kettenis@gnu.org>
> 
> 	* gdb.base/attach.exp: When trying to attach to a nonexistent
> 	process, make it possible to specify the PID based on the target.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-23 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-15 11:01 [RFA] Testsuite: fix attach.exp test for FreeBSD 5.0 Mark Kettenis
2003-02-15 16:09 Michael Elizabeth Chastain
2003-02-15 17:05 ` Mark Kettenis
2003-02-15 17:34 Michael Elizabeth Chastain
2003-02-19 23:58 ` Andrew Cagney
2003-02-23 18:58 Michael Elizabeth Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox