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>
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 @@
}
# 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 @@
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 @@
# 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 @@
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 @@
# 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 @@
# 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]
}