From 2f339e5ca03c5a89cf333d0cf090e3718d76f113 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 27 Aug 2025 15:54:44 -0400 Subject: gdb/testsuite: remove function parameter from do_self_tests The function to stop at is always main. Remove the parameter and hard-code main in _selftest_setup. Change-Id: Ibbbf598203b1658305eb6bc631d029652c10edac Reviewed-By: Keith Seitz --- gdb/testsuite/gdb.gdb/python-helper.exp | 2 +- gdb/testsuite/gdb.gdb/selftest.exp | 2 +- gdb/testsuite/lib/selftest-support.exp | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp index 7f91278..33243c9 100644 --- a/gdb/testsuite/gdb.gdb/python-helper.exp +++ b/gdb/testsuite/gdb.gdb/python-helper.exp @@ -291,4 +291,4 @@ proc test_python_helper {} { } # Use the self-test framework to run the test. -do_self_tests main test_python_helper +do_self_tests test_python_helper diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 3948fce..f5cea1d 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -167,5 +167,5 @@ proc test_with_self { } { save_vars { INTERNAL_GDBFLAGS } { set INTERNAL_GDBFLAGS [string map {"-q" ""} $INTERNAL_GDBFLAGS] - do_self_tests main test_with_self + do_self_tests test_with_self } diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp index 7de6aea..1a042e1 100644 --- a/gdb/testsuite/lib/selftest-support.exp +++ b/gdb/testsuite/lib/selftest-support.exp @@ -38,12 +38,10 @@ proc _selftest_find_gdb { arg } { # A helper proc that sets up for self-testing. # EXECUTABLE is the gdb to use. -# FUNCTION is the function to break in, either captured_main -# or captured_command_loop. # Return 0 in case of success, -1 in case of failure, and -2 in case of # skipping the test-case. -proc _selftest_setup { executable function } { +proc _selftest_setup { executable } { global gdb_prompt global INTERNAL_GDBFLAGS @@ -63,7 +61,8 @@ proc _selftest_setup { executable function } { return -2 } - # Set a breakpoint at $function. + # Set a breakpoint at main + set function main if { [gdb_breakpoint $function "no-message"] != 1 } { untested "Cannot set breakpoint at $function, skipping testcase." return -2 @@ -158,7 +157,7 @@ proc selftest_prepare {} { # A simple way to run some self-tests. -proc do_self_tests {function body} { +proc do_self_tests {body} { set file [selftest_prepare] if { $file eq "" } { return @@ -170,7 +169,7 @@ proc do_self_tests {function body} { # time, especially if the build is non-optimized. Bump the timeout for the # duration of the test. with_timeout_factor 10 { - set result [_selftest_setup $file $function] + set result [_selftest_setup $file] if {$result == 0} { set result [uplevel $body] } -- cgit v1.1