From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 1B3CC3830B0A; Thu, 24 Nov 2022 15:23:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B3CC3830B0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669303400; bh=n4XfpVZzysOuQcQWo4+CTkLFnDQgV3CbN/rLvcECBjA=; h=From:To:Subject:Date:From; b=PlAFGrr7O9nS3/dTZ5lYEgfLXxROl82C2lwwPt2DKeHN/N0KdAfC9eb4y5Xlny+sy 2Vquc4nSqRqhPF6+C3JTYHcQHdKMiRD2ROXQEY+2G5aeES6XQXpOqSx6lFKm5IcyeK PQY2V7dca71d9BZvYo041+OM5zsHIpoqBBZHWS2I= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite/gdb.base/break.exp: split test_finish_arguments X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 13375d621e8c10f81afebbb986405ce21b049bb1 X-Git-Newrev: 2994ead4a09df4e386c989ea4a61bf142be01892 Message-Id: <20221124152320.1B3CC3830B0A@sourceware.org> Date: Thu, 24 Nov 2022 15:23:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2994ead4a09d= f4e386c989ea4a61bf142be01892 commit 2994ead4a09df4e386c989ea4a61bf142be01892 Author: Simon Marchi Date: Wed Nov 23 13:39:51 2022 -0500 gdb/testsuite/gdb.base/break.exp: split test_finish_arguments =20 Change-Id: Id84babed1eeb3ce7d14b94ff332795964e8ead51 Approved-By: Kevin Buettner 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/brea= k.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 functi= on" { =20 # Verify that GDB responds gracefully to a "finish" command with # arguments. -# -if ![runto_main] then { - return -} =20 -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 =20 -# 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=20 -# second condition. -# + if ![runto_main] then { + return + } =20 -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_p= rompt $"\ + {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" + } } } =20 +test_finish_arguments + #********