This patch manually changes "return -1" 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 for loops,
with_test_prefix, foreach_with_prefix, gdb_test_multiple.
I also fixed a couple cases of "return 0" from top-level that also
weren't caught by sed, and even a couple cases of "return 1" from
top-level.
---
gdb/testsuite/gdb.threads/attach-slow-waitpid.exp | 4 ++--
gdb/testsuite/gdb.threads/corethreads.exp | 4 ++--
gdb/testsuite/gdb.threads/create-fail.exp | 2 +-
gdb/testsuite/gdb.threads/gcore-stale-thread.exp | 2 +-
gdb/testsuite/gdb.threads/gcore-thread.exp | 4 ++--
gdb/testsuite/gdb.threads/linux-dp.exp | 2 +-
gdb/testsuite/gdb.threads/multiple-successive-infcall.exp | 6 +++---
gdb/testsuite/gdb.threads/omp-par-scope.exp | 2 +-
gdb/testsuite/gdb.threads/omp-task.exp | 2 +-
gdb/testsuite/gdb.threads/siginfo-threads.exp | 2 +-
gdb/testsuite/gdb.threads/staticthreads.exp | 4 ++--
gdb/testsuite/gdb.threads/stepi-over-clone.exp | 2 +-
gdb/testsuite/gdb.threads/thread-specific.exp | 4 ++--
gdb/testsuite/gdb.threads/thread_check.exp | 2 +-
gdb/testsuite/gdb.threads/tls.exp | 4 ++--
gdb/testsuite/gdb.threads/watchthreads-reorder.exp | 2 +-
16 files changed, 24 insertions(+), 24 deletions(-)
@@ -51,20 +51,20 @@ set libobj [standard_output_file ${libfile}.so]
with_test_prefix "compile preload library" {
# Compile the preload library. We only get away with this as we
# limit this test to running when ISNATIVE is true.
if { [gdb_compile_shlib_pthreads \
$libsrc $libobj {debug}] != "" } then {
- return -1
+ return
}
}
with_test_prefix "compile test executable" {
# Compile the test program
if { [gdb_compile_pthreads \
"${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable {debug}] != "" } {
- return -1
+ return
}
}
# Spawn GDB with LIB preloaded with LD_PRELOAD.
@@ -21,12 +21,12 @@ if {![istarget "*-*-linux*"]} {
}
standard_testfile
set executable ${testfile}
if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "failed to compile"
- return -1
+ untested "failed to compile"
+ return
}
set corefile [core_find $binfile]
if {$corefile == ""} {
untested "unable to create or find corefile"
@@ -32,11 +32,11 @@ for {set i 1} {$i <= $iterations} {incr i} {
with_test_prefix "iteration $i" {
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
set test "run till end"
gdb_test_multiple "continue" "$test" {
-re "exited with code 01.*$gdb_prompt $" {
@@ -32,11 +32,11 @@ gdb_test_multiple "info threads" "threads are supported" {
-re ".* main .*\r\n$gdb_prompt $" {
# OK, threads are supported.
}
-re "\r\n$gdb_prompt $" {
unsupported "gdb does not support threads on this target"
- return -1
+ return
}
}
gdb_breakpoint ${srcfile}:[gdb_get_line_number "break-here"]
# gdb_continue_to_breakpoint does not work as it uses "$gdb_prompt $" regex
@@ -63,11 +63,11 @@ gdb_test_multiple "info threads" "threads are supported" {
-re ".* main .*$gdb_prompt $" {
# OK, threads are supported.
}
-re "${nl}$gdb_prompt $" {
unsupported "gdb does not support threads on this target"
- return -1
+ return
}
}
# Make sure thread 1 is running
delete_breakpoints
@@ -81,11 +81,11 @@ gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running"
# Drop corefile
set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
if {!$core_supported} {
- return -1
+ return
}
# Test the uninitialized thread list.
# Provide the case of glibc td_thr_get_info handling of:
@@ -97,11 +97,11 @@ for {set i 0} {$i < 5} {incr i} {
-re " received signal.*(Unknown signal|SIGUSR|Real-time event).*$gdb_prompt $" {
# It would be nice if we could catch the message that GDB prints
# when it first notices that the thread library doesn't support
# debugging, or if we could explicitly ask GDB somehow.
unsupported "this GDB does not support threads on this system."
- return -1
+ return
}
-re "$gdb_prompt $" {
}
}
if { $threads_created == 1 } {
@@ -17,18 +17,18 @@
# multiple inferiors, one after the other.
standard_testfile
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
- executable {debug additional_flags=-std=gnu99}] != "" } {
- return -1
+ executable {debug additional_flags=-std=gnu99}] != "" } {
+ return
}
clean_restart "${::testfile}"
if {![runto_main]} {
- return 0
+ return
}
# Ensure that each new thread is detected by GDB in the order that the
# test case creates them, so the thread identifiers match between
# test and test case.
@@ -54,11 +54,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
# is optional and will only be called if it's defined.
if {[info procs gdb_openmp_setup] != ""} {
if {[gdb_openmp_setup $binfile] != ""} {
untested "could not set up OpenMP environment"
- return -1
+ return
}
}
if {![runto_main]} {
return
@@ -28,11 +28,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
}
if {[info procs gdb_openmp_setup] != ""} {
if {[gdb_openmp_setup $binfile] != ""} {
untested "could not set up OpenMP environment"
- return -1
+ return
}
}
if {![runto_main]} {
return
@@ -60,11 +60,11 @@ for {set sigcount 0} {$sigcount < 4} {incr sigcount} {
set sigusr $expect_out(1,string)
pass $test
}
}
if {$sigusr == ""} {
- return -1
+ return
}
set test "signal $sigcount si_signo"
if {$sigusr == 1} {
set signo 10
@@ -28,11 +28,11 @@ foreach_with_prefix have_tls { "-DHAVE_TLS" "" } {
[list debug "additional_flags=${static_flag} ${have_tls}" \
]] == "" } {
break
}
if { $have_tls == "" } {
- return -1
+ return
}
}
clean_restart ${::testfile}
gdb_test_no_output "set print sevenbit-strings"
@@ -97,11 +97,11 @@ gdb_test_multiple "quit" "$test" {
clean_restart ${::testfile}
if { "$have_tls" != "" } {
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "tlsvar-is-set"]
gdb_continue_to_breakpoint "tlsvar-is-set" ".* tlsvar-is-set .*"
gdb_test "p tlsvar" " = 2" "tlsvar in thread"
gdb_test "thread 1" ".*"
@@ -83,11 +83,11 @@ gdb_test_multiple "disassemble" "" {
exp_continue
}
-re "^End of assembler dump\\.\r\n$gdb_prompt $" {
if { [llength $syscall_addrs] == 0 } {
unsupported "no syscalls found"
- return -1
+ return
}
}
}
# The test proc. NON_STOP and DISPLACED are either 'on' or 'off', and are
@@ -79,12 +79,12 @@ gdb_continue_to_breakpoint "all threads started"
set line [gdb_get_line_number "thread-specific.exp: thread loop"]
set threads [get_thread_list]
if {[llength $threads] == 0} {
- # We have already issued a FAIL above.
- return 1
+ # We have already issued a FAIL above.
+ return
}
gdb_test {print $_thread} ".* = [lindex $threads 0]" "thread var in main"
gdb_test {print $_gthread} ".* = [lindex $threads 0]" "gthread var in main"
@@ -40,11 +40,11 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
clean_restart ${::testfile}
if {![runto_main]} {
- return 1
+ return
}
#
# set breakpoint at thread function tf
@@ -163,11 +163,11 @@ gdb_test_multiple "print a_thread_local" "" {
pass $gdb_test_name
}
}
if {![runto_main]} {
- return 0
+ return
}
# Set a breakpoint at the "spin" routine to
# test the thread local's value.
#
@@ -188,11 +188,11 @@ send_gdb "continue\n"
gdb_expect {
-re ".* received signal SIGSEGV.*a_thread_local = 0;.*$gdb_prompt $" {
# This is the first symptom if the gcc and binutils versions
# in use support TLS, but the system glibc does not.
unsupported "continue to first thread: system does not support TLS"
- return -1
+ return
}
-re ".*$inferior_exited_re normally.*$gdb_prompt $" {
fail "continue to first thread: program runaway"
}
-re ".*Pass 0 done.*Pass 1 done.*$gdb_prompt $" {
@@ -40,11 +40,11 @@ foreach reorder {0 1} { with_test_prefix "reorder$reorder" {
clean_restart $testfile
gdb_test "set can-use-hw-watchpoints 1"
if {![runto_main]} {
- return -1
+ return
}
# Use "rwatch" as "watch" would report the watchpoint changed just based on its
# read memory value during a stop by unrelated event. We are interested in not
# losing the hardware watchpoint trigger.