From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [RFA 2/2] Modify gdb.base/commands.exp to test multi breakpoint command setting/clearing.
Date: Thu, 02 Aug 2018 21:26:00 -0000 [thread overview]
Message-ID: <20180802212613.29813-3-philippe.waroquiers@skynet.be> (raw)
In-Reply-To: <20180802212613.29813-1-philippe.waroquiers@skynet.be>
gdb/testsuite/ChangeLog
2018-08-02 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/commands.exp: Test multi breakpoints setting
and clearing.
---
gdb/testsuite/gdb.base/commands.exp | 44 +++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index 259b89b803..57d9348244 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -281,6 +281,49 @@ proc_with_prefix breakpoint_command_test {} {
gdb_test "print value" " = 5"
}
+# Test clearing the commands of several breakpoints with one single "end".
+# As this test uses breakpoint numbers, we better run it first to ensure
+# the breakpoint numbers are not changing if other tests are added/changed
+# so that breakpoint numbers are also changed.
+proc_with_prefix run_me_first_breakpoint_clear_command_test {} {
+ # The below creates breakpoint nr 1.
+ runto_or_return factorial
+
+ set any "\[^\r\n\]*"
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*"
+ gdb_test "break main" "Breakpoint.*at.*"
+ gdb_test \
+ [multi_line_input \
+ {commands 2 3} \
+ { print 1234321} \
+ {end}] \
+ "End with.*" \
+ "commands"
+ gdb_test "info breakpoints" \
+ [multi_line \
+ "${any}What${any}" \
+ "${any}in factorial${any}" \
+ "${any}print 1234321${any}" \
+ "${any}in main${any}" \
+ "${any}print 1234321${any}" \
+ ] \
+ "check print 1234321 is there."
+ gdb_test \
+ [multi_line_input \
+ {commands 2 3} \
+ {end}] \
+ "End with.*" \
+ "commands"
+ gdb_test "info breakpoints" \
+ [multi_line \
+ "${any}What${any}" \
+ "${any}in factorial${any}" \
+ "${any}in main${any}" \
+ ] \
+ "check print 1234321 is not there anymore."
+ }
+
# Test a simple user defined command (with arguments)
proc_with_prefix user_defined_command_test {} {
global valnum_re
@@ -1125,6 +1168,7 @@ proc_with_prefix backslash_in_multi_line_command_test {} {
gdb_test "print 1" "" "run command"
}
+run_me_first_breakpoint_clear_command_test
gdbvar_simple_if_test
gdbvar_simple_while_test
gdbvar_complex_if_while_test
--
2.18.0
next prev parent reply other threads:[~2018-08-02 21:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 21:26 RFA Fix regressions for multi breakpoints command line setting/clearing Philippe Waroquiers
2018-08-02 21:26 ` Philippe Waroquiers [this message]
2018-08-16 15:54 ` [RFA 2/2] Modify gdb.base/commands.exp to test multi breakpoint command setting/clearing Pedro Alves
2018-08-02 21:26 ` [RFA 1/2] Fix regressions for multi breakpoints command line setting/clearing Philippe Waroquiers
2018-08-03 18:29 ` Tom Tromey
2018-08-09 4:57 ` Tom Tromey
2018-08-09 20:20 ` Philippe Waroquiers
2018-08-10 0:35 ` Tom Tromey
2018-08-10 3:05 ` Tom Tromey
2018-08-10 3:13 ` Tom Tromey
2018-08-10 16:07 ` Tom Tromey
2018-08-11 20:38 ` Tom Tromey
2018-08-13 21:32 ` Philippe Waroquiers
2018-08-14 15:02 ` Pedro Alves
2018-08-14 18:33 ` Tom Tromey
2018-08-15 18:24 ` Tom Tromey
2018-08-16 15:34 ` Pedro Alves
2018-08-17 23:12 ` Tom Tromey
2018-08-21 18:01 ` Tom Tromey
2018-08-25 19:17 ` Philippe Waroquiers
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=20180802212613.29813-3-philippe.waroquiers@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=gdb-patches@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).