From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Kd8aLgqQ8mm9ZgQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 19:11:06 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zfaAF7Fb; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B53761E0BA; Wed, 29 Apr 2026 19:11:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7E10D1E093 for ; Wed, 29 Apr 2026 19:11:05 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 24F4F4358A46 for ; Wed, 29 Apr 2026 23:11:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24F4F4358A46 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zfaAF7Fb Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by sourceware.org (Postfix) with ESMTPS id 37C854358A52 for ; Wed, 29 Apr 2026 23:06:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37C854358A52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 37C854358A52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::a35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503999; cv=none; b=G3iJLoMxLeW3ZhTbxi+s32ToYbhu7tAhLqLeQPJznK8ZpJvmxndj9pfQ849w+0UzwbqJ9h/FojVXG8TjTMyPpNIgHx38+Mq72dJLhMRseNsW97/TfGgQHQmXpgea4iQCNK+vTmNZhUJ/sAc51MrS6RH2Ce0CeRK09H2jclPiO5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503999; c=relaxed/simple; bh=riQ56Rq6aaG1nQVsgXvY54nJX8BZGXQSFwmS3LablSg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ee40yxRlapGh9vWbXE/IHGb8ieJffrrOGOB4fK8SVMWtwzL3ITdMpZXpzmFE1+sD5nVgKPXM2XBBhjVsITqebbYfGlfhMyyHngDfG9u19DAbDzoNjJRBYOqqp/B0+sgvaK8HfHGwvq9RiNEh568r1oorx23eZOJeDL8zzR7fFLk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37C854358A52 Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-56a8e0ea02aso298798e0c.0 for ; Wed, 29 Apr 2026 16:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777503999; x=1778108799; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LA8CDzygVAcJL1hh0ii7ynHWCwAbhmjuCknU5nBMoAY=; b=zfaAF7Fb2yw1Nu44C3zcX9s6hwjmoiRbbL5V5V6YnYsgjSwfrW+VQTdm7zuj+k1GD6 bDiX/bv+kfY7sGQJHm60SVg5IW4O0zC/SimQ3SPze6y9XfNpxpw8cgofLt04KlLEy5HS tPVCPJag+dLloGqTeYAuk6DBZ4+ITQy/y6gYIlEuwq+zPAPgSL8CkoiV6/0XRHAzEwK9 UsR/b9y/u4ARol7mMZVcana/QgswDsKAjNQdYFwST1szKetkYjqPNlmvEw91edoc3+KW kv1RB+tGo1ePVyyypEbB2v0pDJ/ZUULVv4kmDwUNLtuxrPGBMNESb+t3lDjfFdlKcXod Fx5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777503999; x=1778108799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=LA8CDzygVAcJL1hh0ii7ynHWCwAbhmjuCknU5nBMoAY=; b=WfdYDqdcaw9J95PkC25wfN4i1wRByH6tuMWPZm4FFIxllTi07JFWOVugiWS7KlmO2g oEN1swA+V1F1bWtyO9cLZcv1U0Y4BUE4vFRLQbUwWE+jnr05nTZ7go8NJBEPR0LW9uT5 +B3ChKCcvVnMuFcBhYYGpRuc5J5X7Z3sQuKS22Y89RtC8Cp412CzdmzN1uNo4pihyW9K UOtYcLiHA5fvdg/y6xBaHxc2N0dopFG/39zG5ZIpSOo5RQNpSfC/ySyP60RDsNarTeiX 9fh/jTt77E0h3Sd+gwYdzaklUX/Ja1Hd3h6pa0vJ3K7kDqrAGSfQOs2sRgJsbUbAJ3R6 jQbg== X-Gm-Message-State: AOJu0YxymC2v/u+5Sp0m2pngdSEq+lHSzyu6XtWmubYVLyJ2902Ap9e5 vwhh8GWSLeb05hhF0I1zwrhZOYVIlXp5UGrhChWYegUYpc2Ep6DvpmaaTuw6F0FGVaeZRj8xrIb ui8HH X-Gm-Gg: AeBDietgqpeCYHt/X/EHcclaXVBTXd/WKsnLBr4rnVNfiMJlnTsKpjmEvxc6xTzadId XeTx/slnHKKSxIquFp223PEUVNiBmvNuAld/YqP+ZcglZUIJYhR2fenw70X71cYZW4ePumqQsg2 yDe9o9oX34OBB3d30P31e+7+7Bs4B5waAYOq19fa7uXq4Y7rnc91Fxt5hm2aFfBd0M/UNYIojGJ LFn/uV2OovZDOCLXbHoeoEgZrwp3/fmBuKui30qJTW8b9eO+O56ap/WAzx7XJwf2XjCO7MV3UO+ R1Bc5upHLgW2TD8HzSs0dg8k6Lee8F1O6AzuZv1yg6yhdAq9LjBm8rWHqYVck0izJicNt+S/uKX C6tZ2MZH8CaC5NcD82zaFQhLPLB6pJWesq1WkuA0A3bmdy1yOjtvGoIHLHJuYsE8ZHFVFeMD2Rw shNTCpwsqsKXOGN7hRTysZThdETNu6t1st1IxR5NF+wERz5kS1nP08jdk= X-Received: by 2002:a05:6122:f06:b0:56c:d6f1:d742 with SMTP id 71dfb90a1353d-573c95f0f37mr115993e0c.8.1777503998564; Wed, 29 Apr 2026 16:06:38 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-573b6dfa5b4sm2001167e0c.16.2026.04.29.16.06.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 16:06:38 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 34/37] GDB: testsuite: threads: Don't return value from top-level (manual) Date: Wed, 29 Apr 2026 20:04:25 -0300 Message-ID: <20260429230432.60487-35-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org> References: <20260429230432.60487-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This patch manually changes "return -1" statements that weren't caught by the sed command. These return statements fall into one of these criteria: - misaligned line, which is then fixed by this patch; - return at top level but inside block such as for loops, with_test_prefix, foreach_with_prefix, gdb_test_multiple. I also fixed a couple cases of "return 0" from top-level that also weren't caught by sed, and even a couple cases of "return 1" from top-level. --- gdb/testsuite/gdb.threads/attach-slow-waitpid.exp | 4 ++-- gdb/testsuite/gdb.threads/corethreads.exp | 4 ++-- gdb/testsuite/gdb.threads/create-fail.exp | 2 +- gdb/testsuite/gdb.threads/gcore-stale-thread.exp | 2 +- gdb/testsuite/gdb.threads/gcore-thread.exp | 4 ++-- gdb/testsuite/gdb.threads/linux-dp.exp | 2 +- gdb/testsuite/gdb.threads/multiple-successive-infcall.exp | 6 +++--- gdb/testsuite/gdb.threads/omp-par-scope.exp | 2 +- gdb/testsuite/gdb.threads/omp-task.exp | 2 +- gdb/testsuite/gdb.threads/siginfo-threads.exp | 2 +- gdb/testsuite/gdb.threads/staticthreads.exp | 4 ++-- gdb/testsuite/gdb.threads/stepi-over-clone.exp | 2 +- gdb/testsuite/gdb.threads/thread-specific.exp | 4 ++-- gdb/testsuite/gdb.threads/thread_check.exp | 2 +- gdb/testsuite/gdb.threads/tls.exp | 4 ++-- gdb/testsuite/gdb.threads/watchthreads-reorder.exp | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp index 343a96bc5112..de5a901f0b1f 100644 --- a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp +++ b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp @@ -51,20 +51,20 @@ set libobj [standard_output_file ${libfile}.so] with_test_prefix "compile preload library" { # Compile the preload library. We only get away with this as we # limit this test to running when ISNATIVE is true. if { [gdb_compile_shlib_pthreads \ $libsrc $libobj {debug}] != "" } then { - return -1 + return } } with_test_prefix "compile test executable" { # Compile the test program if { [gdb_compile_pthreads \ "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ executable {debug}] != "" } { - return -1 + return } } # Spawn GDB with LIB preloaded with LD_PRELOAD. diff --git a/gdb/testsuite/gdb.threads/corethreads.exp b/gdb/testsuite/gdb.threads/corethreads.exp index 4e520c5e8f22..2ea879623368 100644 --- a/gdb/testsuite/gdb.threads/corethreads.exp +++ b/gdb/testsuite/gdb.threads/corethreads.exp @@ -21,12 +21,12 @@ if {![istarget "*-*-linux*"]} { } standard_testfile set executable ${testfile} if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested "failed to compile" - return -1 + untested "failed to compile" + return } set corefile [core_find $binfile] if {$corefile == ""} { untested "unable to create or find corefile" diff --git a/gdb/testsuite/gdb.threads/create-fail.exp b/gdb/testsuite/gdb.threads/create-fail.exp index c77ccab17ae2..bb7c341a5b5b 100644 --- a/gdb/testsuite/gdb.threads/create-fail.exp +++ b/gdb/testsuite/gdb.threads/create-fail.exp @@ -32,11 +32,11 @@ for {set i 1} {$i <= $iterations} {incr i} { with_test_prefix "iteration $i" { clean_restart ${executable} if {![runto_main]} { - return -1 + return } set test "run till end" gdb_test_multiple "continue" "$test" { -re "exited with code 01.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.threads/gcore-stale-thread.exp b/gdb/testsuite/gdb.threads/gcore-stale-thread.exp index 9faa2686c767..d0465c87a4ad 100644 --- a/gdb/testsuite/gdb.threads/gcore-stale-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-stale-thread.exp @@ -32,11 +32,11 @@ gdb_test_multiple "info threads" "threads are supported" { -re ".* main .*\r\n$gdb_prompt $" { # OK, threads are supported. } -re "\r\n$gdb_prompt $" { unsupported "gdb does not support threads on this target" - return -1 + return } } gdb_breakpoint ${srcfile}:[gdb_get_line_number "break-here"] # gdb_continue_to_breakpoint does not work as it uses "$gdb_prompt $" regex diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index c3b8c56dd4b9..1d0150da6745 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -63,11 +63,11 @@ gdb_test_multiple "info threads" "threads are supported" { -re ".* main .*$gdb_prompt $" { # OK, threads are supported. } -re "${nl}$gdb_prompt $" { unsupported "gdb does not support threads on this target" - return -1 + return } } # Make sure thread 1 is running delete_breakpoints @@ -81,11 +81,11 @@ gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running" # Drop corefile set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"] if {!$core_supported} { - return -1 + return } # Test the uninitialized thread list. # Provide the case of glibc td_thr_get_info handling of: diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp index 42773f2293b5..f573964ea6a4 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.exp +++ b/gdb/testsuite/gdb.threads/linux-dp.exp @@ -97,11 +97,11 @@ for {set i 0} {$i < 5} {incr i} { -re " received signal.*(Unknown signal|SIGUSR|Real-time event).*$gdb_prompt $" { # It would be nice if we could catch the message that GDB prints # when it first notices that the thread library doesn't support # debugging, or if we could explicitly ask GDB somehow. unsupported "this GDB does not support threads on this system." - return -1 + return } -re "$gdb_prompt $" { } } if { $threads_created == 1 } { diff --git a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp index 8d438673cf07..fdcbaa47c7f4 100644 --- a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp +++ b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp @@ -17,18 +17,18 @@ # multiple inferiors, one after the other. standard_testfile if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ - executable {debug additional_flags=-std=gnu99}] != "" } { - return -1 + executable {debug additional_flags=-std=gnu99}] != "" } { + return } clean_restart "${::testfile}" if {![runto_main]} { - return 0 + return } # Ensure that each new thread is detected by GDB in the order that the # test case creates them, so the thread identifiers match between # test and test case. diff --git a/gdb/testsuite/gdb.threads/omp-par-scope.exp b/gdb/testsuite/gdb.threads/omp-par-scope.exp index b561bf2f4a5b..7d706078b2c4 100644 --- a/gdb/testsuite/gdb.threads/omp-par-scope.exp +++ b/gdb/testsuite/gdb.threads/omp-par-scope.exp @@ -54,11 +54,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} { # is optional and will only be called if it's defined. if {[info procs gdb_openmp_setup] != ""} { if {[gdb_openmp_setup $binfile] != ""} { untested "could not set up OpenMP environment" - return -1 + return } } if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.threads/omp-task.exp b/gdb/testsuite/gdb.threads/omp-task.exp index 636bcf989159..a7f39933d744 100644 --- a/gdb/testsuite/gdb.threads/omp-task.exp +++ b/gdb/testsuite/gdb.threads/omp-task.exp @@ -28,11 +28,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} { } if {[info procs gdb_openmp_setup] != ""} { if {[gdb_openmp_setup $binfile] != ""} { untested "could not set up OpenMP environment" - return -1 + return } } if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.threads/siginfo-threads.exp b/gdb/testsuite/gdb.threads/siginfo-threads.exp index acf1185cdfc5..6b095ac968ad 100644 --- a/gdb/testsuite/gdb.threads/siginfo-threads.exp +++ b/gdb/testsuite/gdb.threads/siginfo-threads.exp @@ -60,11 +60,11 @@ for {set sigcount 0} {$sigcount < 4} {incr sigcount} { set sigusr $expect_out(1,string) pass $test } } if {$sigusr == ""} { - return -1 + return } set test "signal $sigcount si_signo" if {$sigusr == 1} { set signo 10 diff --git a/gdb/testsuite/gdb.threads/staticthreads.exp b/gdb/testsuite/gdb.threads/staticthreads.exp index bc36d87f7d70..b25c0ae4e3b9 100644 --- a/gdb/testsuite/gdb.threads/staticthreads.exp +++ b/gdb/testsuite/gdb.threads/staticthreads.exp @@ -28,11 +28,11 @@ foreach_with_prefix have_tls { "-DHAVE_TLS" "" } { [list debug "additional_flags=${static_flag} ${have_tls}" \ ]] == "" } { break } if { $have_tls == "" } { - return -1 + return } } clean_restart ${::testfile} gdb_test_no_output "set print sevenbit-strings" @@ -97,11 +97,11 @@ gdb_test_multiple "quit" "$test" { clean_restart ${::testfile} if { "$have_tls" != "" } { if {![runto_main]} { - return -1 + return } gdb_breakpoint [gdb_get_line_number "tlsvar-is-set"] gdb_continue_to_breakpoint "tlsvar-is-set" ".* tlsvar-is-set .*" gdb_test "p tlsvar" " = 2" "tlsvar in thread" gdb_test "thread 1" ".*" diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp index f59c6275c5d4..673d77f0028b 100644 --- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp @@ -83,11 +83,11 @@ gdb_test_multiple "disassemble" "" { exp_continue } -re "^End of assembler dump\\.\r\n$gdb_prompt $" { if { [llength $syscall_addrs] == 0 } { unsupported "no syscalls found" - return -1 + return } } } # The test proc. NON_STOP and DISPLACED are either 'on' or 'off', and are diff --git a/gdb/testsuite/gdb.threads/thread-specific.exp b/gdb/testsuite/gdb.threads/thread-specific.exp index 79932ab9dc17..a5191122b0f8 100644 --- a/gdb/testsuite/gdb.threads/thread-specific.exp +++ b/gdb/testsuite/gdb.threads/thread-specific.exp @@ -79,12 +79,12 @@ gdb_continue_to_breakpoint "all threads started" set line [gdb_get_line_number "thread-specific.exp: thread loop"] set threads [get_thread_list] if {[llength $threads] == 0} { - # We have already issued a FAIL above. - return 1 + # We have already issued a FAIL above. + return } gdb_test {print $_thread} ".* = [lindex $threads 0]" "thread var in main" gdb_test {print $_gthread} ".* = [lindex $threads 0]" "gthread var in main" diff --git a/gdb/testsuite/gdb.threads/thread_check.exp b/gdb/testsuite/gdb.threads/thread_check.exp index e48e3d5b3c37..013fd253e9f9 100644 --- a/gdb/testsuite/gdb.threads/thread_check.exp +++ b/gdb/testsuite/gdb.threads/thread_check.exp @@ -40,11 +40,11 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab clean_restart ${::testfile} if {![runto_main]} { - return 1 + return } # # set breakpoint at thread function tf diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp index bf48a6f9fc9e..96e41eed411f 100644 --- a/gdb/testsuite/gdb.threads/tls.exp +++ b/gdb/testsuite/gdb.threads/tls.exp @@ -163,11 +163,11 @@ gdb_test_multiple "print a_thread_local" "" { pass $gdb_test_name } } if {![runto_main]} { - return 0 + return } # Set a breakpoint at the "spin" routine to # test the thread local's value. # @@ -188,11 +188,11 @@ send_gdb "continue\n" gdb_expect { -re ".* received signal SIGSEGV.*a_thread_local = 0;.*$gdb_prompt $" { # This is the first symptom if the gcc and binutils versions # in use support TLS, but the system glibc does not. unsupported "continue to first thread: system does not support TLS" - return -1 + return } -re ".*$inferior_exited_re normally.*$gdb_prompt $" { fail "continue to first thread: program runaway" } -re ".*Pass 0 done.*Pass 1 done.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp index f56661d7a5c2..192996b51ca9 100644 --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp @@ -40,11 +40,11 @@ foreach reorder {0 1} { with_test_prefix "reorder$reorder" { clean_restart $testfile gdb_test "set can-use-hw-watchpoints 1" if {![runto_main]} { - return -1 + return } # Use "rwatch" as "watch" would report the watchpoint changed just based on its # read memory value during a stop by unrelated event. We are interested in not # losing the hardware watchpoint trigger.