]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
More "return" cleanup in gdb.ada
authorTom Tromey <tromey@adacore.com>
Fri, 3 Oct 2025 18:14:32 +0000 (12:14 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 6 Oct 2025 13:36:58 +0000 (07:36 -0600)
I found some more spots in gdb.ada where a "return" has a value but
does not need one.  This patch cleans these up.

Most of these would be eliminated by the old "critical" idea, if I
ever got around to finishing that...

Approved-by: Kevin Buettner <kevinb@redhat.com>
24 files changed:
gdb/testsuite/gdb.ada/array_return.exp
gdb/testsuite/gdb.ada/bp_inlined_func.exp
gdb/testsuite/gdb.ada/catch_assert_if.exp
gdb/testsuite/gdb.ada/catch_ex.exp
gdb/testsuite/gdb.ada/catch_ex_std.exp
gdb/testsuite/gdb.ada/excep_handle.exp
gdb/testsuite/gdb.ada/funcall_ref.exp
gdb/testsuite/gdb.ada/info_exc.exp
gdb/testsuite/gdb.ada/mi_catch_assert.exp
gdb/testsuite/gdb.ada/mi_catch_ex.exp
gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
gdb/testsuite/gdb.ada/mi_dyn_arr.exp
gdb/testsuite/gdb.ada/mi_exc_info.exp
gdb/testsuite/gdb.ada/mi_interface.exp
gdb/testsuite/gdb.ada/mi_prot.exp
gdb/testsuite/gdb.ada/mi_ref_changeable.exp
gdb/testsuite/gdb.ada/mi_string_access.exp
gdb/testsuite/gdb.ada/mi_task_arg.exp
gdb/testsuite/gdb.ada/mi_task_info.exp
gdb/testsuite/gdb.ada/mi_var_access.exp
gdb/testsuite/gdb.ada/mi_var_array.exp
gdb/testsuite/gdb.ada/mi_var_union.exp
gdb/testsuite/gdb.ada/mi_variant.exp
gdb/testsuite/gdb.ada/str_ref_cmp.exp

index a27c8f324c8fb2d4094b63aa629aea477dbfde16..21a75d8c4fa68b7a02d90c01ed98712ccaffd65f 100644 (file)
@@ -34,7 +34,7 @@ clean_restart ${testfile}
 # Start the inferior
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 # Create a breakpoint in each function from which we want to test
index 4d772ff1f2310f3585067df9fcb19e20087720ca..3bab85a126de673ec4f0fb70448fe2ce4882a5f4 100644 (file)
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 # Check that inserting breakpoint on read_small inlined function inserts
index 2ac47d14bd4e1dfee161323ab5dd938a23067043..eca657f869ecc0ca4e9102267010704208e23b50 100644 (file)
@@ -35,7 +35,7 @@ set sp "\[ \t\]*"
 #  - continue, the program exits.
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "catch assert if Global_Var = 2" \
index 5ac06ca70e737badb98aa04bac62ab3a352804c7..34f3202254155b5fed47950d2dbbc9b703b14a0b 100644 (file)
@@ -41,7 +41,7 @@ set catch_exception_info \
 ####################################
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "catch exception" \
@@ -79,7 +79,7 @@ gdb_test "continue" \
 #  - continue, the program exits.
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "catch exception Program_Error" \
@@ -139,7 +139,7 @@ gdb_test "continue" \
 #     the program.
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "tcatch exception" \
index fb12c76ad5f0a4d92cbd68158359baaa38976c90..d1f17f872f3a67ade41028864b0caa35d724003f 100644 (file)
@@ -66,7 +66,7 @@ clean_restart ${testfile}
 gdb_load_shlib $sofile
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "catch exception some_kind_of_error" \
index 624725d9047dfac36110199eee2dbd956646f86b..40047f4f6405763bf984aa4ebef301c50b62bf28 100644 (file)
@@ -41,7 +41,7 @@ set catchpoint_storage_error_msg \
   "Catchpoint $decimal, exception at $hex in foo \\\(\\\).*at .*foo.adb:$decimal$eol$decimal$sp$when Storage_Error =>"
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 ############################################
index cc34a0b5c89b316e1d74dafc324a1e704fa05268..8e6bbc6c38ab2af3545182ade7f1f5add72ff648 100644 (file)
@@ -81,7 +81,7 @@ foreach_gnat_encoding scenario flags {all minimal} {
     }
 
     if { $supported == 0 } {
-       return 0
+       return
     }
 
     gdb_test "p get(\"Hello world!\")" \
index ab2d95c3c72c9870c67ecb1c47cd251a133f7382..b3ed9959a28028fd92010db7f7e3dd4c029f2113 100644 (file)
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 clean_restart ${testfile}
 
 if {![runto_main]} {
-   return 0
+   return
 }
 
 gdb_test "info exceptions" \
index 8fa02bd54b186d70cf051d1c0bab367a2582ff18..d011ca58da2abee1ddfd7c2042ff01980e714bae 100644 (file)
@@ -39,7 +39,7 @@ mi_clean_restart $::testfile
 #  - continue, the program exits.
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 mi_gdb_test "-catch-assert -c \"Global_Var = 2\"" \
index 5b2fddc6eedd3544f11fad37229efb5e784a1329..974da0d72c967519565b884de3eeab2faf6f2d14 100644 (file)
@@ -38,7 +38,7 @@ mi_clean_restart $::testfile
 
 with_test_prefix "scenario 1" {
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 }
 
@@ -96,7 +96,7 @@ continue_to_exception \
 with_test_prefix "scenario 2" {
     mi_delete_breakpoints
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 }
 
index b4251ab1f3d68b0c5dcaa36928607b17c969c6e5..f853f6bb561a921f48934abcbd3e37a730ca93fc 100644 (file)
@@ -34,7 +34,7 @@ mi_clean_restart $::testfile
 
 with_test_prefix "scenario 1" {
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 }
 
@@ -86,7 +86,7 @@ continue_to_exception_handler \
 with_test_prefix "scenario 2" {
     mi_delete_breakpoints
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 }
 
index c96d0952917751ed7e56c29dcc2f9f117139d263..6dded2520a3e1d0722c7e2717ef4f5a119a388c5 100644 (file)
@@ -29,7 +29,7 @@ set MIFLAGS "-i=mi"
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
index 92279739deb36453febf869fa1d4b873b55ff296..5358fcfa92d16120a98bf203ce71b60debd54fab 100644 (file)
@@ -29,7 +29,7 @@ set MIFLAGS "-i=mi"
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 mi_delete_breakpoints
index e74db357968a048563fee1c463fc33fab225ea9d..e638f9717e007019cda9a25e254e7c737b2c2781 100644 (file)
@@ -31,7 +31,7 @@ set MIFLAGS "-i=mi"
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo.adb]
index ba0c3110b1b207669c2754142716c32fd312306e..5e3f160e322579855051fb5b1dac2fb17f5ff890 100644 (file)
@@ -31,7 +31,7 @@ set MIFLAGS "-i=mi"
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 mi_delete_breakpoints
index 86bab640a5b4702a47504af90ab91e2cd68bce29..a2813d42dff1353e05ebc2343dcbbfa66e31b929 100644 (file)
@@ -29,7 +29,7 @@ set MIFLAGS "-i=mi"
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-   return 0
+   return
 }
 
 # Continue until STOP_1, and create a varobj for variables "A" and "B".
index cbed82858927c542e555c837381db33b4b180c27..3a54e94bd864076e28e4dbf42266aeb3fd7f1dd4 100644 (file)
@@ -32,7 +32,7 @@ foreach_gnat_encoding scenario flags {all minimal} {
     mi_clean_restart $::testfile-$scenario
 
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 
     set bp_location [gdb_get_line_number "STOP" ${testdir}/bar.adb]
index 54534e82789a4ffef7b3b5c2d7ec74bf5d0e7628..31ef7d0dbeb74a6048dc25b85a8885d2630b22b5 100644 (file)
@@ -34,7 +34,7 @@ if {[mi_clean_restart $::testfile]} {
 mi_gdb_test "-gdb-set debug-file-directory \"\"" ".*"
 
 if {![mi_runto "task_switch.break_me"]} {
-   return 0
+   return
 }
 
 # Verify that "-stack-list-arguments" does not cause the debugger to
index c69af43f1451b49e252e122a51547e68e5d1affe..3b1a37e306a02417a1a2dac507506796b0f0c07f 100644 (file)
@@ -35,7 +35,7 @@ if {[mi_clean_restart $::testfile]} {
 ####################################
 
 if {![mi_runto "task_switch.break_me"]} {
-   return 0
+   return
 }
 
 set ada_task_info_hdr \
index 50b90f1edaa67e0047282746f0d20d19dc6e67ff..72a7f36a01dd61d49de196fae90b931ce2850ce2 100644 (file)
@@ -29,7 +29,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != "" } {
 mi_clean_restart $::testfile
 
 if {[mi_runto_main] < 0} {
-    return 0
+    return
 }
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/mi_access.adb]
index d8b565d2a7933c6f5fc3cb4e59da94d64a08ad07..15a01a503f6bff3dde56bc4e06519bd87829c330 100644 (file)
@@ -32,7 +32,7 @@ foreach_gnat_encoding scenario flags {none all minimal} {
     mi_clean_restart $::testfile-$scenario
 
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 
     set bp_location [gdb_get_line_number "STOP" ${testdir}/bar.adb]
index 0cc792c07f9efe3227a8c5012c8fb58524a75d78..9ae020f79950c0c9051d6ba521c51835d2c3ad3c 100644 (file)
@@ -34,7 +34,7 @@ foreach_gnat_encoding scenario flags {none all minimal} {
     mi_clean_restart $::testfile-$scenario
 
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 
     set bp_location [gdb_get_line_number "STOP" ${testdir}/bar.adb]
index 4ad9a6ce1659a71497cec5cd3cfdec6232573766..6622cb1ff9dd32a7a5a14d1e15436463e794e9ff 100644 (file)
@@ -33,7 +33,7 @@ foreach_gnat_encoding scenario flags {none all minimal} {
     mi_clean_restart $::testfile-$scenario
 
     if {[mi_runto_main] < 0} {
-       return 0
+       return
     }
 
     set bp_location [gdb_get_line_number "STOP" ${testdir}/pkg.adb]
index fa3370ffa36cfe8f1d660c8a10ce738ac97bf643..a3362bffaa7be10bcde2be2492dbae1966507f78 100644 (file)
@@ -34,7 +34,7 @@ gdb_test_multiple {print "a" = "a"} $test {
     -re " = false\r\n$gdb_prompt $" {
        kfail ada/12607 $test
        untested ${testdir}.exp
-       return 0
+       return
     }
     -re " = true\r\n$gdb_prompt $" {
        pass $test