[RFA] Fix char_func return value in finish.exp

Michael Snyder msnyder@redhat.com
Thu Dec 21 10:04:00 GMT 2000


char_func returns '1', not \001.  Attempt to match a non-ascii char '1'
as well as an ascii one.

Fernando -- I know the non-ascii clause produces a PASS output that is 
different from the ascii clause -- but I don't ever expect it to be
invoked.
If it ever is, that will be a signal for us to revisit the issue.
2000-12-21  Michael Snyder  <msnyder@mvstp600e.cygnus.com>

	* gdb.base/finish.exp: Accept '1' instead of \001 from char_func.
	Add a RE to accept a non-ascii char if one is ever presented.

Index: finish.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/finish.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 finish.exp
*** finish.exp	2000/12/08 20:17:46	1.1
--- finish.exp	2000/12/21 17:59:01
*************** proc finish_1 { type } {
*** 43,53 ****
  	    "continue to ${type}_func"
      send_gdb "finish\n"
      gdb_expect {
! 	-re ".*Value returned is .* = 1 '.001'\r\n$gdb_prompt $" {
  	    if { $type == "char" } {
  		pass "finish from char_func"
  	    } else {
! 		fail "finish from char_func"
  	    }
  	}
  	-re ".*Value returned is .* = 1\r\n$gdb_prompt $" {
--- 43,60 ----
  	    "continue to ${type}_func"
      send_gdb "finish\n"
      gdb_expect {
! 	-re ".*Value returned is .* = 49 '1'\r\n$gdb_prompt $" {
  	    if { $type == "char" } {
  		pass "finish from char_func"
  	    } else {
! 		fail "finish from ${type}_func"
! 	    }
! 	}
! 	-re ".*Value returned is .* = \[0123456789\]* '1'\r\n$gdb_prompt $" {
! 	    if { $type == "char" } {
! 		pass "finish from char_func (non-ASCII char set?)"
! 	    } else {
! 		fail "finish from ${type}_func"
  	    }
  	}
  	-re ".*Value returned is .* = 1\r\n$gdb_prompt $" {


More information about the Gdb-patches mailing list