X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.base%2Ffoll-fork.exp;h=27bbb44e53648ed3c5db05d4070db7b6c3bd0399;hb=57d87c09a33acdce280f4c9ae4f55b885a5cee99;hp=8884686928d355588cda0cf484c61746164a298e;hpb=42a4f53d2bf8938c2aeda9f52be7a20534b214a9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp index 8884686928..27bbb44e53 100644 --- a/gdb/testsuite/gdb.base/foll-fork.exp +++ b/gdb/testsuite/gdb.base/foll-fork.exp @@ -1,4 +1,4 @@ -# Copyright 1997-2019 Free Software Foundation, Inc. +# Copyright 1997-2020 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 @@ -20,6 +20,13 @@ if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then { continue } +# Test relies on checking follow-fork output. Do not run if gdb debug is +# enabled as it will be redirected to the log. +if [gdb_debug_enabled] { + untested "debug is enabled" + return 0 +} + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { @@ -84,8 +91,7 @@ proc test_follow_fork { who detach cmd } { } gdb_test "show follow-fork" \ - "Debugger response to a program call of fork or vfork is \"$who\"." \ - "show follow-fork" + "Debugger response to a program call of fork or vfork is \"$who\"." # Set detach-on-fork mode if we aren't using the default. if {$detach == "default"} { @@ -95,8 +101,7 @@ proc test_follow_fork { who detach cmd } { } gdb_test "show detach-on-fork" \ - "Whether gdb will detach.* fork is $detach." \ - "show detach-on-fork" + "Whether gdb will detach.* fork is $detach." # Set a breakpoint after the fork if we aren't single-stepping # past the fork. @@ -131,15 +136,13 @@ proc test_follow_fork { who detach cmd } { if {$who == "parent" && $detach == "on"} { # Follow parent / detach child: the only inferior is the parent. - gdb_test "info inferiors" "\\* 1 .* process.*" \ - "info inferiors" + gdb_test "info inferiors" "\\* 1 .* process.*" } elseif {$who == "parent" && $detach == "off"} { # Follow parent / keep child: two inferiors under debug, the # parent is the current inferior. - gdb_test "info inferiors" "\\* 1 .*process.* 2 .*process.*" \ - "info inferiors" + gdb_test "info inferiors" "\\* 1 .*process.* 2 .*process.*" gdb_test "inferior 2" "Switching to inferior 2 .*" set resume_unfollowed 1 @@ -149,15 +152,13 @@ proc test_follow_fork { who detach cmd } { # Follow child / detach parent: the child is under debug and is # the current inferior. The parent is listed but is not under # debug. - gdb_test "info inferiors" " 1 .*.*\\* 2 .*process.*" \ - "info inferiors" + gdb_test "info inferiors" " 1 .*.*\\* 2 .*process.*" } elseif {$who == "child" && $detach == "off"} { # Follow child / keep parent: two inferiors under debug, the # child is the current inferior. - gdb_test "info inferiors" " 1 .*process.*\\* 2 .*process.*" \ - "info inferiors" + gdb_test "info inferiors" " 1 .*process.*\\* 2 .*process.*" gdb_test "inferior 1" "Switching to inferior 1 .*" set resume_unfollowed 1 @@ -333,8 +334,7 @@ A fork or vfork creates a new process. follow-fork-mode can be:.* .*parent - the original process is debugged after a fork.* .*child - the new process is debugged after a fork.* The unfollowed process will continue to run..* -By default, the debugger will follow the parent process..*" \ - "help set follow-fork" +By default, the debugger will follow the parent process..*" # Verify that we can set follow-fork-mode, using an abbreviation # for both the flag and its value.