This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] More status wrapper cleanups.



Add recognition for status wrapper output to gdb.exp, ending-run.exp.

2002-05-06  Michael Snyder  <msnyder@redhat.com>

	* lib/gdb.exp (gdb_test): Add case to allow for status wrapper.
	(gdb_continue_to_end): Accept output from status wrapper.
	* gdb.base/ending-run.exp: Add case for output from status wrapper.
	Clean up fail messages to match pass messages.

Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.16
diff -p -r1.16 gdb.exp
*** lib/gdb.exp	7 May 2002 00:45:42 -0000	1.16
--- lib/gdb.exp	7 May 2002 02:18:59 -0000
*************** proc gdb_test { args } {
*** 521,526 ****
--- 521,535 ----
  	    fail "$errmsg"
  	    return -1
  	}
+ 	 -re "EXIT code \[0-9\r\n\]+Program exited normally.*$gdb_prompt $" {
+ 	    if ![string match "" $message] then {
+ 		set errmsg "$message: the program exited"
+ 	    } else {
+ 		set errmsg "$command: the program exited"
+ 	    }
+ 	    fail "$errmsg"
+ 	    return -1
+ 	}
  	 -re "The program is not being run.*$gdb_prompt $" {
  	    if ![string match "" $message] then {
  		set errmsg "$message: the program is no longer running"
*************** proc gdb_continue_to_end {mssg} {
*** 1605,1611 ****
      # Don't bother to check the output of the program, that may be
      # extremely tough for some remote systems.
      gdb_test "continue"\
!       "Continuing.\[\r\n0-9\]+Program exited normally\\..*"\
        "continue until exit at $mssg"
    }
  }
--- 1614,1620 ----
      # Don't bother to check the output of the program, that may be
      # extremely tough for some remote systems.
      gdb_test "continue"\
!       "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|)Program exited normally\\..*"\
        "continue until exit at $mssg"
    }
  }
Index: gdb.base/ending-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ending-run.exp,v
retrieving revision 1.14
diff -p -r1.14 ending-run.exp
*** gdb.base/ending-run.exp	11 Apr 2002 03:31:26 -0000	1.14
--- gdb.base/ending-run.exp	7 May 2002 02:18:59 -0000
*************** if [target_info exists use_gdb_stub] {
*** 74,82 ****
  gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
  send_gdb "i b\n"
  gdb_expect {
!     -re ".*breakpoint.*breakpoint.*$gdb_prompt $" { fail "clear bp" }
!     -re ".*3.*main.*31.*$gdb_prompt $" { pass "cleared bp at line before routine" }
!     -re ".*$gdb_prompt $" { fail "info b" }
  }
  
  # Test some other "clear" combinations
--- 74,88 ----
  gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
  send_gdb "i b\n"
  gdb_expect {
!     -re ".*breakpoint.*breakpoint.*$gdb_prompt $" { 
! 	fail "cleared bp at line before routine" 
!     }
!     -re ".*3.*main.*31.*$gdb_prompt $" { 
! 	pass "cleared bp at line before routine" 
!     }
!     -re ".*$gdb_prompt $" { 
! 	fail "cleared bp at line before routine (info b)" 
!     }
  }
  
  # Test some other "clear" combinations
*************** gdb_expect {
*** 115,127 ****
  send_gdb "i b\n"
  gdb_expect {
      -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
!         fail "didn't clear bps" 
      }
      -re ".*3.*main.*31.*$gdb_prompt $" {
          pass "all set to continue"
      }
      -re ".*$gdb_prompt $" {
!         fail "missing bp at end"
      }
  }
  
--- 121,133 ----
  send_gdb "i b\n"
  gdb_expect {
      -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
!         fail "all set to continue (didn't clear bps)" 
      }
      -re ".*3.*main.*31.*$gdb_prompt $" {
          pass "all set to continue"
      }
      -re ".*$gdb_prompt $" {
!         fail "all set to continue (missing bp at end)"
      }
  }
  
*************** gdb_expect {
*** 152,158 ****
  	send_gdb "next\n"
  	gdb_expect {
  	    -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
! 		fail "Old bug came back!"
  		gdb_test "n" ".*" ""
  	    }
  	    -re ".*in.*start.*$gdb_prompt $" { 
--- 158,164 ----
  	send_gdb "next\n"
  	gdb_expect {
  	    -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
! 		fail "step out of main (Old bug came back!)"
  		gdb_test "n" ".*" ""
  	    }
  	    -re ".*in.*start.*$gdb_prompt $" { 
*************** gdb_expect {
*** 172,178 ****
  	    }
  	    -re ".*in .nope ().*$gdb_prompt $" {
  		# This is what happens on Solaris currently -sts 1999-08-25
! 		pass "step out of main on Solaris"
  	    }
  	    -re ".*in _int_reset ().*$gdb_prompt $" {
  		# This is what happens on Sanyo XStormy16
--- 178,184 ----
  	    }
  	    -re ".*in .nope ().*$gdb_prompt $" {
  		# This is what happens on Solaris currently -sts 1999-08-25
! 		pass "step out of main (on Solaris)"
  	    }
  	    -re ".*in _int_reset ().*$gdb_prompt $" {
  		# This is what happens on Sanyo XStormy16
*************** gdb_expect {
*** 184,196 ****
  	    }
  	    -re ".*in ..change.mode ().*$gdb_prompt $" {
  		# This is what happens on ARM in thumb mode -fn 2000-02-01
! 		pass "step out of main on ARM thumb"
  	    }
  	    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
  		pass "step out of main"
  	    }
!             -re ".*$gdb_prompt $" { fail "step at end 2" }
! 	    timeout { fail "hang or timeout on step at end 2" }
  	}
      }
      -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
--- 190,207 ----
  	    }
  	    -re ".*in ..change.mode ().*$gdb_prompt $" {
  		# This is what happens on ARM in thumb mode -fn 2000-02-01
! 		pass "step out of main (on ARM thumb)"
  	    }
  	    -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
  		pass "step out of main"
  	    }
! 	    -re ".*in __wrap_main ().*$gdb_prompt $" {
! 		pass "step out of main (status wrapper)"
! 	    }
!             -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
! 	    timeout { 
! 		fail "step out of main (hang or timeout on step at end 2)" 
! 	    }
  	}
      }
      -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
*************** gdb_expect {
*** 201,207 ****
          pass "step out of main"
      }
      -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $"  {
!         pass "step out of main 2"
      }
      -re ".*Program exited normally.*$gdb_prompt $" {
  	# This is what happens on Linux i86 (and I would expect others)
--- 212,218 ----
          pass "step out of main"
      }
      -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $"  {
!         pass "step out of main (2)"
      }
      -re ".*Program exited normally.*$gdb_prompt $" {
  	# This is what happens on Linux i86 (and I would expect others)
*************** gdb_expect {
*** 209,221 ****
  	pass "step out of main"
      }
      -re ".*in.*currently asm.*$gdb_prompt $" { 
!         pass "step out of main into assembler"
      }
      -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
          pass "Cygmon stopped in ending trap."
      }
!     -re ".*$gdb_prompt $" { fail "step at end 1" }
!     timeout { fail "hang or timeout on step at end 1" }
  }
  
  if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
--- 220,232 ----
  	pass "step out of main"
      }
      -re ".*in.*currently asm.*$gdb_prompt $" { 
!         pass "step out of main (into assembler)"
      }
      -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
          pass "Cygmon stopped in ending trap."
      }
!     -re ".*$gdb_prompt $" { fail "step out of main (at end 1)" }
!     timeout { fail "step out of main (hang or timeout on step at end 1)" }
  }
  
  if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
*************** if {![target_info exists use_cygmon] || 
*** 229,234 ****
--- 240,248 ----
  		# 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"
  	    }
*************** if {![target_info exists use_cygmon] || 
*** 259,268 ****
  	pass "No core dumped on quit"
      } else {
  	if [ regexp "No such file or directory" $exec_output] {
! 	    pass "ls: core: No core dumped on quit"
  	} else {
  	    remote_exec build "rm -f core"
! 	    fail "Core dumped on quit"
  	}
      }
  }
--- 273,282 ----
  	pass "No core dumped on quit"
      } else {
  	if [ regexp "No such file or directory" $exec_output] {
! 	    pass "ls: core (No core dumped on quit)"
  	} else {
  	    remote_exec build "rm -f core"
! 	    fail "ls: core (Core dumped on quit)"
  	}
      }
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]