From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ETb+M2CP8mkiaAQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 19:08:16 -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=ep/m773x; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D02C51E0BA; Wed, 29 Apr 2026 19:08:16 -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 E96121E093 for ; Wed, 29 Apr 2026 19:08:15 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6EB404358A56 for ; Wed, 29 Apr 2026 23:08:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EB404358A56 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=ep/m773x Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by sourceware.org (Postfix) with ESMTPS id B78984358A58 for ; Wed, 29 Apr 2026 23:06:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B78984358A58 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 B78984358A58 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::930 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503967; cv=none; b=lol31xN7CflUwe+dxTGG6BCMKGZj1hWpl0pQ4aXqyZ2nJJ8n+xJFK0lL85xdTG3g2V8sMo6TjFIpXK53WlL2Dw+jl89JciCVjQMV69cRouru1kOk2Ng1WcyhsVRcaaHL+/XhIjElX8E7qI7fWv6rR1tq3sh3Uw+4sbsNs62wWCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503967; c=relaxed/simple; bh=jKtsUd/1gbV8iyhcwx/EeHc20yK03Ch1IP/A1hiz9LI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=A+5G6P/WxvBCWpfzBhaG5rGueX4xIupmofXViMa7LLcs9x9D/wCJgqPMmu8BcYYhCsfHOslWrGs1X4WRKZUgwPTMRAa0E7ItVHg87sUcYdPOKr5Wx/3zQessdWeQJeWXtoTtLeiGryJsZlpHcJp9tlFo3QP3ejjGIuVtBK60X8g= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B78984358A58 Received: by mail-ua1-x930.google.com with SMTP id a1e0cc1a2514c-9567aa1a047so130135241.0 for ; Wed, 29 Apr 2026 16:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777503967; x=1778108767; 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=Ps19zM6j01uTw904i5pLmJ1ctEMASGIP1j3zx4TYRLU=; b=ep/m773x8RByD7qDMDVUIIYSeV/I7e6nyFC8e4b97OVl6ZNQHSvJChPgSmxu+TUlt0 Lz38ihnbHRdkL2bt3W4DpwVoPuLXwOEPcyAvPW/8JGq5YWCIeOWUr+pPnf63yjHPEzWI pZIdmWcVpxIudVOFIIYaR/p/8LySaejxJ9BiN4GZFW+V6xJsSBpXQCqvuMs8dh876dO+ Wyk0j83jtEiuTFjPZKCPP81jaXT+bvcKnt4icIldnU2TCQne+4wFG0SWp4i1+gUPdkCg bfs7fOli9eD/y8p0EekJ4Aif3WVkdan6tPeCum0gjKulZt+StdhqadxMeyAoCr2zssdH YKyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777503967; x=1778108767; 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=Ps19zM6j01uTw904i5pLmJ1ctEMASGIP1j3zx4TYRLU=; b=UQgsPbknl6xn9r025R+ymUS75o6gkjdACu04/HhkGciFIOO4WeZgkugTQ8p2rGPDo5 3S0fIflg4jUOdpsvNhzTvI7EbWSgla1+7wPFJs7Q0pmo26sxOUAPLefMpy7uWnv/2oaT h10gCnHbuTAltYfT03f0wOkqvGABVuRnBhNHbSQ1XR1tHpmu+F8di7SM6rDTXRGhNcDp aE54VpANkd3/jnjx01sCBIbwfFhQllmkOJzb8gensu3QeNF+6Rr2LGV2TF9u/89sozgG fCOSfI91Se4IsaA9Cgucu6T/mwe/qIkEQgZ3P00fBQEHb9g0paFN3aPn22nZPFSb8MYd DFdg== X-Gm-Message-State: AOJu0YyF8au3CJ5Jh2JElaeTeOk3UeEyGHtSB3JTkdadjaZZ7QKKefGA mHYIZmpaQfN4WOzGUsPi3vJOSBqvXxlX86H+IBO9veBHB0dmbTVMyifeW9poourdQArZWyCKTqA Mzh8o X-Gm-Gg: AeBDievK5ln3DzSIEMR8jUFO+Re1rlga0y5kx+bsvqwW6/GbKNEDgmcIbLwHNY1uDK1 AxyJs9w6GuglPLygL5TVs26KJ9yh69ypgokEDHKXxBv9C8QM3YdD2eiOpoF2Kv0g/8Bg1D8RYMs vLONATvTtMl2pofZhEmDta+6Wun5Mosho6NjqFcnfGs9HXTdZGCNAl4K5UMHnZ+/Cxh1pXDk9Me Hs5rdzcxUkMj+RUIfqWvgf/YDiCSTjzl3XcHA3ub7UuXqoM7hZrz2hgxzRffnsx1rjoRY7hfp3T YxlXjHUKEtpmLSQRp2EP7fOCkElwiMA39AI/RhFUawHG1E7DN2KXE5s7S9+ocyNf9GJGHTDS8FU qNPSDcUkdF806YQyxOmkSXkxnE6h2ST62gi+ywZTW1RkQGoP+UZNGDdY/Infm8GJGrwLTFMfeSs FPv/FIcvi3yuli/74avZhA0nNl7efnACaVqCs1DzRrAfew X-Received: by 2002:a05:6102:441d:b0:5f5:4055:4558 with SMTP id ada2fe7eead31-62ad1529961mr296244137.2.1777503966955; Wed, 29 Apr 2026 16:06:06 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-95cb717d119sm1912227241.0.2026.04.29.16.06.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 16:06:06 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 25/37] GDB: testsuite: linespec: Don't return value from top-level Date: Wed, 29 Apr 2026 20:04:16 -0300 Message-ID: <20260429230432.60487-26-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 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. A couple of "return 0" statements were also fixed. --- 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/macro-relative.exp | 2 +- gdb/testsuite/gdb.linespec/skip-two.exp | 6 +++--- gdb/testsuite/gdb.linespec/thread.exp | 4 ++-- 16 files changed, 28 insertions(+), 28 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 @@ -40,11 +40,11 @@ with_cwd $srcdir/${subdir}/base/two { } } if { [gdb_compile "$srcdir/${subdir}/$srcfile $objfile1 $objfile2" \ $binfile executable $opts] != "" } { - return -1 + return } clean_restart ${testfile} gdb_test_no_output "set multiple-symbols ask" 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 @@ -26,26 +26,26 @@ set asm_file0 break-asm-file0.S # This test can only be run on targets which support DWARF-2 and use gas. 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 gdb_test "break a/$asm_file0:func" \ 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 @@ -19,11 +19,11 @@ 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. gdb_test_no_output "set max-completions unlimited" 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 @@ -21,11 +21,11 @@ load_lib completion-support.exp 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. gdb_test_no_output "set max-completions unlimited" 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 @@ -28,19 +28,19 @@ lappend opts additional_flags=-std=c++11 set flags {} 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 # library isn't used. Check it first. if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } # # Some convenience procedures for testing template parameter list # completion. 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 @@ -20,11 +20,11 @@ require allow_cplus_tests standard_testfile .cc 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. namespace eval $testfile { upvar #0 ::srcfile srcfile @@ -88,11 +88,11 @@ namespace eval $testfile { add linespecs "-function \"myclass::operator,\"" $location(operator) # Fire up gdb. if {![runto_main]} { namespace delete $testfile - return -1 + return } # Test explicit linespecs, with and without conditions. foreach linespec $linespecs(linespecs) loc_pattern $linespecs(locations) { # Test the linespec 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 @@ -29,19 +29,19 @@ if { [test_compiler_info gcc-*] } { require {expr {[gcc_major_version] >= 5}} } 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 # library isn't used. Check it first. if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } gdb_test_no_output "set max-completions unlimited" # Check that the explicit location completer manages to find the next 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 @@ -23,19 +23,19 @@ set flags {} lappend flags debug 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 # library isn't used. Check it first. if { ![readline_is_used] } { untested "no tab completion support without readline" - return -1 + return } gdb_test_no_output "set max-completions unlimited" # Check that the explicit location completer manages to find the next 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 @@ -17,11 +17,11 @@ # We don't currently need our own test case for testing, so grab # another one. if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} { - return -1 + return } # PR gdb/12843 gdb_test "list c:/foo/bar/baz.c:1" "No source file named c:/foo/bar/baz.c." gdb_test "list c:/foo/bar/baz.c" "Function \"c:/foo/bar/baz.c\" not defined." 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 @@ -25,11 +25,11 @@ lappend opts debug lappend opts nowarnings 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. namespace eval $testfile { upvar #0 ::srcfile srcfile @@ -96,11 +96,11 @@ namespace eval $testfile { add linespecs "-function myfunction -label top -line 3" $location(top) add linespecs "-line 25" $location(normal) # Fire up gdb. if {![runto_main]} { - return -1 + return } # Turn off queries gdb_test_no_output "set confirm off" 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 @@ -17,15 +17,15 @@ 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. gdb_test_no_output "set breakpoint pending off" 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 @@ -25,11 +25,11 @@ set basetwo base/two/thefile.cc 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" \ "set multiple-symbols to all for linespec tests" 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 @@ -20,11 +20,11 @@ set exefile $testfile 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" set line [gdb_get_line_number {dollar_func}] 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 @@ -40,9 +40,9 @@ clean_restart ${testfile} # Test macros respect DW_AT_comp_dir. # "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 @@ -23,18 +23,18 @@ set basetwo base/two/thefile.cc 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" gdb_test_multiple "step" $test { -re "^step\r\ndupname .*\r\n$gdb_prompt $" { @@ -62,11 +62,11 @@ gdb_test_no_output "skip delete 1" 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" gdb_test "finish" "return dupname.* body_elsewhere.*" "finish from 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 @@ -18,15 +18,15 @@ 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"] gdb_test "break $srcfile:$bp_location1" \