Implement pahole-like 'ptype /o' option
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / multi-forks.exp
index 2b0b81d50a7660e6bdeff3d5318fa35e0a425855..1d98298ad026cd23e44625b92a85f7a3fe3c255f 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 2005-2015 Free Software Foundation, Inc.
+#   Copyright 2005-2017 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [is_remote target] || ![isnative] } then {
-    continue
-}
-
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-*-linux*"]} then {
+if { ![istarget "*-*-linux*"] } then {
     continue
 }
 
@@ -28,7 +24,7 @@ if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-*-linux*"]} then {
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested multi-forks.exp
+     untested "failed to compile"
      return -1
 }
 
@@ -111,6 +107,7 @@ proc continue_to_exit_bp_loc {} {
 # First set gdb to follow the child.
 # The result should be that each of the 4 forks returns zero.
 
+clean_restart ${binfile}
 runto_main
 gdb_test_no_output "set follow-fork child"
 continue_to_exit_bp_loc
@@ -120,6 +117,7 @@ gdb_test "print pids" "\\$.* = \\{0, 0, 0, 0\\}.*" "follow child, print pids"
 # Now set gdb to follow the parent.
 # Result should be that none of the 4 forks returns zero.
 
+clean_restart ${binfile}
 runto_main
 gdb_test_no_output "set follow-fork parent" ""
 continue_to_exit_bp_loc
@@ -131,12 +129,6 @@ gdb_test "print pids\[0\]==0 || pids\[1\]==0 || pids\[2\]==0 || pids\[3\]==0" \
 # Now test with detach-on-fork off.
 #
 
-# detach-on-fork isn't implemented on hpux.
-#
-if {![istarget "*-*-linux*"]} then {
-    continue
-}
-
 # Start with a fresh gdb
 
 clean_restart ${binfile}
@@ -157,13 +149,13 @@ gdb_test_no_output "set detach off" "set detach off"
 #
 
 for {set i 1} {$i <= 15} {incr i} {
-  gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit $i"
+  gdb_test "continue" "Breakpoint .* main .*exit.*" "run to exit $i"
   gdb_test "info inferior" " 2 .* 3 .* 4 .* 5 .*" "info inferior $i"
   gdb_test "inferior $i + 1" "(_dl_sysinfo_int80|fork|__kernel_(v|)syscall).*" \
       "inferior $i"
 }
 
-gdb_test "continue" "Breakpoint .* main .*exit.*" "Run to exit 16"
+gdb_test "continue" "Breakpoint .* main .*exit.*" "run to exit 16"
 gdb_test "info inferior" " 2 .* 3 .* 4 .* 5 .*" "info inferior 16"
 gdb_test "inferior 2" " main .*" "restart final"
 
@@ -176,18 +168,18 @@ gdb_test "inferior 2" " main .*" "restart final"
 # 
 
 # [assumes we're at #1]
-gdb_test "detach inferior 2" "Detaching .*" "Detach 2"
-gdb_test "detach inferior 3" "Detaching .*" "Detach 3"
-gdb_test "detach inferior 4" "Detaching .*" "Detach 4"
-gdb_test "detach inferior 5" "Detaching .*" "Detach 5"
+gdb_test "detach inferior 2" "Detaching .*" "detach 2"
+gdb_test "detach inferior 3" "Detaching .*" "detach 3"
+gdb_test "detach inferior 4" "Detaching .*" "detach 4"
+gdb_test "detach inferior 5" "Detaching .*" "detach 5"
 
 # 
 # Test kill inferior
 #
 
 for {set i 6} { $i <= 16} {incr i} {
-    gdb_test_no_output "kill inferior $i" "Kill $i"
-    gdb_test "info inferior $i" "<null>.*" "Did kill $i"
+    gdb_test_no_output "kill inferior $i" "kill $i"
+    gdb_test "info inferior $i" "<null>.*" "did kill $i"
 }
 
 return 0
This page took 0.025448 seconds and 4 git commands to generate.