Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] testsuite/gdb.base/ending-run.exp
@ 2002-09-18  4:22 Corinna Vinschen
  2002-09-18  8:46 ` Fernando Nasser
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2002-09-18  4:22 UTC (permalink / raw)
  To: gdb-patches

Hi,

I suggest the attached patch to ending-run.exp which fixes the following
problems:

- The "step out of main (status wrapper)" check tests only for
  __wrap_main but not for __wrap__main which is used in dejagnu's
  testglue.c when UNDERSOCRES is defined.

- The "step to end of run (status wrapper)" test expects not only
  the "EXIT code 0" but also a "Program exited normaly" string.
  That's not ok for targets which never actually exit but are just
  trapped in a special _exit() handler.

- Based on this, the expectation that the following "next" will print
  the string "The program is not being run" is plain wrong.  By adding
  a special case for these targets and setting the expected behaviour
  to XFAIL, these targets get a fair chance ;-)

Corinna

        * gdb.base/ending-run.exp: Fix expected string for _wrap_main to
        allow correct handling of #ifdef UNDERSCORES from dejagnu/testglue.c.
        Fix handling of "step to end of run" for embedded targets which
        never actually exit.

Index: gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.16
diff -u -p -r1.16 ending-run.exp
--- gdb.base/ending-run.exp	19 Jul 2002 00:02:34 -0000	1.16
+++ gdb.base/ending-run.exp	18 Sep 2002 11:21:22 -0000
@@ -195,7 +195,7 @@ gdb_expect {
 	    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
 		pass "step out of main"
 	    }
-	    -re ".*in __wrap_main ().*$gdb_prompt $" {
+	    -re ".*in __wrap__?main ().*$gdb_prompt $" {
 		pass "step out of main (status wrapper)"
 	    }
             -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
@@ -245,8 +245,12 @@ if {! [target_info exists use_gdb_stub]
 		# exit" message.
 		pass "step to end of run"
 	    }
-	    -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
+	    -re "Single.*EXIT code 0\r\n.*Program exited normally.*$gdb_prompt $" {
 		pass "step to end of run (status wrapper)"
+	    }
+	    -re "Single.*EXIT code 0\r\n.*$gdb_prompt $" {
+		pass "step to end of run (status wrapper)"
+		setup_xfail "*-*-*"
 	    }
 	    -re ".*Single.*Program exited.*$gdb_prompt $" {
 		pass "step to end of run"


-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com


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

* Re: [RFA] testsuite/gdb.base/ending-run.exp
  2002-09-18  4:22 [RFA] testsuite/gdb.base/ending-run.exp Corinna Vinschen
@ 2002-09-18  8:46 ` Fernando Nasser
  2002-09-18  9:12   ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Fernando Nasser @ 2002-09-18  8:46 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 3004 bytes --]



Corinna Vinschen wrote:
> Hi,
> 
> I suggest the attached patch to ending-run.exp which fixes the following
> problems:
> 
> - The "step out of main (status wrapper)" check tests only for
>   __wrap_main but not for __wrap__main which is used in dejagnu's
>   testglue.c when UNDERSOCRES is defined.
> 
> - The "step to end of run (status wrapper)" test expects not only
>   the "EXIT code 0" but also a "Program exited normaly" string.
>   That's not ok for targets which never actually exit but are just
>   trapped in a special _exit() handler.
> 
> - Based on this, the expectation that the following "next" will print
>   the string "The program is not being run" is plain wrong.  By adding
>   a special case for these targets and setting the expected behaviour
>   to XFAIL, these targets get a fair chance ;-)
> 
> Corinna
> 
>         * gdb.base/ending-run.exp: Fix expected string for _wrap_main to
>         allow correct handling of #ifdef UNDERSCORES from dejagnu/testglue.c.
>         Fix handling of "step to end of run" for embedded targets which
>         never actually exit.
> 
> Index: gdb.base/ending-run.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
> retrieving revision 1.16
> diff -u -p -r1.16 ending-run.exp
> --- gdb.base/ending-run.exp	19 Jul 2002 00:02:34 -0000	1.16
> +++ gdb.base/ending-run.exp	18 Sep 2002 11:21:22 -0000
> @@ -195,7 +195,7 @@ gdb_expect {
>  	    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
>  		pass "step out of main"
>  	    }
> -	    -re ".*in __wrap_main ().*$gdb_prompt $" {
> +	    -re ".*in __wrap__?main ().*$gdb_prompt $" {
>  		pass "step out of main (status wrapper)"
>  	    }
>              -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }

This part is OK.  You can check it in immediately.



> @@ -245,8 +245,12 @@ if {! [target_info exists use_gdb_stub]
>  		# exit" message.
>  		pass "step to end of run"
>  	    }
> -	    -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
> +	    -re "Single.*EXIT code 0\r\n.*Program exited normally.*$gdb_prompt $" {
>  		pass "step to end of run (status wrapper)"

You forgot to mention this change (which seems correct).  It also can be 
checked in providing you mention it in the ChangeLog.



> +	    }
> +	    -re "Single.*EXIT code 0\r\n.*$gdb_prompt $" {
> +		pass "step to end of run (status wrapper)"
> +		setup_xfail "*-*-*"
>  	    }
>  	    -re ".*Single.*Program exited.*$gdb_prompt $" {
>  		pass "step to end of run"
> 
> 

The code for xstormy was actually not correct.  Please look at the 
attached (untested) patch, add your case to it setting the variables 
accordingly and give it a spin.  If it works for you I will check it in 
and then you can add the case above to it.


Regards,
Fernnado


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

[-- Attachment #2: ENDINGRUN.PATCH --]
[-- Type: text/plain, Size: 3424 bytes --]

Index: testsuite/gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.16
diff -c -p -r1.16 ending-run.exp
*** testsuite/gdb.base/ending-run.exp	19 Jul 2002 00:02:34 -0000	1.16
--- testsuite/gdb.base/ending-run.exp	18 Sep 2002 15:40:25 -0000
*************** gdb_expect {
*** 233,238 ****
--- 233,241 ----
  # every BSP's exit function behaves differently, so there's no single
  # way to tell whether we've exited gracefully or not.  So don't run
  # these tests when use_gdb_stub is set, or when we're running under Cygmon.
+ set program_exited_normally 0
+ set program_not_exited 0
+ set program_in_exit 0
  if {! [target_info exists use_gdb_stub]
      && (! [target_info exists use_cygmon] || ! [target_info use_cygmon])} {
      global program_exited;
*************** if {! [target_info exists use_gdb_stub]
*** 244,276 ****
  		# then we won't get the "Single-stepping until function
  		# exit" message.
  		pass "step to end of run"
  	    }
  	    -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
  		pass "step to end of run (status wrapper)"
  	    }
  	    -re ".*Single.*Program exited.*$gdb_prompt $" {
  		pass "step to end of run"
  	    }
  	    -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
  		pass "step to end of run" 
! 		gdb_test "c" ".*" "continue after exit"
  	    }
  	    -re ".*Single.*_int_reset.*$gdb_prompt $" {
  	        pass "step to end of run"
! 		setup_xfail "xstormy16-*-*"
  	    }
  	    -re ".*$gdb_prompt $" {
  		fail "step to end of run"
  	    }
  	    timeout { 
  		fail "(timeout) step to end of run" 
  	    }
  	}   
      }
  
      set timeout $old_timeout
  
!     gdb_test "n" ".*The program is not being run.*" "don't step after run"
  
      set exec_output [remote_exec host "ls core"]
  
--- 247,300 ----
  		# then we won't get the "Single-stepping until function
  		# exit" message.
  		pass "step to end of run"
+ 		set program_exited_normally 1
  	    }
  	    -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
  		pass "step to end of run (status wrapper)"
+ 		set program_exited_normally 1
  	    }
  	    -re ".*Single.*Program exited.*$gdb_prompt $" {
  		pass "step to end of run"
+ 		set program_exited_normally 1
  	    }
  	    -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
  		pass "step to end of run" 
! 		set program_in_exit 1
  	    }
  	    -re ".*Single.*_int_reset.*$gdb_prompt $" {
  	        pass "step to end of run"
! 		if {![istarget "xstormy16-*-*"]} {
! 		    set program_exited_normally 1
! 		}
  	    }
  	    -re ".*$gdb_prompt $" {
  		fail "step to end of run"
+ 		set program_not_exited 1
  	    }
  	    timeout { 
  		fail "(timeout) step to end of run" 
+ 		set program_not_exited 1
  	    }
  	}   
      }
  
+     if {$program_in_exit} {
+ 	if {[gdb_test "c" ".*" "continue after exit"] == 0} {
+ 	    set program_exited_normally 1
+ 	}
+     } else {
+ 	unsupported "continue after exit"
+     }
+ 
      set timeout $old_timeout
  
!     if {$program_exited_normally} {
!         gdb_test "n" ".*The program is not being run.*" "don't step after run"
!     } elseif {$program_not_exited} {
! 	unresolved "don't step after run"
!     } else {
! 	unsupported "don't step after run"
!     }
  
      set exec_output [remote_exec host "ls core"]
  

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

* Re: [RFA] testsuite/gdb.base/ending-run.exp
  2002-09-18  8:46 ` Fernando Nasser
@ 2002-09-18  9:12   ` Corinna Vinschen
  2002-09-18  9:57     ` Fernando Nasser
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2002-09-18  9:12 UTC (permalink / raw)
  To: gdb-patches

On Wed, Sep 18, 2002 at 11:44:49AM -0400, Fernando Nasser wrote:
> >Index: gdb.base/ending-run.exp
> >===================================================================
> >RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
> >retrieving revision 1.16
> >diff -u -p -r1.16 ending-run.exp
> >--- gdb.base/ending-run.exp	19 Jul 2002 00:02:34 -0000	1.16
> >+++ gdb.base/ending-run.exp	18 Sep 2002 11:21:22 -0000
> >@@ -195,7 +195,7 @@ gdb_expect {
> > 	    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
> > 		pass "step out of main"
> > 	    }
> >-	    -re ".*in __wrap_main ().*$gdb_prompt $" {
> >+	    -re ".*in __wrap__?main ().*$gdb_prompt $" {
> > 		pass "step out of main (status wrapper)"
> > 	    }
> >             -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
> 
> This part is OK.  You can check it in immediately.

Applied.

> >@@ -245,8 +245,12 @@ if {! [target_info exists use_gdb_stub]
> > 		# exit" message.
> > 		pass "step to end of run"
> > 	    }
> >-	    -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
> >+	    -re "Single.*EXIT code 0\r\n.*Program exited normally.*$gdb_prompt $" 
> >{
> > 		pass "step to end of run (status wrapper)"
> 
> You forgot to mention this change (which seems correct).  It also can be 
> checked in providing you mention it in the ChangeLog.

Applied w/ ChangeLog entry.

> The code for xstormy was actually not correct.  Please look at the 
> attached (untested) patch, add your case to it setting the variables 
> accordingly and give it a spin.  If it works for you I will check it in 
> and then you can add the case above to it.

Works fine.  My code then adds the new case as unsupported.  I'll
check it in as soon as you checked your patch in.

Thanks,
Corinna


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

* Re: [RFA] testsuite/gdb.base/ending-run.exp
  2002-09-18  9:12   ` Corinna Vinschen
@ 2002-09-18  9:57     ` Fernando Nasser
  2002-09-18 10:21       ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Fernando Nasser @ 2002-09-18  9:57 UTC (permalink / raw)
  To: gdb-patches

Corinna Vinschen wrote:
> On Wed, Sep 18, 2002 at 11:44:49AM -0400, Fernando Nasser wrote:
>>The code for xstormy was actually not correct.  Please look at the 
>>attached (untested) patch, add your case to it setting the variables 
>>accordingly and give it a spin.  If it works for you I will check it in 
>>and then you can add the case above to it.
> 
> 
> Works fine.  My code then adds the new case as unsupported.  I'll
> check it in as soon as you checked your patch in.
> 

Will do it right now.

You can check your part in as soon as you see the commit.

Thanks.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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

* Re: [RFA] testsuite/gdb.base/ending-run.exp
  2002-09-18  9:57     ` Fernando Nasser
@ 2002-09-18 10:21       ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2002-09-18 10:21 UTC (permalink / raw)
  To: gdb-patches

On Wed, Sep 18, 2002 at 12:55:53PM -0400, Fernando Nasser wrote:
> Corinna Vinschen wrote:
> >On Wed, Sep 18, 2002 at 11:44:49AM -0400, Fernando Nasser wrote:
> >>The code for xstormy was actually not correct.  Please look at the 
> >>attached (untested) patch, add your case to it setting the variables 
> >>accordingly and give it a spin.  If it works for you I will check it in 
> >>and then you can add the case above to it.
> >
> >
> >Works fine.  My code then adds the new case as unsupported.  I'll
> >check it in as soon as you checked your patch in.
> >
> 
> Will do it right now.
> 
> You can check your part in as soon as you see the commit.

Done.

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com


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

end of thread, other threads:[~2002-09-18 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-18  4:22 [RFA] testsuite/gdb.base/ending-run.exp Corinna Vinschen
2002-09-18  8:46 ` Fernando Nasser
2002-09-18  9:12   ` Corinna Vinschen
2002-09-18  9:57     ` Fernando Nasser
2002-09-18 10:21       ` Corinna Vinschen

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