From 62df070dd4589c7448d68ec9f1036cc7b73f6af6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 3 Oct 2025 12:14:32 -0600 Subject: [PATCH] More "return" cleanup in gdb.ada 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 --- gdb/testsuite/gdb.ada/array_return.exp | 2 +- gdb/testsuite/gdb.ada/bp_inlined_func.exp | 2 +- gdb/testsuite/gdb.ada/catch_assert_if.exp | 2 +- gdb/testsuite/gdb.ada/catch_ex.exp | 6 +++--- gdb/testsuite/gdb.ada/catch_ex_std.exp | 2 +- gdb/testsuite/gdb.ada/excep_handle.exp | 2 +- gdb/testsuite/gdb.ada/funcall_ref.exp | 2 +- gdb/testsuite/gdb.ada/info_exc.exp | 2 +- gdb/testsuite/gdb.ada/mi_catch_assert.exp | 2 +- gdb/testsuite/gdb.ada/mi_catch_ex.exp | 4 ++-- gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp | 4 ++-- gdb/testsuite/gdb.ada/mi_dyn_arr.exp | 2 +- gdb/testsuite/gdb.ada/mi_exc_info.exp | 2 +- gdb/testsuite/gdb.ada/mi_interface.exp | 2 +- gdb/testsuite/gdb.ada/mi_prot.exp | 2 +- gdb/testsuite/gdb.ada/mi_ref_changeable.exp | 2 +- gdb/testsuite/gdb.ada/mi_string_access.exp | 2 +- gdb/testsuite/gdb.ada/mi_task_arg.exp | 2 +- gdb/testsuite/gdb.ada/mi_task_info.exp | 2 +- gdb/testsuite/gdb.ada/mi_var_access.exp | 2 +- gdb/testsuite/gdb.ada/mi_var_array.exp | 2 +- gdb/testsuite/gdb.ada/mi_var_union.exp | 2 +- gdb/testsuite/gdb.ada/mi_variant.exp | 2 +- gdb/testsuite/gdb.ada/str_ref_cmp.exp | 2 +- 24 files changed, 28 insertions(+), 28 deletions(-) diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp index a27c8f324c8..21a75d8c4fa 100644 --- a/gdb/testsuite/gdb.ada/array_return.exp +++ b/gdb/testsuite/gdb.ada/array_return.exp @@ -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 diff --git a/gdb/testsuite/gdb.ada/bp_inlined_func.exp b/gdb/testsuite/gdb.ada/bp_inlined_func.exp index 4d772ff1f23..3bab85a126d 100644 --- a/gdb/testsuite/gdb.ada/bp_inlined_func.exp +++ b/gdb/testsuite/gdb.ada/bp_inlined_func.exp @@ -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 diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp index 2ac47d14bd4..eca657f869e 100644 --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp @@ -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" \ diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp index 5ac06ca70e7..34f32022541 100644 --- a/gdb/testsuite/gdb.ada/catch_ex.exp +++ b/gdb/testsuite/gdb.ada/catch_ex.exp @@ -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" \ diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp index fb12c76ad5f..d1f17f872f3 100644 --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp @@ -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" \ diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp index 624725d9047..40047f4f640 100644 --- a/gdb/testsuite/gdb.ada/excep_handle.exp +++ b/gdb/testsuite/gdb.ada/excep_handle.exp @@ -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 } ############################################ diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp index cc34a0b5c89..8e6bbc6c38a 100644 --- a/gdb/testsuite/gdb.ada/funcall_ref.exp +++ b/gdb/testsuite/gdb.ada/funcall_ref.exp @@ -81,7 +81,7 @@ foreach_gnat_encoding scenario flags {all minimal} { } if { $supported == 0 } { - return 0 + return } gdb_test "p get(\"Hello world!\")" \ diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp index ab2d95c3c72..b3ed9959a28 100644 --- a/gdb/testsuite/gdb.ada/info_exc.exp +++ b/gdb/testsuite/gdb.ada/info_exc.exp @@ -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" \ diff --git a/gdb/testsuite/gdb.ada/mi_catch_assert.exp b/gdb/testsuite/gdb.ada/mi_catch_assert.exp index 8fa02bd54b1..d011ca58da2 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_assert.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_assert.exp @@ -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\"" \ diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex.exp b/gdb/testsuite/gdb.ada/mi_catch_ex.exp index 5b2fddc6eed..974da0d72c9 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_ex.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_ex.exp @@ -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 } } diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp index b4251ab1f3d..f853f6bb561 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp @@ -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 } } diff --git a/gdb/testsuite/gdb.ada/mi_dyn_arr.exp b/gdb/testsuite/gdb.ada/mi_dyn_arr.exp index c96d0952917..6dded2520a3 100644 --- a/gdb/testsuite/gdb.ada/mi_dyn_arr.exp +++ b/gdb/testsuite/gdb.ada/mi_dyn_arr.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_exc_info.exp b/gdb/testsuite/gdb.ada/mi_exc_info.exp index 92279739deb..5358fcfa92d 100644 --- a/gdb/testsuite/gdb.ada/mi_exc_info.exp +++ b/gdb/testsuite/gdb.ada/mi_exc_info.exp @@ -29,7 +29,7 @@ set MIFLAGS "-i=mi" mi_clean_restart $::testfile if {[mi_runto_main] < 0} { - return 0 + return } mi_delete_breakpoints diff --git a/gdb/testsuite/gdb.ada/mi_interface.exp b/gdb/testsuite/gdb.ada/mi_interface.exp index e74db357968..e638f9717e0 100644 --- a/gdb/testsuite/gdb.ada/mi_interface.exp +++ b/gdb/testsuite/gdb.ada/mi_interface.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_prot.exp b/gdb/testsuite/gdb.ada/mi_prot.exp index ba0c3110b1b..5e3f160e322 100644 --- a/gdb/testsuite/gdb.ada/mi_prot.exp +++ b/gdb/testsuite/gdb.ada/mi_prot.exp @@ -31,7 +31,7 @@ set MIFLAGS "-i=mi" mi_clean_restart $::testfile if {[mi_runto_main] < 0} { - return 0 + return } mi_delete_breakpoints diff --git a/gdb/testsuite/gdb.ada/mi_ref_changeable.exp b/gdb/testsuite/gdb.ada/mi_ref_changeable.exp index 86bab640a5b..a2813d42dff 100644 --- a/gdb/testsuite/gdb.ada/mi_ref_changeable.exp +++ b/gdb/testsuite/gdb.ada/mi_ref_changeable.exp @@ -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". diff --git a/gdb/testsuite/gdb.ada/mi_string_access.exp b/gdb/testsuite/gdb.ada/mi_string_access.exp index cbed8285892..3a54e94bd86 100644 --- a/gdb/testsuite/gdb.ada/mi_string_access.exp +++ b/gdb/testsuite/gdb.ada/mi_string_access.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_task_arg.exp b/gdb/testsuite/gdb.ada/mi_task_arg.exp index 54534e82789..31ef7d0dbeb 100644 --- a/gdb/testsuite/gdb.ada/mi_task_arg.exp +++ b/gdb/testsuite/gdb.ada/mi_task_arg.exp @@ -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 diff --git a/gdb/testsuite/gdb.ada/mi_task_info.exp b/gdb/testsuite/gdb.ada/mi_task_info.exp index c69af43f145..3b1a37e306a 100644 --- a/gdb/testsuite/gdb.ada/mi_task_info.exp +++ b/gdb/testsuite/gdb.ada/mi_task_info.exp @@ -35,7 +35,7 @@ if {[mi_clean_restart $::testfile]} { #################################### if {![mi_runto "task_switch.break_me"]} { - return 0 + return } set ada_task_info_hdr \ diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp index 50b90f1edaa..72a7f36a01d 100644 --- a/gdb/testsuite/gdb.ada/mi_var_access.exp +++ b/gdb/testsuite/gdb.ada/mi_var_access.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_var_array.exp b/gdb/testsuite/gdb.ada/mi_var_array.exp index d8b565d2a79..15a01a503f6 100644 --- a/gdb/testsuite/gdb.ada/mi_var_array.exp +++ b/gdb/testsuite/gdb.ada/mi_var_array.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_var_union.exp b/gdb/testsuite/gdb.ada/mi_var_union.exp index 0cc792c07f9..9ae020f7995 100644 --- a/gdb/testsuite/gdb.ada/mi_var_union.exp +++ b/gdb/testsuite/gdb.ada/mi_var_union.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/mi_variant.exp b/gdb/testsuite/gdb.ada/mi_variant.exp index 4ad9a6ce165..6622cb1ff9d 100644 --- a/gdb/testsuite/gdb.ada/mi_variant.exp +++ b/gdb/testsuite/gdb.ada/mi_variant.exp @@ -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] diff --git a/gdb/testsuite/gdb.ada/str_ref_cmp.exp b/gdb/testsuite/gdb.ada/str_ref_cmp.exp index fa3370ffa36..a3362bffaa7 100644 --- a/gdb/testsuite/gdb.ada/str_ref_cmp.exp +++ b/gdb/testsuite/gdb.ada/str_ref_cmp.exp @@ -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 -- 2.47.3