summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-11-23 13:39:51 -0500
committerSimon Marchi <simon.marchi@efficios.com>2022-11-24 10:22:40 -0500
commit2994ead4a09df4e386c989ea4a61bf142be01892 (patch)
tree25cbcc7a84c521601bda44331bb7e60bff8bb679 /gdb/testsuite/gdb.base
parent13375d621e8c10f81afebbb986405ce21b049bb1 (diff)
downloadbinutils-gdb-2994ead4a09df4e386c989ea4a61bf142be01892.tar.gz
gdb/testsuite/gdb.base/break.exp: split test_finish_arguments
Change-Id: Id84babed1eeb3ce7d14b94ff332795964e8ead51 Approved-By: Kevin Buettner <kevinb@redhat.com>
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/break.exp50
1 files changed, 28 insertions, 22 deletions
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index a888de8e271..1f6c620ee0c 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -656,35 +656,41 @@ gdb_test_multiple "finish" "finish from called function" {
# Verify that GDB responds gracefully to a "finish" command with
# arguments.
-#
-if ![runto_main] then {
- return
-}
-send_gdb "finish 123\n"
-gdb_expect {
- -re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\
- {pass "finish with arguments disallowed"}
- -re "$gdb_prompt $"\
- {fail "finish with arguments disallowed"}
- timeout {fail "(timeout) finish with arguments disallowed"}
-}
+proc_with_prefix test_finish_arguments {} {
+ clean_restart break
-# Verify that GDB responds gracefully to a request to "finish" from
-# the outermost frame. On a stub that never exits, this will just
-# run to the stubs routine, so we don't get this error... Thus the
-# second condition.
-#
+ if ![runto_main] then {
+ return
+ }
-gdb_test_multiple "finish" "finish from outermost frame disallowed" {
- -re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $" {
- pass "finish from outermost frame disallowed"
+ send_gdb "finish 123\n"
+ gdb_expect {
+ -re "The \"finish\" command does not take any arguments.\r\n$::gdb_prompt $"\
+ {pass "finish with arguments disallowed"}
+ -re "$::gdb_prompt $"\
+ {fail "finish with arguments disallowed"}
+ timeout {fail "(timeout) finish with arguments disallowed"}
}
- -re "Run till exit from.*\r\n$gdb_prompt $" {
- pass "finish from outermost frame disallowed"
+
+ # Verify that GDB responds gracefully to a request to "finish" from
+ # the outermost frame. On a stub that never exits, this will just
+ # run to the stubs routine, so we don't get this error... Thus the
+ # second condition.
+ #
+
+ gdb_test_multiple "finish" "finish from outermost frame disallowed" {
+ -re "\"finish\" not meaningful in the outermost frame.\r\n$::gdb_prompt $" {
+ pass "finish from outermost frame disallowed"
+ }
+ -re "Run till exit from.*\r\n$::gdb_prompt $" {
+ pass "finish from outermost frame disallowed"
+ }
}
}
+test_finish_arguments
+
#********