From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cQToB4aP8mnTZgQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 19:08:54 -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=NFvj7vEs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1C4D21E093; Wed, 29 Apr 2026 19:08:54 -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 892141E093 for ; Wed, 29 Apr 2026 19:08:52 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 23B8E4358A40 for ; Wed, 29 Apr 2026 23:08:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23B8E4358A40 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=NFvj7vEs Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by sourceware.org (Postfix) with ESMTPS id CFB624B920E5 for ; Wed, 29 Apr 2026 23:06:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CFB624B920E5 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 CFB624B920E5 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::a33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503963; cv=none; b=jzjosbbjNv3pKZNrKnUbBGqUnaHAYirWy+AselpEh88H0B7CULQAtGNJQdx9Q7cuzifZA6YDllaYc+EIobqVcznRzonsmz39F9tgZ1e9lry90Eiq+G3GZ6QEmYgH/QE2/VjfR8NsMjblNjlikyLdEp0Hqs/ojLKnC8vSFHlxvWM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503963; c=relaxed/simple; bh=P1x2TOIV5B5x7pP6+yUeuhQhJagbe/VYcWVU4RFBxvI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=f74zfe9KAX7tGJ9SNK9LuwhvohKul5qR4HV3XZRKFoPFDaA/OP8rx3hYk8blikUozEdRuBIlEcsTnzfxJfzAnnlfxkCPUFnWP2152QzvuhFyaUhqcP2lTvN5HExBr42XOHKmAXRJ8Dfl/R4g0Ci0ouTC/7mAlgO5hr0WNtNnAYA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFB624B920E5 Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-56faf1cfe04so99049e0c.3 for ; Wed, 29 Apr 2026 16:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777503963; x=1778108763; 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=LPb2DRzhdJcSv5EYjn3uPdQngzUU0hhIF/zv09mK2YE=; b=NFvj7vEs1lSHlKzDyD+EGVQGsqI0fj9Fi6e73k+JnbOHkDnK1qeNvLK1Tx2AErAlkm LJw05boi6SDI2FgSlrp4jQ850c+qSlg1Dwuk7LvjVAQcSlv8RLeW3JpMg0uBH68UMfiI bOdpxE9cAUQT46WVVqPlYjDjMJNbkCZsw+CthsThlpzCun2CQ+a7XEFU21l93x/TUBRw EDQ0KYoS1GE2zNn47jknH8IdYxSU8YLDk5CCkeYbDe+pkMks6FakHON4dp4zHC3Toyp+ CDJD92vTMSBbGjqj0eulsA38PVfVEmQ2VdWEzrc1Zvusf8L8RA/RSiT6Uh9ByQ9+PCbw l9bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777503963; x=1778108763; 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=LPb2DRzhdJcSv5EYjn3uPdQngzUU0hhIF/zv09mK2YE=; b=AsN59bvfv6q1nbFfAXqTgWtF0NdAclY8etcM3HWZ5Ch67JVrFLhuAeSYmrb4kKbNI5 Toc7TI81wahWU0fy6sGAEX5i8pdX+qf22/oCKVJVaAQex/+0FMpntTIfI5w9pFCMyXHr uairugcNeXU/1DonSwneiOn1Ae+oTQt//Ds7kurOdOxSJEhosb29G9utR3HiSp2rQg64 H0yhladbxwQeSonOaNaEYwtITeMz4Qnhh9fofInXs3mYXqfHwKEmuOoXOf5Mku+OAhHw cl50AUaOyqYhUSv4tQ4DJA41ABnVFu3IiBYw4ECXnAyab8aepgtncb7Pkm4yErqH9s7F 9DkA== X-Gm-Message-State: AOJu0YxBynze29p82SRTGBFvHFMANP1CPBQqVCRHDzwRT0Iv1l3Bnwxj W331ZR7OnxhBJy1ePKALhUYDog4iApG4LXlGi4AA9iQag17756ixOjwQ+HVmvG5oR3SI/YWNIyo gT9/s X-Gm-Gg: AeBDieuY6UCzMRJwyVX6xtuAAoybZsUwpBQzDSmTc2xsWMsJuJqVnEJ2rAHcrWBrtAi tN1YicbIkqv1Z9CyLlABGA42VAD+oFR79KfPUuSyKXJcdoHju5vduZOLR5aheCN2zEnD8+G5IyN JQRKDWeyESK5YJJNqHo9etAOodg1uHqLwe7EuiqH92JgrMMfcXXjcKDDgYkHr8dRAvrcB8x+eOB UbnkGM2apiY8JC30iZ74vYBL4iTfj7MiJXuamkW11qsdrcIax3ghIlipNv7ruC+1QmFQoku/wj6 zmU3I0RPVq8ogb3EtkFxf0E0T1lFpBIJHthR+LpltVN5AfO+jwA5l67RyStHZ+Hi3YJk+TzpQ2/ FQTZHyqB+BfaEHisxDfM4KhgI29qOcKdeJsfyBKHL2BxYBW+Mr9m7AqW2yZXnDv+OyfylaBFvvY bHp45MjeR4YXrlpoPRDKVGYm7+lYfGANaHVX63LBW0cYRb X-Received: by 2002:a05:6122:289b:b0:56f:7300:37c9 with SMTP id 71dfb90a1353d-573c96cd014mr99415e0c.10.1777503962893; Wed, 29 Apr 2026 16:06:02 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-95cb7765a76sm1894987241.10.2026.04.29.16.06.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 16:06:02 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 24/37] GDB: testsuite: Python: Don't return value from top-level (manual) Date: Wed, 29 Apr 2026 20:04:15 -0300 Message-ID: <20260429230432.60487-25-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" and "return 0" 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 save_vars, with_test_prefix, foreach, gdb_test_multiple. In a couple of cases the whole if block was in a single line: if { condition } { return -1 } In those cases the formatting was changed to the multi-line style we tend to use. --- gdb/testsuite/gdb.python/py-arch-reg-groups.exp | 2 +- gdb/testsuite/gdb.python/py-arch-reg-names.exp | 2 +- gdb/testsuite/gdb.python/py-arch.exp | 2 +- .../gdb.python/py-auto-load-chaining.exp | 10 +++++----- gdb/testsuite/gdb.python/py-disasm.exp.tcl | 6 +++--- gdb/testsuite/gdb.python/py-events.exp | 2 +- gdb/testsuite/gdb.python/py-explore-cc.exp | 2 +- gdb/testsuite/gdb.python/py-explore.exp | 2 +- .../gdb.python/py-finish-breakpoint.exp | 16 ++++++++-------- gdb/testsuite/gdb.python/py-format-address.exp | 4 ++-- gdb/testsuite/gdb.python/py-framefilter-addr.exp | 2 +- .../gdb.python/py-label-symbol-value.exp | 2 +- gdb/testsuite/gdb.python/py-linetable-empty.exp | 2 +- gdb/testsuite/gdb.python/py-pp-registration.exp | 6 +++--- gdb/testsuite/gdb.python/py-prompt.exp | 2 +- gdb/testsuite/gdb.python/py-read-memory-leak.exp | 2 +- gdb/testsuite/gdb.python/py-record-btrace.exp | 4 +++- gdb/testsuite/gdb.python/py-record-full.exp | 4 +++- .../gdb.python/py-rvalue-ref-value-cc.exp | 2 +- gdb/testsuite/gdb.python/py-value-cc.exp | 2 +- gdb/testsuite/gdb.python/py-value.exp | 2 +- gdb/testsuite/gdb.python/py-xmethods.exp | 2 +- gdb/testsuite/gdb.python/python.exp | 2 +- 23 files changed, 43 insertions(+), 39 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-arch-reg-groups.exp b/gdb/testsuite/gdb.python/py-arch-reg-groups.exp index 6630143f0373..7a1025841f46 100644 --- a/gdb/testsuite/gdb.python/py-arch-reg-groups.exp +++ b/gdb/testsuite/gdb.python/py-arch-reg-groups.exp @@ -22,11 +22,11 @@ standard_testfile py-arch.c if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } # First, use 'maint print reggroups' to get a list of all register # groups. set groups {} diff --git a/gdb/testsuite/gdb.python/py-arch-reg-names.exp b/gdb/testsuite/gdb.python/py-arch-reg-names.exp index 7bbb171e13e1..6807098fbda8 100644 --- a/gdb/testsuite/gdb.python/py-arch-reg-names.exp +++ b/gdb/testsuite/gdb.python/py-arch-reg-names.exp @@ -22,11 +22,11 @@ standard_testfile py-arch.c if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } # First, use 'info registers' to get a list of register names. set regs {} gdb_test_multiple "info registers general" "info registers general" { diff --git a/gdb/testsuite/gdb.python/py-arch.exp b/gdb/testsuite/gdb.python/py-arch.exp index a2ac6ad4bfa1..b1dd81a05839 100644 --- a/gdb/testsuite/gdb.python/py-arch.exp +++ b/gdb/testsuite/gdb.python/py-arch.exp @@ -19,11 +19,11 @@ standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } # Test python/15461. Invalid architectures should not trigger an # internal GDB assert. gdb_py_test_silent_cmd "python empty = gdb.Architecture()" "get empty arch" 0 diff --git a/gdb/testsuite/gdb.python/py-auto-load-chaining.exp b/gdb/testsuite/gdb.python/py-auto-load-chaining.exp index 7a92ff0fac71..bd0d1c4b11ef 100644 --- a/gdb/testsuite/gdb.python/py-auto-load-chaining.exp +++ b/gdb/testsuite/gdb.python/py-auto-load-chaining.exp @@ -27,17 +27,17 @@ standard_testfile .c -f1.c -f2.c set f1_o [standard_output_file ${gdb_test_file_name}-f1.o] set f2_o [standard_output_file ${gdb_test_file_name}-f2.o] # Now build the object files. if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" ${f1_o} object {}] != ""} { - untested "failed to compile object file f1.o" - return -1 + untested "failed to compile object file f1.o" + return } if {[gdb_compile "${srcdir}/${subdir}/${srcfile3}" ${f2_o} object {}] != ""} { - untested "failed to compile object file f2.o" - return -1 + untested "failed to compile object file f2.o" + return } # Copy the two Python scripts to where the tests are being run. set remote_python_file [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}-f1.o-gdb.py] @@ -48,11 +48,11 @@ set remote_python_file [gdb_remote_download host \ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { return } if {![runto_main]} { - return -1 + return } set safe_path [standard_output_file ""] gdb_test_no_output "set auto-load safe-path ${safe_path}" \ "set auto-load safe-path" diff --git a/gdb/testsuite/gdb.python/py-disasm.exp.tcl b/gdb/testsuite/gdb.python/py-disasm.exp.tcl index e4391fa59ced..6382005eee52 100644 --- a/gdb/testsuite/gdb.python/py-disasm.exp.tcl +++ b/gdb/testsuite/gdb.python/py-disasm.exp.tcl @@ -28,24 +28,24 @@ if { $kind == "obj" } { set binfile [standard_output_file $testfile] if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile object \ "debug"] != "" } { untested "failed to compile object file $testfile" - return -1 + return } clean_restart $testfile } else { if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { - return -1 + return } if { ![runto_main] } { fail "can't run to main" - return 0 + return } } set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-disasm.py] diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp index 1177dd54e482..16a290c31c29 100644 --- a/gdb/testsuite/gdb.python/py-events.exp +++ b/gdb/testsuite/gdb.python/py-events.exp @@ -313,11 +313,11 @@ with_test_prefix "gdb exiting: normal" { with_test_prefix "gdb exiting: error" { clean_restart ${testfile} if {![runto_main]} { fail "cannot run to main." - return 0 + return } gdb_test_no_output "source ${pyfile}" "load python file" gdb_test "test-exiting-event error" "GDB exiting event registered\\." gdb_test "test-events" "Event testers registered\\." diff --git a/gdb/testsuite/gdb.python/py-explore-cc.exp b/gdb/testsuite/gdb.python/py-explore-cc.exp index 772886b931f9..70b1beeada0a 100644 --- a/gdb/testsuite/gdb.python/py-explore-cc.exp +++ b/gdb/testsuite/gdb.python/py-explore-cc.exp @@ -35,11 +35,11 @@ set B_desc "'B' is a struct/class with the following fields:.*\ A = .*\ i = .*\ c = .*" if {![runto_main]} { - return -1 + return } gdb_breakpoint [gdb_get_line_number "Break here."] gdb_continue_to_breakpoint "Break here" ".*Break here.*" diff --git a/gdb/testsuite/gdb.python/py-explore.exp b/gdb/testsuite/gdb.python/py-explore.exp index 276148da8f10..debe30315356 100644 --- a/gdb/testsuite/gdb.python/py-explore.exp +++ b/gdb/testsuite/gdb.python/py-explore.exp @@ -74,11 +74,11 @@ proc scalar_value { value_name value } { } set SS_fields [field_values {a = 10} {d = 100[.].*}] if {![runto_main]} { - return -1 + return } gdb_breakpoint [gdb_get_line_number "Break here."] gdb_continue_to_breakpoint "Break here" ".*Break here.*" diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp index 043416c724cc..960a44f412a6 100644 --- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp @@ -44,11 +44,11 @@ clean_restart ${testfile} with_test_prefix "normal conditions" { clean_restart ${testfile} gdb_load_shlib ${lib_sl} if {![runto_main]} { - return 0 + return } set python_file [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] @@ -96,11 +96,11 @@ with_test_prefix "return to inlined function" { gdb_test "source $python_file" "Python script imported.*" \ "import python scripts" if {![runto_main]} { - return 0 + return } gdb_breakpoint "increase_2" gdb_test "continue" "Breakpoint .*at.*" "continue to the function to finish" @@ -122,11 +122,11 @@ with_test_prefix "no debug symbol" { gdb_test "source $python_file" "Python script imported.*" \ "import python scripts" set cond_line [gdb_get_line_number "Condition Break."] if {![runto_main]} { - return 0 + return } gdb_test "print do_nothing" "no debug info.*" "ensure that shared lib has no debug info" gdb_breakpoint "do_nothing" {temporary} gdb_test "continue" "Temporary breakpoint .*in \\.?do_nothing.*" \ @@ -177,11 +177,11 @@ with_test_prefix "finish in dummy frame" { gdb_test "source $python_file" "Python script imported.*" \ "import python scripts" if {![runto_main]} { - return 0 + return } gdb_test "break ${cond_line} if test_1(i,8)" "Breakpoint .* at .*" \ "set a conditional BP" gdb_test "python TestBreakpoint()" "TestBreakpoint init" \ @@ -204,11 +204,11 @@ with_test_prefix "finish in normal frame" { gdb_test "source $python_file" "Python script imported.*" \ "import python scripts" if {![runto_main]} { - return 0 + return } gdb_test "break ${cond_line} if test(i,8)" \ "Breakpoint .* at .*" "set conditional BP" gdb_test "python TestBreakpoint()" "TestBreakpoint init" "set BP in condition" @@ -233,11 +233,11 @@ with_test_prefix "explicit inferior function call" { gdb_test "source $python_file" "Python script imported.*" \ "import python scripts" if {![runto_main]} { - return 0 + return } # return address in dummy frame gdb_test "python TestExplicitBreakpoint('increase_1')" "Breakpoint.*at.*" \ @@ -260,11 +260,11 @@ with_test_prefix "explicit inferior function call" { # Test FinishBreakpoint when inferior exits # with_test_prefix "inferior exit" { if {![runto "test_exec_exit"]} { - return 0 + return } gdb_test_no_output "set var self_exec = 0" "switch to exit() test" gdb_test "python SimpleFinishBreakpoint(gdb.newest_frame())" "SimpleFinishBreakpoint init" "set FinishBP after the exit()" gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" "catch out of scope after exit" @@ -274,11 +274,11 @@ with_test_prefix "inferior exit" { # Test FinishBreakpoint when inferior execs # with_test_prefix "inferior exec" { if {![runto "test_exec_exit"]} { - return 0 + return } gdb_test "python SimpleFinishBreakpoint(gdb.newest_frame())" "SimpleFinishBreakpoint init" "set FinishBP after the exec" gdb_test "catch exec" "Catchpoint.*\(exec\).*" gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" "catch out of scope after exec" diff --git a/gdb/testsuite/gdb.python/py-format-address.exp b/gdb/testsuite/gdb.python/py-format-address.exp index dda012234b77..9f32686dfd3d 100644 --- a/gdb/testsuite/gdb.python/py-format-address.exp +++ b/gdb/testsuite/gdb.python/py-format-address.exp @@ -21,11 +21,11 @@ foreach func_name { foo bar } { if {[build_executable "build binary with ${func_name} function" \ "$testfile-${func_name}" $srcfile \ [list debug \ nopie \ additional_flags=-DFUNCTION_NAME=${func_name}]] == -1} { - return -1 + return } } set testfile_foo $testfile-foo set testfile_bar $testfile-bar @@ -33,11 +33,11 @@ set binary_foo [standard_output_file $testfile_foo] set binary_bar [standard_output_file $testfile_bar] clean_restart $testfile_foo if {![runto_main]} { - return -1 + return } # Check the gdb.format_address method when using the default values # for the program space and architecture (these will be selected based # on the current inferior). diff --git a/gdb/testsuite/gdb.python/py-framefilter-addr.exp b/gdb/testsuite/gdb.python/py-framefilter-addr.exp index 3c0436ce1972..1c85a8afcb36 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-addr.exp +++ b/gdb/testsuite/gdb.python/py-framefilter-addr.exp @@ -26,11 +26,11 @@ standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } # Run to our test breakpoint. gdb_breakpoint [gdb_get_line_number "Break here"] gdb_continue_to_breakpoint "run to test breakpoint" diff --git a/gdb/testsuite/gdb.python/py-label-symbol-value.exp b/gdb/testsuite/gdb.python/py-label-symbol-value.exp index c97ae72ec58d..bd3f9ee689e9 100644 --- a/gdb/testsuite/gdb.python/py-label-symbol-value.exp +++ b/gdb/testsuite/gdb.python/py-label-symbol-value.exp @@ -23,11 +23,11 @@ standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } # Use Python to print the value of the 'some_label' symbol. gdb_test "python frame = gdb.selected_frame()" gdb_test "python frame_pc = frame.pc()" diff --git a/gdb/testsuite/gdb.python/py-linetable-empty.exp b/gdb/testsuite/gdb.python/py-linetable-empty.exp index 651fe9b6dbf3..3244d88a9367 100644 --- a/gdb/testsuite/gdb.python/py-linetable-empty.exp +++ b/gdb/testsuite/gdb.python/py-linetable-empty.exp @@ -41,11 +41,11 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { return } if {![runto_main]} { - return -1 + return } gdb_test "python print(gdb.selected_frame().function().symtab.fullname())" \ "py-linetable-empty.c" "Test main has symtab" diff --git a/gdb/testsuite/gdb.python/py-pp-registration.exp b/gdb/testsuite/gdb.python/py-pp-registration.exp index 3d974b2120b6..ab84a0f7f905 100644 --- a/gdb/testsuite/gdb.python/py-pp-registration.exp +++ b/gdb/testsuite/gdb.python/py-pp-registration.exp @@ -62,11 +62,11 @@ proc test_printers { s_prefix } { # Test registration with verbose off. with_test_prefix "verbose off" { if {![prepare_test]} { - return -1 + return } gdb_test_no_output "set verbose off" gdb_test_no_output "py gdb.printing.register_pretty_printer(gdb, lookup_function_lookup_test)" @@ -77,11 +77,11 @@ with_test_prefix "verbose off" { # Test registration with verbose on. with_test_prefix "verbose on" { if {![prepare_test]} { - return -1 + return } gdb_test_no_output "set verbose on" gdb_test "py gdb.printing.register_pretty_printer(gdb, lookup_function_lookup_test)" \ @@ -94,11 +94,11 @@ with_test_prefix "verbose on" { # Exercise the "replace" argument to register_pretty_printer. with_test_prefix "replace" { if {![prepare_test]} { - return -1 + return } gdb_test_no_output "py gdb.printing.register_pretty_printer(gdb, lookup_function_lookup_test)" gdb_test_no_output "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer1)" gdb_test "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer2, replace=False)" \ diff --git a/gdb/testsuite/gdb.python/py-prompt.exp b/gdb/testsuite/gdb.python/py-prompt.exp index cc149ae62303..96ea52843442 100644 --- a/gdb/testsuite/gdb.python/py-prompt.exp +++ b/gdb/testsuite/gdb.python/py-prompt.exp @@ -68,11 +68,11 @@ save_vars { INTERNAL_GDBFLAGS GDBFLAGS } { "prompt_hook argument is default prompt. 2" gdb_exit } if {![can_spawn_for_attach]} { - return 0 + return } set test_spawn_id [spawn_wait_for_attach $binfile] set testpid [spawn_id_get_pid $test_spawn_id] diff --git a/gdb/testsuite/gdb.python/py-read-memory-leak.exp b/gdb/testsuite/gdb.python/py-read-memory-leak.exp index 58343126e67c..1a361c990533 100644 --- a/gdb/testsuite/gdb.python/py-read-memory-leak.exp +++ b/gdb/testsuite/gdb.python/py-read-memory-leak.exp @@ -25,10 +25,10 @@ standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } if {![runto_main]} { - return -1 + return } gdb_py_run_memory_leak_test ${srcdir}/${subdir}/${testfile}.py \ "buffers returned by read_memory() deallocates correctly" diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp index 4e324e71fc09..d5a647ebc59a 100644 --- a/gdb/testsuite/gdb.python/py-record-btrace.exp +++ b/gdb/testsuite/gdb.python/py-record-btrace.exp @@ -21,11 +21,13 @@ require allow_btrace_tests allow_python_tests load_lib gdb-python.exp standard_testfile -if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { return -1 } +if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { + return +} if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.python/py-record-full.exp b/gdb/testsuite/gdb.python/py-record-full.exp index 95640770e9a5..37bf07a64bfd 100644 --- a/gdb/testsuite/gdb.python/py-record-full.exp +++ b/gdb/testsuite/gdb.python/py-record-full.exp @@ -21,11 +21,13 @@ require supports_process_record allow_python_tests load_lib gdb-python.exp standard_testfile -if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { return -1 } +if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { + return +} if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp b/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp index 576fd5a85d3d..5e2b769cf71f 100644 --- a/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp +++ b/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp @@ -25,11 +25,11 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile \ {debug c++ additional_flags="-std=c++11"}]} { return } if {![runto_main]} { - return -1 + return } gdb_breakpoint [gdb_get_line_number "Break here."] gdb_continue_to_breakpoint "Break here" ".*Break here.*" diff --git a/gdb/testsuite/gdb.python/py-value-cc.exp b/gdb/testsuite/gdb.python/py-value-cc.exp index 1d65d617e30d..fa0cd066978b 100644 --- a/gdb/testsuite/gdb.python/py-value-cc.exp +++ b/gdb/testsuite/gdb.python/py-value-cc.exp @@ -23,11 +23,11 @@ standard_testfile .cc if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return } if {![runto_main]} { - return -1 + return } gdb_breakpoint [gdb_get_line_number "Break here."] gdb_continue_to_breakpoint "Break here" ".*Break here.*" diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index 4337928ddef4..ba3b1376ff5a 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -838,11 +838,11 @@ test_value_after_death test_subscript_regression "${binfile}" "c" if {[allow_cplus_tests]} { if { [build_inferior "${binfile}-cxx" "c++"] < 0 } { - return -1 + return } with_test_prefix "c++" { test_subscript_regression "${binfile}-cxx" "c++" } } diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp index 52f0a7597093..b8a8b46c1db3 100644 --- a/gdb/testsuite/gdb.python/py-xmethods.exp +++ b/gdb/testsuite/gdb.python/py-xmethods.exp @@ -25,11 +25,11 @@ standard_testfile py-xmethods.cc if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return } if {![runto_main]} { - return -1 + return } set xmethods_script [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 7d3cd299bc8c..27dbc555a17b 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -46,11 +46,11 @@ gdb_test_multiple "python print (23)" "verify python support" { gdb_test_multiline "multi-line python command" \ "python" "" \ "print (23)" "" \ "end" "not supported.*" - return -1 + return } -re "$gdb_prompt $" {} } gdb_test_multiline "multi-line python command" \