]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Clean up "return -1" in gdb.rust
authorTom Tromey <tromey@adacore.com>
Thu, 30 Oct 2025 15:20:25 +0000 (09:20 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 3 Nov 2025 13:39:06 +0000 (06:39 -0700)
This changes gdb.rust tests to use plain "return" rather than
"return -1".  In these spots, the "-1" has no meaning.

Approved-by: Kevin Buettner <kevinb@redhat.com>
20 files changed:
gdb/testsuite/gdb.rust/completion.exp
gdb/testsuite/gdb.rust/dwindex.exp
gdb/testsuite/gdb.rust/finish.exp
gdb/testsuite/gdb.rust/fnfield.exp
gdb/testsuite/gdb.rust/generics.exp
gdb/testsuite/gdb.rust/main-crash.exp
gdb/testsuite/gdb.rust/methods.exp
gdb/testsuite/gdb.rust/modules.exp
gdb/testsuite/gdb.rust/onetwoeight.exp
gdb/testsuite/gdb.rust/pp.exp
gdb/testsuite/gdb.rust/rawids.exp
gdb/testsuite/gdb.rust/rust-start.exp
gdb/testsuite/gdb.rust/rust-style.exp
gdb/testsuite/gdb.rust/simple.exp
gdb/testsuite/gdb.rust/traits.exp
gdb/testsuite/gdb.rust/unicode.exp
gdb/testsuite/gdb.rust/union.exp
gdb/testsuite/gdb.rust/unsized.exp
gdb/testsuite/gdb.rust/unsized2.exp
gdb/testsuite/gdb.rust/watch.exp

index eac5a43469469284ca93f392e165491cb02bea43..0edd8cbd48038b0850eb02466f8680f42bd38fcb 100644 (file)
@@ -22,13 +22,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 with_timeout_factor 2 {
index a9e10e132ed7ab2ad4dfabe8954a150f6ec866f7..ba656fbc4af99e997ab4a6342c50ccc57c1ff4ec 100644 (file)
@@ -22,12 +22,12 @@ require {can_compile rust}
 standard_testfile .rs
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 if {[ensure_gdb_index $binfile -dwarf-5] == -1} {
     untested "error adding gdb index"
-    return -1
+    return
 }
 
 gdb_exit
index 96545fbcc0a880eb8110bb89b9be41b704567dab..6b941c814703f1e62a24e7fdbbdccbd64ecd4297 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "BREAK"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 # This 'finish' used to crash.  See PR rust/30090.  Also, this does
index a45ae94f0dbc1d4b17af7deb4fe81384b1fb419b..9df8c85192df593a50ac9e98bec9c3b8e2ac6a2d 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print foo.f()" " = 6" "call impl function"
index d7a34bf84d2b98617019db8a823e6a4891363852..121557962943e4a8b2b25ae8ddd53385080ff645 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print identity::<u32>(23u32)" " = 23"
index 1d246ee8ffb9fca01f711d0cd060c91bc8e81a0a..5a42966fb1a291ca653cc0ac56d8091e9c943ce2 100644 (file)
@@ -22,14 +22,14 @@ require {can_compile rust}
 standard_testfile main.rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
         {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "BREAK"]
 # The bug was that this would crash.
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 # Test that gdb is alive.
index 0061b46c9e3c5b958f55c1cbaf56668b79f46f09..9526ca493191a58176145deb6fd7d4d81680a31d 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint 1 here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print x" " = methods::HasMethods \\{value: 0\\}"
index 0874db3056d9fc8634909c334eeb2dd930120b03..426eb4652b7e2e08abfdf08c97889f6cef181576 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 # Currently a closure type is not described by rustc.
index 8ae9d54ec54f7275c7a772907a8a11b8e2adb90d..e1353c05568e933af80ed245d12fdc03f8876a97 100644 (file)
@@ -22,18 +22,18 @@ require {can_compile rust}
 set v [split [rust_compiler_version] .]
 if {[lindex $v 0] == 1 && [lindex $v 1] < 43} {
     untested "128-bit ints require rust 1.43 or greater"
-    return -1
+    return
 }
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "BREAK"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print x" " = 340282366920938463463374607431768211455"
index aa989c0552e9b9bf8ce71a98746acaba403cb0bf..e287c3e51f6b68b2aeabc409b0d5187b3d5a29be 100644 (file)
@@ -22,7 +22,7 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set remote_python_file [gdb_remote_download host \
@@ -32,7 +32,7 @@ gdb_test_no_output "source ${remote_python_file}" "load python file"
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print outer" " = pp::Outer \\(x\\(5\\)\\)"
index 9029e2fd5c69ad72be5753390f25a4e2cc92638f..d98b748f8d644e96250f30ed6f7354d28851da82 100644 (file)
@@ -22,13 +22,13 @@ require {rust_at_least 1.30}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print r#if" " = 23"
index 1287d83e8404defce273c7e6efbc73708741e55c..e2429cd04d2df92dec075c78834c5342512162eb 100644 (file)
@@ -25,13 +25,13 @@ require !use_gdb_stub
 
 standard_testfile simple.rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 # Verify that "start" lands inside the right procedure.
 if {[gdb_start_cmd] < 0} {
     unsupported "start failed"
-    return -1
+    return
 }
 
 gdb_test "" \
index ae01ad6d9ee4f4636139970b4a2c6fcce7870503..bbee56447f104cb962ad9c2e6ab6860b0a7d97ee 100644 (file)
@@ -23,13 +23,13 @@ with_ansi_styling_terminal {
     standard_testfile .rs
     if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
             {debug rust}]} {
-       return -1
+       return
     }
 
     set line [gdb_get_line_number "breakpoint"]
     if {![runto ${srcfile}:$line]} {
        untested "could not run to breakpoint"
-       return -1
+       return
     }
 
     set vfield [style value variable]
index a236a30d0021b420444b171338660082b641ccb2..2377e09b8937ac8c7453df3a4c6ef2b4d499dafd 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print a" " = \\(\\)"
index 82fc894febec3b87e418fe886a63af76f7b233f4..50800702d7eaec3c3484798817abf4a996af50b5 100644 (file)
@@ -21,7 +21,7 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set readelf_program [gdb_find_readelf]
@@ -39,7 +39,7 @@ if {![regexp DW_AT_containing_type $output]} {
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print *td" " = 23.5"
index a86e59f69da039b6091af6f2762906f97ee4fee2..ef6818d8f93507b5c475616c73ade1f5681a7b88 100644 (file)
@@ -28,13 +28,13 @@ setenv LC_ALL C.UTF-8
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print 𝕯" " = 98" "print D"
index 55fe6dbd01f1fe2f5f0d6821b13d21a5e70a724b..87c28ebeb34ec866bfdf8b1e4bed3f5a4f459626 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "print u" " = union::Union {f1: -1, f2: 255}"
index f91614551d748d587806c5605d1a251d66702c46..95abab50c1b57828f531cea1ce3a1e190ea02c2c 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 gdb_test "ptype us" " = .*V<\\\[u8\\\]>.*"
index d4d5ea1915cd5a8a04ad6e2450f264fe3305c43b..85c091c62529a1e311324e4fc8787485f2f90782 100644 (file)
@@ -22,13 +22,13 @@ require {rust_at_least 1.61}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 set base_value \
index a90abd761a1d162a93fcbac758420c5dd82c93ce..33d7279db56278d1a703a65a3629a0281f01ead5 100644 (file)
@@ -21,13 +21,13 @@ require {can_compile rust}
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-    return -1
+    return
 }
 
 set line [gdb_get_line_number "set breakpoint here"]
 if {![runto ${srcfile}:$line]} {
     untested "could not run to breakpoint"
-    return -1
+    return
 }
 
 # Just setting a watchpoint was enough to trigger the bug.