mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Clean up "return -1" in gdb.rust
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>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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\\}"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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\\)\\)"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 "" \
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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" " = \\(\\)"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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\\\]>.*"
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user