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]

RFA: respect `nosignals' setting in annota1.exp



2002-03-07  Jim Blandy  <jimb@redhat.com>

	* gdb.base/annota1.exp: Don't run signal-related tests if the
	target board has the `nosignals' flag set.

Index: gdb/testsuite/gdb.base/annota1.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/annota1.exp,v
retrieving revision 1.13.52.1
diff -c -r1.13.52.1 annota1.exp
*** gdb/testsuite/gdb.base/annota1.exp	2001/12/19 23:47:51	1.13.52.1
--- gdb/testsuite/gdb.base/annota1.exp	2002/03/07 19:50:37
***************
*** 254,292 ****
  }
  
  
! #
! # test printing a frame with some arguments: 
! # annotate-arg-begin
! # annotate-arg-name-end
! # annotate-arg-value
! # annotate-arg-end
! #
! send_gdb "signal SIGUSR1\n"
! gdb_expect {
!   -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
! 	{ pass "send SIGUSR1" }
!   -re ".*$gdb_prompt$"     { fail "send SIGUSR1" }
!   timeout	            { fail "send SIGUSR1 (timeout)" }
! }
  
  
! #
! # test:
! # annotate-signal-handler-caller
! #
! verbose "match_max local is: [match_max]"
! verbose "match_max default is: [match_max -d]"
! # This is necessary because a 2000 buffer is not enought to get everything
! # up to the prompt ad the test gets a timeout.
! match_max 3000
! verbose "match_max now is: [match_max]"
! send_gdb "backtrace\n"
! gdb_expect {
!     -re "frame-begin 0 $hex\r\n#0.*frame-end.*frame-begin 1 $hex\r\n#1.*(\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n)*\032\032frame-end\r\n\r\n\032\032frame-begin 2 $hex\r\n#2.*(frame-begin 3 $hex\r\n#3.*)*frame-end.*$gdb_prompt$" {
! 	pass "backtrace @ signal handler"
      }
-     -re ".*$gdb_prompt$"   { fail "backtrace @ signal handler" }
-     timeout                { fail "backtrace @ signal handler (timeout)" }
  }
  
  #
--- 254,296 ----
  }
  
  
! if {[target_info exists gdb,nosignals]} {
!     verbose "Skipping signal-related tests because of nosignals."
! } else {
!     #
!     # test printing a frame with some arguments: 
!     # annotate-arg-begin
!     # annotate-arg-name-end
!     # annotate-arg-value
!     # annotate-arg-end
!     #
!     send_gdb "signal SIGUSR1\n"
!     gdb_expect {
!         -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
!                 { pass "send SIGUSR1" }
!         -re ".*$gdb_prompt$"     { fail "send SIGUSR1" }
!         timeout	            { fail "send SIGUSR1 (timeout)" }
!     }
  
  
!     #
!     # test:
!     # annotate-signal-handler-caller
!     #
!     verbose "match_max local is: [match_max]"
!     verbose "match_max default is: [match_max -d]"
!     # This is necessary because a 2000 buffer is not enought to get everything
!     # up to the prompt ad the test gets a timeout.
!     match_max 3000
!     verbose "match_max now is: [match_max]"
!     send_gdb "backtrace\n"
!     gdb_expect {
!         -re "frame-begin 0 $hex\r\n#0.*frame-end.*frame-begin 1 $hex\r\n#1.*(\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n)*\032\032frame-end\r\n\r\n\032\032frame-begin 2 $hex\r\n#2.*(frame-begin 3 $hex\r\n#3.*)*frame-end.*$gdb_prompt$" {
!             pass "backtrace @ signal handler"
!         }
!         -re ".*$gdb_prompt$"   { fail "backtrace @ signal handler" }
!         timeout                { fail "backtrace @ signal handler (timeout)" }
      }
  }
  
  #
***************
*** 414,444 ****
      timeout { fail "breakpoint ignore count (timeout)" }
  }
  
! #
! # Send a signal that is not handled; test:
! # annotate-signalled
! # annotate-signal-name
! # annotate-signal-name-end
! # annotate-signal-string
! # annotate-signal-string-end
! # FIXME: annotate-signal not tested (requires that the inferior be 
! #                        stopped by a "random" signal)
! #
! # SIGTRAP signals are dropped before they get to the inferior process
! # on hpux11.  In theory, this behaivor can be controlled by setting
! # TTEO_NORM_SIGTRAP in the inferior, but doing so did not cause
! # the signal to be properly delivered.
! #
! # It has been verified that other signals will be delivered.  However,
! # rather than twiddle the test, I choose to leave it as-is as it
! # exposes an interesting failure on hpux11.
! setup_xfail hppa*-*-hpux11*
! send_gdb "signal SIGTRAP\n"
! gdb_expect {
!   -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
! 	  { pass "signal sent" }
!   -re ".*$gdb_prompt$" { fail "signal sent" }
!   timeout { fail "signal sent (timeout)" }
  }
  
  
--- 418,450 ----
      timeout { fail "breakpoint ignore count (timeout)" }
  }
  
! if {! [target_info exists gdb,nosignals]} {
!     #
!     # Send a signal that is not handled; test:
!     # annotate-signalled
!     # annotate-signal-name
!     # annotate-signal-name-end
!     # annotate-signal-string
!     # annotate-signal-string-end
!     # FIXME: annotate-signal not tested (requires that the inferior be 
!     #                        stopped by a "random" signal)
!     #
!     # SIGTRAP signals are dropped before they get to the inferior process
!     # on hpux11.  In theory, this behaivor can be controlled by setting
!     # TTEO_NORM_SIGTRAP in the inferior, but doing so did not cause
!     # the signal to be properly delivered.
!     #
!     # It has been verified that other signals will be delivered.  However,
!     # rather than twiddle the test, I choose to leave it as-is as it
!     # exposes an interesting failure on hpux11.
!     setup_xfail hppa*-*-hpux11*
!     send_gdb "signal SIGTRAP\n"
!     gdb_expect {
!         -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
!                 { pass "signal sent" }
!         -re ".*$gdb_prompt$" { fail "signal sent" }
!         timeout { fail "signal sent (timeout)" }
!     }
  }
  
  


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