aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-08-27 15:54:44 -0400
committerSimon Marchi <simon.marchi@efficios.com>2025-08-27 15:57:29 -0400
commit2f339e5ca03c5a89cf333d0cf090e3718d76f113 (patch)
treee59ba5814ad934aed9056fe912cbde170b56f775
parent4a20896e866290797924bd3c531deae4cc3d53ca (diff)
downloadbinutils-2f339e5ca03c5a89cf333d0cf090e3718d76f113.zip
binutils-2f339e5ca03c5a89cf333d0cf090e3718d76f113.tar.gz
binutils-2f339e5ca03c5a89cf333d0cf090e3718d76f113.tar.bz2
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 <keiths@redhat.com>
-rw-r--r--gdb/testsuite/gdb.gdb/python-helper.exp2
-rw-r--r--gdb/testsuite/gdb.gdb/selftest.exp2
-rw-r--r--gdb/testsuite/lib/selftest-support.exp11
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]
}