gdb/testsuite: make runto_main not pass no-message to runto

As follow-up to this discussion:

  https://sourceware.org/pipermail/gdb-patches/2020-August/171385.html

... make runto_main not pass no-message to runto.  This means that if we
fail to run to main, for some reason, we'll emit a FAIL.  This is the
behavior we want the majority of (if not all) the time.

Without this, we rely on tests logging a failure if runto_main fails,
otherwise.  They do so in a very inconsisteny mannet, sometimes using
"fail", "unsupported" or "untested".  The messages also vary widly.
This patch removes all these messages as well.

Also, remove a few "fail" where we call runto (and not runto_main).  by
default (without an explicit no-message argument), runto prints a
failure already.  In two places, gdb.multi/multi-re-run.exp and
gdb.python/py-pp-registration.exp, remove "message" passed to runto.
This removes a few PASSes that we don't care about (but FAILs will still
be printed if we fail to run to where we want to).  This aligns their
behavior with the rest of the testsuite.

Change-Id: Ib763c98c5f4fb6898886b635210d7c34bd4b9023
This commit is contained in:
Simon Marchi 2021-09-30 11:52:21 -04:00
parent 2fed9db40b
commit 4dfef5be68
598 changed files with 75 additions and 784 deletions

View file

@ -28,7 +28,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -25,7 +25,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
}
if ![runto_main] {
fail "couldn't run to main."
return 0
}

View file

@ -66,7 +66,6 @@ gdb_load ${binfile}
gdb_test_no_output "set print pretty on"
if { ![runto_main] } {
fail "failed to run to main"
return
}

View file

@ -28,7 +28,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
if { [skip_python_tests] } { continue }
if ![runto_main ] then {
fail "can't run to main"
return -1
}

View file

@ -28,7 +28,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -29,8 +29,7 @@ if { [skip_python_tests] } { continue }
clean_restart "${testfile}"
if ![runto_main] {
perror "could not run to main"
continue
return
}
# The following will create a breakpoint Python wrapper whose construction will

View file

@ -39,7 +39,6 @@ proc_with_prefix test_bkpt_basic { } {
gdb_test "python print (gdb.breakpoints())" "\\(\\)"
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -122,7 +121,6 @@ proc_with_prefix test_bkpt_deletion { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -158,7 +156,6 @@ proc_with_prefix test_bkpt_cond_and_cmds { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -216,7 +213,6 @@ proc_with_prefix test_bkpt_invisible { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -262,7 +258,6 @@ proc_with_prefix test_hardware_breakpoints { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -290,7 +285,6 @@ proc_with_prefix test_watchpoints { } {
}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -313,7 +307,6 @@ proc_with_prefix test_bkpt_internal { } {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
delete_breakpoints
@ -341,7 +334,6 @@ proc_with_prefix test_bkpt_eval_funcs { } {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
delete_breakpoints
@ -455,7 +447,6 @@ proc_with_prefix test_bkpt_temporary { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
delete_breakpoints
@ -574,7 +565,6 @@ proc_with_prefix test_bkpt_explicit_loc {} {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -660,7 +650,6 @@ proc_with_prefix test_bkpt_qualified {} {
set two_location_re "Breakpoint $decimal at $hex:.*2 locations."
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -730,7 +719,6 @@ proc_with_prefix test_bkpt_probe {} {
}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -748,7 +736,6 @@ proc_with_prefix test_catchpoints {} {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -808,7 +795,6 @@ proc_with_prefix test_bkpt_auto_disable { } {
clean_restart ${testfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
delete_breakpoints

View file

@ -28,7 +28,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "cannot run to main."
return 0
}

View file

@ -54,7 +54,6 @@ clean_restart ${testfile}
gdb_load_shlib ${lib_sl}
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -105,7 +104,6 @@ gdb_test "source $python_file" "Python script imported.*" \
set cond_line [gdb_get_line_number "Condition Break."]
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -131,8 +129,7 @@ gdb_test "source $python_file" "Python script imported.*" \
"import python scripts, 3"
if ![runto call_longjmp_1] then {
perror "couldn't run to breakpoint call_longjmp"
continue
return
}
gdb_test "python finishbp = SimpleFinishBreakpoint(gdb.newest_frame())" \
@ -158,7 +155,6 @@ gdb_test "source $python_file" "Python script imported.*" \
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -184,7 +180,6 @@ gdb_test "source $python_file" "Python script imported.*" \
"import python scripts, 5"
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -212,7 +207,6 @@ gdb_test "source $python_file" "Python script imported.*" \
"import python scripts, 6"
if ![runto_main] then {
fail "cannot run to main."
return 0
}
@ -239,7 +233,6 @@ gdb_test "print increase(&i)" \
#
if ![runto "test_exec_exit"] then {
fail "cannot run to test_exec_exit."
return 0
}
@ -252,7 +245,6 @@ gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" "catch out of scope
#
if ![runto "test_exec_exit"] then {
fail "cannot run to test_exec_exit."
return 0
}

View file

@ -28,7 +28,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "cannot run to main."
return 0
}

View file

@ -25,7 +25,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to function f"
return 0
}

View file

@ -30,7 +30,6 @@ if { [skip_python_tests] } { continue }
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -38,7 +38,6 @@ switch [get_endianness] {
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -40,7 +40,6 @@ gdb_test_multiline "install new_thread event handler" \
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -28,7 +28,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}
@ -121,7 +120,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile}2 ${srcfile} {nodebug l
}
if ![runto_main] {
fail "can't run to main"
return 0
}

View file

@ -27,7 +27,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -33,7 +33,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
if { [skip_python_tests] } { continue }
if ![runto_main ] then {
fail "can't run to main"
return -1
}

View file

@ -31,7 +31,6 @@ set remote_python_file [gdb_remote_download host \
${srcdir}/${subdir}/${testfile}.py]
if ![runto_main ] {
fail "can't run to main"
return -1
}
@ -42,7 +41,7 @@ proc prepare_test { } {
clean_restart ${testfile}
set run_to_here [gdb_get_line_number {break to inspect} ${testfile}.c ]
if ![runto ${testfile}.c:$run_to_here message] {
if ![runto ${testfile}.c:$run_to_here] {
return 0
}

View file

@ -53,7 +53,6 @@ gdb_test "python print (progspace.random_attribute)" "42" \
"Verify set of random attribute in progspace"
if {![runto_main]} {
fail "can't run to main"
return
}

View file

@ -28,7 +28,6 @@ if {[prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -39,7 +39,6 @@ if { [skip_python_tests] } {
}
if { ![runto_main] } {
untested "failed to run to main"
return -1
}

View file

@ -36,7 +36,6 @@ if { [skip_python_tests] } {
}
if ![runto_main ] then {
fail "can't run to main"
return -1
}

View file

@ -36,7 +36,6 @@ if { [skip_python_tests] } {
}
if ![runto_main ] then {
fail "can't run to main"
return -1
}

View file

@ -41,7 +41,6 @@ gdb_test "source ${pyfile}" "Python script imported" \
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -30,7 +30,6 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile \
if {[skip_python_tests]} { continue }
if {![runto_main]} {
untested "couldn't run to main"
return -1
}

View file

@ -49,7 +49,6 @@ if { [skip_python_tests] } { continue }
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -105,7 +105,6 @@ gdb_test "python print (gdb.lookup_static_symbol ('qq') is None)" \
"True" "lookup_static_symbol for global var"
if ![runto_main] then {
fail "can't run to main"
return 0
}
@ -214,7 +213,6 @@ gdb_test "python print (gdb.lookup_static_symbol ('(anonymous namespace)::anon')
"10" "print value of anon"
if ![runto_main] then {
fail "can't run to main"
return 0
}
@ -243,7 +241,6 @@ gdb_test "python print (cplusfunc.addr_class == gdb.SYMBOL_LOC_BLOCK)" "True" "t
# Start with a fresh gdb.
clean_restart ${binfile}
if ![runto_main] then {
fail "cannot run to main."
return 0
}

View file

@ -28,7 +28,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -30,7 +30,6 @@ if { [skip_python_tests] } { continue }
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -30,7 +30,6 @@ if { [skip_python_tests] } { continue }
set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
if ![runto_main ] then {
fail "can't run to main"
return -1
}

View file

@ -48,7 +48,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
if { [skip_python_tests] } { continue }
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -38,7 +38,6 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { continue }
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -624,7 +624,6 @@ test_add_to_history
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}

View file

@ -218,7 +218,6 @@ clean_restart ${testfile}
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}
@ -433,7 +432,6 @@ clean_restart ${testfile}
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}
@ -489,7 +487,6 @@ clean_restart ${testfile}
# The following tests require execution.
if ![runto_main] then {
fail "can't run to main"
return 0
}