public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/testsuite/gdb.base/break.exp: split test_finish_arguments
Date: Thu, 24 Nov 2022 15:23:20 +0000 (GMT)	[thread overview]
Message-ID: <20221124152320.1B3CC3830B0A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2994ead4a09df4e386c989ea4a61bf142be01892

commit 2994ead4a09df4e386c989ea4a61bf142be01892
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Wed Nov 23 13:39:51 2022 -0500

    gdb/testsuite/gdb.base/break.exp: split test_finish_arguments
    
    Change-Id: Id84babed1eeb3ce7d14b94ff332795964e8ead51
    Approved-By: Kevin Buettner <kevinb@redhat.com>

Diff:
---
 gdb/testsuite/gdb.base/break.exp | 50 ++++++++++++++++++++++------------------
 1 file 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
+
 #********

                 reply	other threads:[~2022-11-24 15:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221124152320.1B3CC3830B0A@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).