* gdb.base/attach.exp: When trying to attach to a nonexistent
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / signals.exp
index 16528f731d3626923ecfa415de9af3f624a7b0da..be974550e21925e9da1cd49a12728ccf3aa1e1c9 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+#   Copyright 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -42,6 +42,12 @@ if [get_compiler_info ${binfile}] {
     return -1;
 }
 
+if {$hp_cc_compiler} {
+    set void 0
+} else {
+    set void void
+}
+
 proc signal_tests_1 {} {
     global gdb_prompt
     if [runto_main] then {
@@ -178,8 +184,8 @@ proc signal_tests_1 {} {
        # This doesn't test that main is frame #2, just that main is frame
        # #2, #3, or higher.  At some point this should be fixed (but
        # it quite possibly would introduce new FAILs on some systems).
-       setup_xfail "i*86-pc-linux-gnu*" "i*86-*-bsdi2.0"
-       gdb_test "backtrace 10" "#0.*handler.*#1.*#2.*main.*" \
+       setup_xfail "i*86-*-bsdi2.0"
+       gdb_test "backtrace 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" \
            "backtrace in signals_tests_1"
 
        gdb_test "break func1" "Breakpoint \[0-9\]+ .*"
@@ -341,7 +347,7 @@ proc test_handle_all_print {} {
               || [istarget "*-*-mach*"] ) } {
        gdb_test "handle all print" "Signal\[   \]+Stop\[       \]+Print\[      \]+Pass to program\[    \]+Description\r\nSIGHUP\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Hangup.*SIG63\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Real-time event 63.*EXC_BREAKPOINT\[         \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Breakpoint"
     } else {
-       gdb_test "handle all print" "Signal\[   \]+Stop\[       \]+Print\[      \]+Pass to program\[    \]+Description\r\nSIGHUP\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Hangup.*SIG63\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Real-time event 63"
+       gdb_test "handle all print" "Signal\[   \]+Stop\[       \]+Print\[      \]+Pass to program\[    \]+Description\r\nSIGHUP\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Hangup.*SIG63\[      \]+Yes\[        \]+Yes\[        \]+Yes\[        \]+Real-time event 63.*"
     }
     set timeout $oldtimeout
     verbose "Timeout restored to $timeout seconds" 2
@@ -364,6 +370,9 @@ gdb_expect {
 }
 
 if [runto_main] then {
+    # Since count is a static variable outside main, runto_main
+    # is no guarantee that count will be 0 at this point.
+    gdb_test "set variable count = 0" ""
     gdb_test "break handler if 0" "Breakpoint \[0-9\]+ .*"
     gdb_test "set \$handler_breakpoint_number = \$bpnum" ""
 
@@ -380,7 +389,7 @@ if [runto_main] then {
     # lose its cool, this is not a problem, it just has to note
     # that the breakpoint condition is false and keep going.
 
-    gdb_test "p func1 ()" "^p func1 \\(\\)\r\n.\[0-9\]* = void" \
+    gdb_test "p func1 ()" "^p func1 \\(\\)\r\n.\[0-9\]* = $void" \
        "p func1 () #1 in signals.exp"
 
     # Make sure the count got incremented.
@@ -406,7 +415,7 @@ The program being debugged stopped while in a function called from GDB.*" \
     # But we should be able to backtrace...
     # On alpha-*-osf2.0 this test works when run manually but sometime fails when
     # run under dejagnu, making it very hard to debug the problem.  Weird...
-    gdb_test "bt 10" "#0.*handler.*#1.*#2.*main.*" "bt in signals.exp"
+    gdb_test "bt 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" "bt in signals.exp"
     # ...and continue...
     gdb_test "continue" "Continuing\\." "continue in signals.exp"
     # ...and then count should have been incremented
This page took 0.025116 seconds and 4 git commands to generate.