From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qYUdD5sE72n/4z0AWB0awg (envelope-from ) for ; Mon, 27 Apr 2026 02:39:23 -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=ydjhphKa; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3A4A81E0BA; Mon, 27 Apr 2026 02:39:23 -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_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 6069A1E093 for ; Mon, 27 Apr 2026 02:39:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id E21A14B99F58 for ; Mon, 27 Apr 2026 06:39:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E21A14B99F58 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=ydjhphKa Received: from mail-dl1-x1235.google.com (mail-dl1-x1235.google.com [IPv6:2607:f8b0:4864:20::1235]) by sourceware.org (Postfix) with ESMTPS id 206E44BAE7E2 for ; Mon, 27 Apr 2026 06:36:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 206E44BAE7E2 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 206E44BAE7E2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1235 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777271798; cv=none; b=wSG3HlUBloURZFeSAhIwgM6VMOP4eIWGoa3b7VGRtEh7fzZmrxA1jCU/sq8WqMzvPJW4+9c9vRiLLkFnguQPeRPiL3jHZXwfY+anSRWSyn9eYb/9NXf4ATe3ojjWkmLy9ui37SrTBUe3OinoS1lxGjZJWU071X7xKKAaninrCMA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777271798; c=relaxed/simple; bh=+kiPArurl0K1vY0Jb0emdz9OcRb9RWobCvwUFTpuh/Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AHnY/IaiFY1u5Uhl792r0WQQuv2LBwNBh+bEBFdZRHjZhYsyW9ruvPKic/fRgMJZLMjPfImQt67NulsDm8FpTYSGmehdy0dZqUffBVamxNe+6K/WTagWXBwh8HgILLSMtyT/G3T0l5x3FpTPjP7Pkk62KEeSxollgCt7f/jYJm0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 206E44BAE7E2 Received: by mail-dl1-x1235.google.com with SMTP id a92af1059eb24-12c45281a06so12774121c88.1 for ; Sun, 26 Apr 2026 23:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777271797; x=1777876597; 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=g7UZowa+XDyg0PDdfZ5becPJ2TY2jfQHwNXj4eeLj9I=; b=ydjhphKalfQWmO1txdL6dXH+OfMtKIKE6zdcgPJlVi0A0uZySSaIjKkIuIJzqGDbkK FrrRFLk5Mc5Icy5y2GopjQt9xBBWx7gMsD82JHuryB0A7o8hXPhvZL3sjEukUAmBnfNS ionDaJe8MRUfkonySEhKPVPWQ9/zePFZPpRRShnSb4nmv403bh1of+6vHHuvK45EZsbR U+3dgYaUncKYnakw7ynKcyTCq6uyWJU/rwClLjUSxL7w0G8olKwHL87LUqgPt+WEn9zj OL0JqvmWJAGvE12VmQuScTBA3sghjo/NUIWwiSdvJeEuAmR5Oh2UlFd0FjO/GVOwCvKp FNvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777271797; x=1777876597; 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=g7UZowa+XDyg0PDdfZ5becPJ2TY2jfQHwNXj4eeLj9I=; b=P6o97qLJ2g+P31Sh7NU4KIEX4Fe7WKBNBDbnrUSD3ocWRLv0WcBnb8ncI69ysoZvYV vRFiYh6ArEaLLmacN2l6d6I9ZmCjeMRhKf3LAP4pIsiR8OPX2GhNKtiZs680BTVkhZy3 gvk7XkHulM4vRyd+CnQxdy8eRwBG/0vKBTx5ZxLusV6l8yOt2wJ2BpWnKaULK2i0A30J /zdkCobrPdjooydRInI/4hl2htLzsmtjJY9soT4Qa8TMO5/+ptkTKWZkODDaTMCmNMn4 0dS+Kmce822973Dv4un2ydpRP7IPLFKFRkHV5c1C6t55+T5BRzlvnGKNDW7Jkh91O92o oDYA== X-Gm-Message-State: AOJu0YyVDQVij0DYw+YrHV6RftiltO0TlV87jXfPxT1h4WHR+5SaVqwu C2mlz8We3CXG7w9INxbFt3+n+kmOby0JhPUcGZCLJ9Ybq1DkrrKgo0gL5zcsOYnIJB8rIa2a3Ja 4ufC4 X-Gm-Gg: AeBDieudfV/x5Te5As6XiDkII11REQNE6Cp/2sXhrnQtT3ZO8ic1JpwE3DAH/fBjmPW 0DWLMQ89mlJ3plB6RxHYIJwR8cxQ0nrTS+aIkUI7oP+Z3NdYpyPWgQh7MjlwSAUAdE//Ytqdd0K eISs2oxcqaZOoa8lQoGGmVVQKaXAY4i/pm+r8DM2+GWbC+suSYGQSZQzwTa0SO8UbD0K45w0PcN qIBpl1cyhQP5aN4yhLw8Y2OqhinqBwN6/t0lF2UATyPPibW4HxQ6iK0YtM7Ygs4g8CnpntI98jc FCm+svxQSY47IshZaq8+/D1BTFcMqxqhTCV6XT8ilns5emyCsq/Hl2hZJM05eTWz7jk1mfKDPkS n36EMZ3uriZ1o3ITnH3nwRovGEbky5pM0VzngugO3Anrq6KQx+qeED1n5U8sw3B+/Ct0QKybPpT hgbD73PPDvjCOFj4XLltOm4s1+MEgWAoTYzykQf4uIHI3e X-Received: by 2002:a05:7022:baa:b0:128:d20a:2f40 with SMTP id a92af1059eb24-12c73f759b8mr20540375c88.8.1777271796783; Sun, 26 Apr 2026 23:36:36 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:33bc:f32e:9aa5:b915]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12c74a20eb5sm55716463c88.14.2026.04.26.23.36.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 23:36:36 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH 24/36] GDB: testsuite: linespec: Don't return -1 from top-level Date: Mon, 27 Apr 2026 03:34:48 -0300 Message-ID: <20260427063500.3847618-25-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org> References: <20260427063500.3847618-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 Most changes are the result of running: $ sed -i 's/^ return -1/ return/' *.exp inside gdb/testsuite/gdb.linespec. The exceptions fall into one of these criteria: - misaligned line, which is then fixed by this patch; - return at top level but inside a namespace block; - procedure whose callers don't use the return value. --- gdb/testsuite/gdb.linespec/break-ask.exp | 2 +- gdb/testsuite/gdb.linespec/break-asm-file.exp | 8 ++++---- gdb/testsuite/gdb.linespec/cp-completion-aliases.exp | 2 +- .../gdb.linespec/cp-replace-typedefs-ns-template.exp | 2 +- gdb/testsuite/gdb.linespec/cpcompletion.exp | 4 ++-- gdb/testsuite/gdb.linespec/cpexplicit.exp | 4 ++-- gdb/testsuite/gdb.linespec/cpls-abi-tag.exp | 4 ++-- gdb/testsuite/gdb.linespec/cpls-ops.exp | 4 ++-- gdb/testsuite/gdb.linespec/errors.exp | 2 +- gdb/testsuite/gdb.linespec/explicit.exp | 4 ++-- gdb/testsuite/gdb.linespec/keywords.exp | 4 ++-- gdb/testsuite/gdb.linespec/linespec.exp | 2 +- gdb/testsuite/gdb.linespec/ls-dollar.exp | 2 +- gdb/testsuite/gdb.linespec/ls-errs.exp | 6 +++--- gdb/testsuite/gdb.linespec/macro-relative.exp | 2 +- gdb/testsuite/gdb.linespec/skip-two.exp | 6 +++--- gdb/testsuite/gdb.linespec/thread.exp | 4 ++-- 17 files changed, 31 insertions(+), 31 deletions(-) diff --git a/gdb/testsuite/gdb.linespec/break-ask.exp b/gdb/testsuite/gdb.linespec/break-ask.exp index ed91d7defb15..90d5044765e4 100644 --- a/gdb/testsuite/gdb.linespec/break-ask.exp +++ b/gdb/testsuite/gdb.linespec/break-ask.exp @@ -42,7 +42,7 @@ with_cwd $srcdir/${subdir}/base/two { if { [gdb_compile "$srcdir/${subdir}/$srcfile $objfile1 $objfile2" \ $binfile executable $opts] != "" } { - return -1 + return } clean_restart ${testfile} diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.exp b/gdb/testsuite/gdb.linespec/break-asm-file.exp index b8dadc15c4ca..c6ae8dea7be9 100644 --- a/gdb/testsuite/gdb.linespec/break-asm-file.exp +++ b/gdb/testsuite/gdb.linespec/break-asm-file.exp @@ -28,22 +28,22 @@ require dwarf2_support if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \ object {debug nowarnings optimize=-O0}] != ""} { - return -1 + return } # Compile .s files without debug information. if {[gdb_compile ${srcdir}/${subdir}/$asm_file0 ${binfile}2.o \ object {nodebug}] != ""} { - return -1 + return } if {[gdb_compile ${srcdir}/${subdir}/$asm_file1 ${binfile}3.o \ object {nodebug}] != ""} { - return -1 + return } if {[gdb_compile [list ${binfile}1.o ${binfile}2.o ${binfile}3.o] \ "${binfile}" executable {}] != ""} { - return -1 + return } clean_restart $execfile diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp index fe7ae40c9a22..a3f99998840f 100644 --- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp +++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp @@ -21,7 +21,7 @@ load_lib completion-support.exp standard_testfile .cc if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { - return -1 + return } # Disable the completion limit for the whole testcase. diff --git a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp index b12f14da1543..c82410e29325 100644 --- a/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp +++ b/gdb/testsuite/gdb.linespec/cp-replace-typedefs-ns-template.exp @@ -23,7 +23,7 @@ standard_testfile .cc if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ {debug c++ additional_flags=-std=c++11}]} { - return -1 + return } # Disable the completion limit for the whole testcase. diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp index 14eb1a68c81a..96c7a968ed6c 100644 --- a/gdb/testsuite/gdb.linespec/cpcompletion.exp +++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp @@ -30,7 +30,7 @@ lappend flags debug if {[prepare_for_testing "failed to prepare" $testfile \ [list $srcfile $srcfile2 $srcfile3 $srcfile4] $opts]} { - return -1 + return } # Tests below are about tab-completion, which doesn't work if readline @@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } # diff --git a/gdb/testsuite/gdb.linespec/cpexplicit.exp b/gdb/testsuite/gdb.linespec/cpexplicit.exp index b5dbc6dceece..8c9de2aa8991 100644 --- a/gdb/testsuite/gdb.linespec/cpexplicit.exp +++ b/gdb/testsuite/gdb.linespec/cpexplicit.exp @@ -22,7 +22,7 @@ set exefile $testfile if {[prepare_for_testing "failed to prepare" $exefile $srcfile \ {c++ debug nowarnings}]} { - return -1 + return } # Wrap this whole test in a namespace to avoid contaminating other tests. @@ -90,7 +90,7 @@ namespace eval $testfile { # Fire up gdb. if {![runto_main]} { namespace delete $testfile - return -1 + return } # Test explicit linespecs, with and without conditions. diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp index 6399f252d71d..80c8a3937e11 100644 --- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp +++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp @@ -31,7 +31,7 @@ if { [test_compiler_info gcc-*] } { if {[prepare_for_testing "failed to prepare" $testfile \ [list $srcfile] {c++ debug}]} { - return -1 + return } # Tests below are about tab-completion, which doesn't work if readline @@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } gdb_test_no_output "set max-completions unlimited" diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp index 4cef26e6767e..c49afaa9856c 100644 --- a/gdb/testsuite/gdb.linespec/cpls-ops.exp +++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp @@ -25,7 +25,7 @@ lappend flags c++ if {[prepare_for_testing "failed to prepare" $testfile \ [list $srcfile] $flags]} { - return -1 + return } # Tests below are about tab-completion, which doesn't work if readline @@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } gdb_test_no_output "set max-completions unlimited" diff --git a/gdb/testsuite/gdb.linespec/errors.exp b/gdb/testsuite/gdb.linespec/errors.exp index 8f60f0eca30b..8e69dd6fa058 100644 --- a/gdb/testsuite/gdb.linespec/errors.exp +++ b/gdb/testsuite/gdb.linespec/errors.exp @@ -19,7 +19,7 @@ # another one. if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} { - return -1 + return } # PR gdb/12843 diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp index faee27bab4a5..ccf74d3863d6 100644 --- a/gdb/testsuite/gdb.linespec/explicit.exp +++ b/gdb/testsuite/gdb.linespec/explicit.exp @@ -27,7 +27,7 @@ lappend opts additional_flags=-nostdlib if {[prepare_for_testing "failed to prepare" $exefile \ [list $srcfile $srcfile2 $srcfile3] $opts]} { - return -1 + return } # Wrap the entire test in a namespace to avoid contaminating other tests. @@ -98,7 +98,7 @@ namespace eval $testfile { # Fire up gdb. if {![runto_main]} { - return -1 + return } # Turn off queries diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp index 36069868f444..ae9380575cf6 100644 --- a/gdb/testsuite/gdb.linespec/keywords.exp +++ b/gdb/testsuite/gdb.linespec/keywords.exp @@ -19,11 +19,11 @@ standard_testfile set exefile $testfile if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} { - return -1 + return } if {![runto_main]} { - return 0 + return } # Turn off pending breakpoints to facilitate testing errors. diff --git a/gdb/testsuite/gdb.linespec/linespec.exp b/gdb/testsuite/gdb.linespec/linespec.exp index 0345fc5098ef..771dede9bb64 100644 --- a/gdb/testsuite/gdb.linespec/linespec.exp +++ b/gdb/testsuite/gdb.linespec/linespec.exp @@ -27,7 +27,7 @@ require allow_cplus_tests if {[prepare_for_testing "failed to prepare" $exefile \ [list $srcfile $baseone $basetwo] \ {debug nowarnings c++}]} { - return -1 + return } gdb_test_no_output "set multiple-symbols all" \ diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp index 584ea35447e4..a000c5b39695 100644 --- a/gdb/testsuite/gdb.linespec/ls-dollar.exp +++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp @@ -22,7 +22,7 @@ require allow_cplus_tests if {[prepare_for_testing "failed to prepare" $exefile $srcfile \ {debug nowarnings c++}]} { - return -1 + return } gdb_test_no_output "set listsize 1" diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp index 1bd6efd10fdf..418d67b82b6b 100644 --- a/gdb/testsuite/gdb.linespec/ls-errs.exp +++ b/gdb/testsuite/gdb.linespec/ls-errs.exp @@ -31,14 +31,14 @@ proc do_test {lang} { if {$lang == "C++"} { if {![allow_cplus_tests]} { - return 0 + return } # Build ".c" source file with g++. lappend options "c++" } if {[prepare_for_testing "failed to prepare" $exefile $srcfile $options]} { - return -1 + return } # Turn off the pending breakpoint queries. @@ -48,7 +48,7 @@ proc do_test {lang} { gdb_test_no_output "set max-completions unlimited" if {![runto_main]} { - return 0 + return } # Run to a location in the file. diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp index b0ac538be69d..99a6dac78921 100644 --- a/gdb/testsuite/gdb.linespec/macro-relative.exp +++ b/gdb/testsuite/gdb.linespec/macro-relative.exp @@ -42,7 +42,7 @@ clean_restart ${testfile} # "list header_two_func" does not set exactly the one line we want. if {![runto header_two_func]} { - return -1 + return } gdb_test "info macro HEADER" "\r\n#define HEADER 2" diff --git a/gdb/testsuite/gdb.linespec/skip-two.exp b/gdb/testsuite/gdb.linespec/skip-two.exp index 0a8af84441a3..3c5e438f1177 100644 --- a/gdb/testsuite/gdb.linespec/skip-two.exp +++ b/gdb/testsuite/gdb.linespec/skip-two.exp @@ -25,14 +25,14 @@ require allow_cplus_tests if {[prepare_for_testing "failed to prepare" $execfile \ [list $srcfile $baseone $basetwo] \ {debug nowarnings c++}]} { - return -1 + return } gdb_test "skip function dupname" \ {Function dupname will be skipped when stepping\.} if {![runto_main]} { - return -1 + return } set test "dupname ignored from main" @@ -64,7 +64,7 @@ gdb_test "skip file thefile.cc" \ {File thefile\.cc will be skipped when stepping\.} if {![runto_main]} { - return -1 + return } gdb_test "step" "static int dupname .*" "step into dupname" diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp index 30a21e8fe2fd..ab63fe52a1d9 100644 --- a/gdb/testsuite/gdb.linespec/thread.exp +++ b/gdb/testsuite/gdb.linespec/thread.exp @@ -20,11 +20,11 @@ standard_testfile set exefile $testfile if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug}]} { - return -1 + return } if {![runto_main]} { - return 0 + return } set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]