From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id duxrDgfGO2FyOwAAWB0awg (envelope-from ) for ; Fri, 10 Sep 2021 16:54:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 25AB21EE24; Fri, 10 Sep 2021 16:54:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 55FAD1EE20 for ; Fri, 10 Sep 2021 16:54:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 463AD385841B for ; Fri, 10 Sep 2021 20:54:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 463AD385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631307269; bh=JyvO76+1BkyLmM1CjxdA76Hhz3OhxGVzq+Fo3JVm/kk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KS97Cl0hYiTF9BIBxJqiEYFIF+Nti8Z4eYuqbkE/pR7xnfQxukLBif+4mlvPh24l4 npirLMlwAL7nyL60bzT4uoCGnW7ru0u8Rp0tilItEPStsm+Y3Z0L6LkLEgkbmi60VL TDQ20XzQVXDwsMqnk0ehSRrshJN5VfyWVCEYnwjI= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 69F3C3858405 for ; Fri, 10 Sep 2021 20:54:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69F3C3858405 X-ASG-Debug-ID: 1631307244-0c856e0388270240001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id 2IyFaAynirTxIWkF (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Sep 2021 16:54:05 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (173-246-27-5.qc.cable.ebox.net [173.246.27.5]) by smtp.ebox.ca (Postfix) with ESMTP id D162B441D66; Fri, 10 Sep 2021 16:54:04 -0400 (EDT) X-Barracuda-RBL-IP: 173.246.27.5 X-Barracuda-Effective-Source-IP: 173-246-27-5.qc.cable.ebox.net[173.246.27.5] X-Barracuda-Apparent-Source-IP: 173.246.27.5 To: gdb-patches@sourceware.org Subject: [PATCH 4/6] gdb.base/foll-fork.exp: rename variables Date: Fri, 10 Sep 2021 16:54:00 -0400 X-ASG-Orig-Subj: [PATCH 4/6] gdb.base/foll-fork.exp: rename variables Message-Id: <20210910205402.3853607-4-simon.marchi@efficios.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910205402.3853607-1-simon.marchi@efficios.com> References: <20210910205402.3853607-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1631307245 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 5094 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.92507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Rename the variables / parameters used to match the corresponding GDB setting name, I find that easier to follow. Change-Id: Idcbddbbb369279fcf1e808b11a8c478f21b2a946 --- gdb/testsuite/gdb.base/foll-fork.exp | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp index 4661bf56a52..3b90bb2e785 100644 --- a/gdb/testsuite/gdb.base/foll-fork.exp +++ b/gdb/testsuite/gdb.base/foll-fork.exp @@ -74,12 +74,12 @@ proc_with_prefix check_fork_catchpoints {} { # execute the program past the fork. If the value of WHO or DETACH is # 'default', the corresponding GDB command is skipped for that test. # The value of CMD must be either 'next 2' or 'continue'. -proc_with_prefix test_follow_fork { who detach cmd } { +proc_with_prefix test_follow_fork { follow-fork-mode detach-on-fork cmd } { global gdb_prompt global srcfile global testfile - with_test_prefix "follow $who, detach $detach, command \"$cmd\"" { + with_test_prefix "follow ${follow-fork-mode}, detach ${detach-on-fork}, command \"$cmd\"" { # Start a new debugger session each time so defaults are legitimate. if { ![setup] } { @@ -91,24 +91,24 @@ proc_with_prefix test_follow_fork { who detach cmd } { gdb_test_no_output "set verbose" # Set follow-fork-mode if we aren't using the default. - if {$who == "default"} { - set who "parent" + if {${follow-fork-mode} == "default"} { + set follow-fork-mode "parent" } else { - gdb_test_no_output "set follow-fork $who" + gdb_test_no_output "set follow-fork ${follow-fork-mode}" } gdb_test "show follow-fork" \ - "Debugger response to a program call of fork or vfork is \"$who\"." + "Debugger response to a program call of fork or vfork is \"${follow-fork-mode}\"." # Set detach-on-fork mode if we aren't using the default. - if {$detach == "default"} { - set detach "on" + if {${detach-on-fork} == "default"} { + set detach-on-fork "on" } else { - gdb_test_no_output "set detach-on-fork $detach" + gdb_test_no_output "set detach-on-fork ${detach-on-fork}" } gdb_test "show detach-on-fork" \ - "Whether gdb will detach.* fork is $detach." + "Whether gdb will detach.* fork is ${detach-on-fork}." # Set a breakpoint after the fork if we aren't single-stepping # past the fork. @@ -121,13 +121,13 @@ proc_with_prefix test_follow_fork { who detach cmd } { # Set up the output we expect to see after we run. set expected_re "" - if {$who == "child"} { + if {${follow-fork-mode} == "child"} { set expected_re "\\\[Attaching after.* fork to.*" - if {$detach == "on"} { + if {${detach-on-fork} == "on"} { append expected_re "\\\[Detaching after fork from .*" } append expected_re "set breakpoint here.*" - } elseif {$who == "parent" && $detach == "on"} { + } elseif {${follow-fork-mode} == "parent" && ${detach-on-fork} == "on"} { set expected_re "\\\[Detaching after fork from .*set breakpoint here.*" } else { set expected_re ".*set breakpoint here.*" @@ -140,12 +140,12 @@ proc_with_prefix test_follow_fork { who detach cmd } { # Check that we have the inferiors arranged correctly after # following the fork. set resume_unfollowed 0 - if {$who == "parent" && $detach == "on"} { + if {${follow-fork-mode} == "parent" && ${detach-on-fork} == "on"} { # Follow parent / detach child: the only inferior is the parent. gdb_test "info inferiors" "\\* 1 .* process.*" - } elseif {$who == "parent" && $detach == "off"} { + } elseif {${follow-fork-mode} == "parent" && ${detach-on-fork} == "off"} { # Follow parent / keep child: two inferiors under debug, the # parent is the current inferior. @@ -154,14 +154,14 @@ proc_with_prefix test_follow_fork { who detach cmd } { gdb_test "inferior 2" "Switching to inferior 2 .*" set resume_unfollowed 1 - } elseif {$who == "child" && $detach == "on"} { + } elseif {${follow-fork-mode} == "child" && ${detach-on-fork} == "on"} { # 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.*" - } elseif {$who == "child" && $detach == "off"} { + } elseif {${follow-fork-mode} == "child" && ${detach-on-fork} == "off"} { # Follow child / keep parent: two inferiors under debug, the # child is the current inferior. @@ -400,10 +400,10 @@ foreach cmd {"next 2" "continue"} { } # Now test all explicit permutations. -foreach who {"parent" "child"} { - foreach detach {"on" "off"} { +foreach follow-fork-mode {"parent" "child"} { + foreach detach-on-fork {"on" "off"} { foreach cmd {"next 2" "continue"} { - test_follow_fork $who $detach $cmd + test_follow_fork ${follow-fork-mode} ${detach-on-fork} $cmd } } } -- 2.33.0