From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id B244F3839C5A; Thu, 24 Nov 2022 15:22:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B244F3839C5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669303374; bh=/9ZNftvVwh11NQGv9sEdMol5UbInYKBNnGodSxarRHQ=; h=From:To:Subject:Date:From; b=ebZRwPUZLVtiW1Ahr0khaLSpE8i/GYDsZHBV7ydWMX8bFJ520aj4q2vVSG6mv3fKH 2rfqjRQ2UlAFshH6n6ATbJfgqfREBnnCOg42F4tGuIns08+FHK7OEYvRx8TMeLxdgx cVSPET0UOHUHEsyHcTVgP5bTBFy1p73MCEdVVGWk= 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_break_commands_clear X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 0075c53724f78c78aa1692cc8e3bf1433eeb0b9f X-Git-Newrev: 4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163 Message-Id: <20221124152254.B244F3839C5A@sourceware.org> Date: Thu, 24 Nov 2022 15:22:54 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4d70f72ee0c4= ee7798aae1ed8c8a6f155cf85163 commit 4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163 Author: Simon Marchi Date: Wed Nov 23 13:39:46 2022 -0500 gdb/testsuite/gdb.base/break.exp: split test_break_commands_clear =20 Change-Id: Ia58f90117d52fc419fc494836d9b4ed5d902fe9b Approved-By: Kevin Buettner Diff: --- gdb/testsuite/gdb.base/break.exp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/brea= k.exp index cb5831ac610..c0756cdccc2 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -897,13 +897,21 @@ with_test_prefix "set line:file breakpoint via conven= ience variable" { "non-integer convenience variable disallowed" } =20 -# # Test that commands can be cleared without error. -# =20 -gdb_test "commands\nprint 232323\nend" ">end" "set some breakpoint command= s" -gdb_test "commands\nend" ">end" "clear breakpoint commands" -# We verify that the commands were cleared by ensuring that the last -# breakpoint's location ends the output -- if there were commands, -# they would have been printed after the location. -gdb_test "info break" "$srcfile:$line_actual" "verify that they were clear= ed" +proc_with_prefix test_break_commands_clear {} { + clean_restart breako2 + + set line [gdb_get_line_number "set breakpoint 1 here"] + gdb_breakpoint $line + + gdb_test "commands\nprint 232323\nend" ">end" "set some breakpoint com= mands" + gdb_test "commands\nend" ">end" "clear breakpoint commands" + + # We verify that the commands were cleared by ensuring that the last + # breakpoint's location ends the output -- if there were commands, + # they would have been printed after the location. + gdb_test "info break" "$::srcfile:$::decimal" "verify that they were c= leared" +} + +test_break_commands_clear