Eliminate spurious returns from the test suite

A number of tests end with "return".  However, this is unnecessary.
This patch removes all of these.
This commit is contained in:
Tom Tromey 2023-01-25 09:36:25 -07:00
parent 9b21b701bb
commit 879ebc5300
113 changed files with 1 additions and 173 deletions

View File

@ -135,4 +135,3 @@ mi_send_resuming_command "exec-continue" "continuing to inferior exit"
mi_expect_stop "exited-normally" "" "" "" "" "" "exit normally"
mi_gdb_exit
return 0

View File

@ -650,5 +650,3 @@ do_command_attach_tests
test_command_line_attach_run
return 0

View File

@ -180,4 +180,3 @@ gdb_assert { $more_than_one == 0 } "consolidated bfd errors"
gdb_assert { [array size bfd_error_count] >= 2 } "print all unique bfd errors"
gdb_exit
return 0

View File

@ -627,5 +627,3 @@ if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
}
set timeout $oldtimeout
return

View File

@ -175,5 +175,3 @@ if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] {
".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+" \
".\[0-9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}"
}
return

View File

@ -438,5 +438,3 @@ if {$allow_float_test} {
# Approx size: 4, 8, ...
test te
return 0

View File

@ -138,5 +138,3 @@ gdb_test "continue" "Breakpoint \[0-9\]*, handle_signal.*" \
gdb_test "continue" "$inferior_exited_re normally." \
"continue to program exit"
return 0

View File

@ -48,5 +48,3 @@ gdb_test_no_output "set may-call-functions on"
gdb_test "call callexit()" \
"The program being debugged exited.*" \
"inferior function call terminated program"
return 0

View File

@ -83,4 +83,3 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
return 0

View File

@ -33,5 +33,3 @@ if {[runto f4]} {
gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex value in C"
}
return 0

View File

@ -65,5 +65,3 @@ if {! [runto_main]} {
gdb_test "list" \
"func1 \\(\\);" \
"list size 3"
return 0

View File

@ -343,4 +343,3 @@ gdb_test_no_output "do-define" "invoke do-define"
gdb_test "do-printit" "here" "invoke do-printit"
gdb_exit
return 0

View File

@ -57,5 +57,3 @@ exec sleep 1
set pass "two"
do_detach_tests
return 0

View File

@ -223,5 +223,3 @@ gdb_exit
# Restore the preserved old timeout value.
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
return 0

View File

@ -461,4 +461,3 @@ test_ena_dis_br "disable"
test_ena_dis_br "enable"
gdb_exit
return 0

View File

@ -296,7 +296,7 @@ if {!$use_gdb_stub
set timeout $old_timeout
#remote_exec build "rm -f ${binfile}"
return 0

View File

@ -107,4 +107,3 @@ gdb_test "show paths" \
"show paths works properly"
gdb_exit
return 0

View File

@ -137,11 +137,3 @@ gdb_test "print (0 && (x=y))" ".$decimal = $false" \
gdb_exit
return 0

View File

@ -273,4 +273,3 @@ if {[file exists $dir2] && ![file writable $dir2]} {
}
set timeout $oldtimeout
return 0

View File

@ -208,5 +208,3 @@ foreach cmd {"next" "continue"} {
}
}
}
return 0

View File

@ -385,5 +385,3 @@ gdb_exit
clean_restart $binfile
do_exec_tests
return 0

View File

@ -502,4 +502,3 @@ with_test_prefix "exit" {
}
set timeout $oldtimeout
return 0

View File

@ -225,4 +225,3 @@ if {![file exists $binfile]} {
gdb_assert { $saw_end_of_file && $saw_inferior_exit } $msg
}
}
return 0

View File

@ -114,4 +114,3 @@ gdb_test "jump $out_line" \
"y"
gdb_exit
return 0

View File

@ -124,4 +124,3 @@ if {[runto csub]} {
}
set timeout $oldtimeout
return 0

View File

@ -282,4 +282,3 @@ send_gdb "\n"
gdb_test "" "0x00.*0x00" "repeat x command"
gdb_exit
return 0

View File

@ -515,4 +515,3 @@ gdb_test_no_output "maint print msymbols"
gdb_test_no_output "maint print psymbols"
gdb_exit
return 0

View File

@ -39,4 +39,3 @@ if {[runto middle]} {
# or main -> middle.
gdb_test "backtrace" "#0.*middle.*#\[12\].*main.*"
}
return 0

View File

@ -197,5 +197,3 @@ for {set i 6} { $i <= 16} {incr i} {
gdb_test_no_output "kill inferior $i" "kill $i"
gdb_test "info inferior $i" "<null>.*" "did kill $i"
}
return 0

View File

@ -221,5 +221,3 @@ with_test_prefix "software watchpoint" {
gdb_test "watch \$pc" ".*" "set watchpoint"
gdb_test "step" "soft-watch.*" "step still in same line"
}
return 0

View File

@ -132,5 +132,3 @@ foreach_with_prefix opts { "" "pie" } {
}
# End of tests.
return 0

View File

@ -184,5 +184,3 @@ gdb_test "continue" \
"get signal TERM"
gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
gdb_continue_to_end "continue to sigall exit"
return 0

View File

@ -270,5 +270,3 @@ The program being debugged stopped while in a function called from GDB.*" \
"#0 handler .*#1 .signal handler called.*\#2 .*main.*" \
"backtrace for SIGUSR1"
}
return 0

View File

@ -62,10 +62,3 @@ gdb_test "next" "${decimal}\[ \t\]*return ans;.* STEP .*" "step in solib call"
gdb_step_until ".*main .. at.*return 0;.*" "step out of solib call"
gdb_exit
return 0

View File

@ -65,7 +65,3 @@ gdb_test "br foo2" \
"foo2 in mdlib"
gdb_exit
return 0

View File

@ -40,5 +40,3 @@ gdb_test "next 2" ".*place2.*" "next 2 (3)"
gdb_test "next 2" ".*place3.*" "next 2 (4)"
gdb_test "next 2" ".*place2.*" "next 2 (5)"
gdb_test "next 2" ".*place3.*" "next 2 (6)"
return 0

View File

@ -79,5 +79,3 @@ gdb_test "next" \
gdb_test "next" \
".*RETURN \\(j\\);.*" \
"next over dummy 10"
return 0

View File

@ -202,5 +202,3 @@ gdb_test_multiple "step" "$test" {
}
gdb_continue_to_end
return 0

View File

@ -603,4 +603,3 @@ if { $allow_float_test } {
# Approx size: (4+4)+8=16, 32, ...
test { tf td } {2} {2}
}
return 0

View File

@ -48,4 +48,3 @@ if {[runto_main]} {
gdb_test "step" "nothing \\(\\) at.*"
}
remote_exec build "rm -f twice.c"
return 0

View File

@ -71,5 +71,3 @@ gdb_test_multiple "maint print dummy-frames" \
pass "unwindonsignal, dummy frame removed"
}
}
return 0

View File

@ -69,4 +69,3 @@ gdb_test "whatis x++" "type = int" "whatis value of x++"
gdb_test "whatis x--" "type = int" "whatis value of x--"
gdb_exit
return 0

View File

@ -68,4 +68,3 @@ gdb_test "ptype '(anonymous namespace)'" \
"type = namespace \\\(anonymous namespace\\\)"
gdb_exit
return 0

View File

@ -53,4 +53,3 @@ gdb_test "print i_" "\\\$2 = 3" "check the member variable from within C1::bar"
gdb_exit
return 0

View File

@ -96,4 +96,3 @@ gdb_test "print shadow" "\\$\[0-9]\* = 1" "shadowing member"
gdb_test "print ::shadow" "\\$\[0-9]\* = 0" "shadowed global variable"
gdb_exit
return 0

View File

@ -194,4 +194,3 @@ gdb_test "step" "gnu_obj_1::method.*"
gdb_test "print svar" " = true"
gdb_exit
return 0

View File

@ -118,4 +118,3 @@ test_first_component
test_namespace
gdb_exit
return 0

View File

@ -187,4 +187,3 @@ foreach f [list "$func" "'$func'"] {
}
gdb_exit
return 0

View File

@ -91,4 +91,3 @@ gdb_continue_to_breakpoint "stop_here_too"
test_class A::B::inner
gdb_exit
return 0

View File

@ -50,4 +50,3 @@ gdb_test \
"Breakpoint $decimal at $hex: file .*$srcfile, line 10.*"
gdb_exit
return 0

View File

@ -54,4 +54,3 @@ gdb_test_multiple "print obj->myB" "print obj->myB" {
}
gdb_exit
return 0

View File

@ -55,4 +55,3 @@ gdb_continue_to_breakpoint "end of constructors"
gdb_test "print *theB" "\\$\[0-9\]* = {<A> = {\[^}\]*}, static b = <optimized out>}" "PR gdb/574"
gdb_exit
return 0

View File

@ -54,6 +54,3 @@ gdb_continue_to_breakpoint "marker 1"
gdb_test "print x->y2 - x->y1" "warning: Type size unknown, assuming 1\. Try casting to a known type, or void \*\.\[^=\]*= 1"
gdb_exit
return 0

View File

@ -33,5 +33,3 @@ gdb_test "print b" ".*same as static member.*"
gdb_exit
return 0

View File

@ -50,4 +50,3 @@ gdb_test "print theA->nonvirt" \
"print nonvirtual method."
gdb_exit
return 0

View File

@ -45,4 +45,3 @@ gdb_test_no_output "set \$v = 0x5a5a" "set \$v 3"
gdb_test "print (\$u xor_eq 0xaaaa) == (\$v ^= 0xaaaa)" "= true"
gdb_exit
return 0

View File

@ -112,4 +112,3 @@ gdb_continue_to_breakpoint "end of constructors in func3"
gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}"
gdb_exit
return 0

View File

@ -110,4 +110,3 @@ foreach test $methods {
}
gdb_exit
return 0

View File

@ -63,4 +63,3 @@ gdb_continue_to_breakpoint "marker test-complete"
gdb_test "p test" "= true"
gdb_exit
return 0

View File

@ -133,4 +133,3 @@ gdb_test "print operator== (mem1, mem2)" " = false"
gdb_test "print operator== (mem1, mem1)" " = true"
gdb_exit
return 0

View File

@ -47,5 +47,3 @@ gdb_test "print o2.do_print3()" "\\$\[0-9\]+ = 111111"
gdb_test "print o" " = {<interface> = {.*_vptr.interface = $hex <vtable for Obj.*>}, <No data fields>}"
gdb_exit
return 0

View File

@ -103,4 +103,3 @@ mi_runto_main
register_tests
mi_gdb_exit
return 0

View File

@ -49,4 +49,3 @@ for {set i 0} {$i < 4} {incr i} {
do_test $i
mi_gdb_exit
return 0

View File

@ -54,4 +54,3 @@ foreach i [list x y z] {
}
mi_gdb_exit
return 0

View File

@ -78,4 +78,3 @@ mi_list_varobj_children "var2" {
} "list children of class C"
mi_gdb_exit
return 0

View File

@ -82,5 +82,3 @@ linux_async_tests
mi_gdb_exit
set GDBFLAGS $saved_gdbflags
return 0

View File

@ -270,4 +270,3 @@ if { [test_mi_interpreter_selection]
}
mi_gdb_exit
return 0

View File

@ -255,4 +255,3 @@ mi_gdb_test "888-interpreter-exec console \"set \$pc=0x0\"" \
"-interpreter-exec console \"\""
mi_gdb_exit
return 0

View File

@ -117,5 +117,3 @@ proc test_command_param_changed { } {
}
test_command_param_changed
return 0

View File

@ -96,4 +96,3 @@ mi_expect_stop "end-stepping-range" "main" "" ".*mi-console.c" $line "" \
"finished step over hello"
mi_gdb_exit
return 0

View File

@ -357,4 +357,3 @@ test_disassembly_mixed_lines_limit
test_disassembly_opcode_format
mi_gdb_exit
return 0

View File

@ -58,4 +58,3 @@ mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "e
mi_gdb_exit
return 0

View File

@ -85,4 +85,3 @@ proc test_list_thread_groups { } {
test_list_thread_groups
mi_gdb_exit
return 0

View File

@ -76,4 +76,3 @@ test_file_list_exec_source_file
test_file_list_exec_source_files
mi_gdb_exit
return 0

View File

@ -33,4 +33,3 @@ mi_gdb_test "47show architecture" \
"47show architecture"
mi_gdb_exit
return 0

View File

@ -63,4 +63,3 @@ mi_gdb_test "-data-evaluate-expression \"$path\"" \
"-data-evaluate-expression $path"
mi_gdb_exit
return 0

View File

@ -79,4 +79,3 @@ regsub ^0x0* $main_addr "" main_addr
mi_gdb_test "set var *(unsigned int *) 0x${main_addr} = ${main_insn}" \
".*=memory-changed,thread-group=\"i${decimal}\".addr=\"0x0*${main_addr}\",len=\"0x4\",type=\"code\".*\\^done"
mi_gdb_exit
return 0

View File

@ -65,4 +65,3 @@ mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \
mi_gdb_exit
return 0

View File

@ -37,5 +37,3 @@ mi_gdb_test "record stop" \
mi_gdb_test "target record" \
".*=record-started,thread-group=\"i${decimal}\",method=\"full\".*\\^done" \
"target record"
return 0

View File

@ -113,4 +113,3 @@ mi_runto_main
sparc_register_tests
mi_gdb_exit
return 0

View File

@ -62,4 +62,3 @@ mi_gdb_test "205-break-delete" \
test_return_simple
mi_gdb_exit
return 0

View File

@ -165,4 +165,3 @@ proc test_controlled_execution_reverse {} {
test_controlled_execution_reverse
mi_gdb_exit
return 0

View File

@ -187,4 +187,3 @@ test_controlling_breakpoints
test_program_termination
mi_gdb_exit
return 0

View File

@ -208,4 +208,3 @@ test_stack_info_depth
mi_gdb_exit
return 0

View File

@ -68,4 +68,3 @@ mi_runto_main
test_stepi_nexti
mi_gdb_exit
return 0

View File

@ -103,5 +103,3 @@ mi_gdb_test "410-data-evaluate-expression bar()" \
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
return 0

View File

@ -81,4 +81,3 @@ test_running_to_foo
test_until
mi_gdb_exit
return 0

View File

@ -175,4 +175,3 @@ mi_gdb_test "-var-delete cb" \
"delete var cb"
mi_gdb_exit
return 0

View File

@ -1211,4 +1211,3 @@ if { [mi_run_inline_test child_deletion] < 0 } {
mi_gdb_exit
return 0

View File

@ -688,4 +688,3 @@ mi_gdb_test "-var-update L" \
"in-and-out-of-scope: in scope now, not changed"
mi_gdb_exit
return 0

View File

@ -123,4 +123,3 @@ proc verify_everything {variable_name} {
mi_walk_varobj_tree c++ $tree verify_everything
mi_gdb_exit
return 0

View File

@ -661,4 +661,3 @@ if { [info exists fp] } {
mi_gdb_exit
return 0

View File

@ -122,4 +122,3 @@ mi_gdb_test "-var-info-type global_simple" \
"no type for invalid variable global_simple"
mi_gdb_exit
return 0

View File

@ -126,4 +126,3 @@ foreach_with_prefix inline_test $inline_tests {
}
mi_gdb_exit
return 0

View File

@ -80,4 +80,3 @@ mi_list_array_varobj_children "vla" "5" "int" \
"get children of vla"
mi_gdb_exit
return 0

View File

@ -209,4 +209,3 @@ mi_gdb_test "600-data-evaluate-expression pvla2" \
"600\\^done,value=\"<not associated>\"" "evaluate vla pointer set to null"
mi_gdb_exit
return 0

View File

@ -1321,4 +1321,3 @@ set tree "
mi_walk_varobj_tree c $tree verify_everything
mi_gdb_exit
return 0

View File

@ -76,5 +76,3 @@ gdb_test "inferior 1"
# Now run to the breakpoint. This should cross the exec, and stop at
# the breakpoint before the crash.
gdb_test "run" "${srcfile2}:${bp_location}.*set breakpoint here.*"
return 0

View File

@ -116,4 +116,3 @@ with_test_prefix "sync_execution = 1, is_running = 0" {
set GDBFLAGS $saved_gdbflags
kill_wait_spawned_process $test_spawn_id
return 0

View File

@ -311,5 +311,3 @@ gdb_expect 60 {
}
do_tests
return 0

Some files were not shown because too many files have changed in this diff Show More