]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: remove function parameter from do_self_tests
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 27 Aug 2025 19:54:44 +0000 (15:54 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 27 Aug 2025 19:57:29 +0000 (15:57 -0400)
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 <keiths@redhat.com>
gdb/testsuite/gdb.gdb/python-helper.exp
gdb/testsuite/gdb.gdb/selftest.exp
gdb/testsuite/lib/selftest-support.exp

index 7f91278c5933aa1ea208ecbc1dea4b77fdb191bb..33243c94cf741eed276ddd8568fa2cd452add666 100644 (file)
@@ -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
index 3948fce44a24d4884ad2c0aaac2525447b281caf..f5cea1de10cff19cd90424e7fbc4a21a28125b94 100644 (file)
@@ -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
 }
index 7de6aead8be858af432032be37225b620458a08e..1a042e131107a29eefbbb8bd36d564513584880f 100644 (file)
@@ -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]
        }