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_break_commands_clear
Date: Thu, 24 Nov 2022 15:22:54 +0000 (GMT)	[thread overview]
Message-ID: <20221124152254.B244F3839C5A@sourceware.org> (raw)

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

commit 4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Wed Nov 23 13:39:46 2022 -0500

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

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/break.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 convenience variable" {
 	"non-integer convenience variable disallowed"
 }
 
-#
 # Test that commands can be cleared without error.
-#
 
-gdb_test "commands\nprint 232323\nend" ">end" "set some breakpoint commands"
-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 cleared"
+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 commands"
+    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 cleared"
+}
+
+test_break_commands_clear

                 reply	other threads:[~2022-11-24 15:22 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=20221124152254.B244F3839C5A@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).