From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [RFAv2 2/2] Modify gdb.base/commands.exp to test multi breakpoints command clearing.
Date: Sun, 26 Aug 2018 15:47:00 -0000 [thread overview]
Message-ID: <20180826154708.28601-3-philippe.waroquiers@skynet.be> (raw)
In-Reply-To: <20180826154708.28601-1-philippe.waroquiers@skynet.be>
gdb/testsuite/ChangeLog
2018-08-26 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/commands.exp: Test multi breakpoints command clearing.
---
gdb/testsuite/gdb.base/commands.exp | 47 +++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index 259b89b803..52a22bb5dd 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -281,6 +281,48 @@ proc_with_prefix breakpoint_command_test {} {
gdb_test "print value" " = 5"
}
+# Test clearing the commands of several breakpoints with one single "end".
+proc_with_prefix breakpoint_clear_command_test {} {
+ runto_or_return factorial
+
+ set any "\[^\r\n\]*"
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*"
+ gdb_test_no_output "set \$bpnumfactorial = \$bpnum"
+ gdb_test "break main" "Breakpoint.*at.*"
+ gdb_test_no_output "set \$bpnummain = \$bpnum"
+
+ gdb_test \
+ [multi_line_input \
+ {commands $bpnumfactorial $bpnummain} \
+ { print 1234321} \
+ {end}] \
+ "End with.*" \
+ "set commands of two breakpoints to print 1234321"
+ 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}" \
+ ] \
+ "print 1234321 command present in the two breakpoints"
+ gdb_test \
+ [multi_line_input \
+ {commands $bpnumfactorial $bpnummain} \
+ {end}] \
+ "End with.*" \
+ "clear the command list of the two breakpoints"
+ gdb_test "info breakpoints" \
+ [multi_line \
+ "${any}What${any}" \
+ "${any}in factorial${any}" \
+ "${any}in main${any}" \
+ ] \
+ "print 1234321 command is not present anymore in the two breakpoints"
+ }
+
# Test a simple user defined command (with arguments)
proc_with_prefix user_defined_command_test {} {
global valnum_re
@@ -368,8 +410,8 @@ proc_with_prefix user_defined_command_case_sensitivity {} {
gdb_test "print 456\nend" "" "enter commands 2"
- gdb_test "Homer-Simpson" " = 123" "execute command"
- gdb_test "HomeR-SimpsoN" " = 456" "execute command"
+ gdb_test "Homer-Simpson" " = 123" "execute command Homer-Simpson"
+ gdb_test "HomeR-SimpsoN" " = 456" "execute command HomeR-SimpsoN"
gdb_test "HOMER-SIMPSON" "Undefined command.*" "try to call in upper case"
gdb_test "homer-simpson" "Undefined command.*" "try to call in lower case"
}
@@ -1134,6 +1176,7 @@ progvar_complex_if_while_test
if_while_breakpoint_command_test
infrun_breakpoint_command_test
breakpoint_command_test
+breakpoint_clear_command_test
user_defined_command_test
user_defined_command_case_sensitivity
user_defined_command_args_eval
--
2.18.0
next prev parent reply other threads:[~2018-08-26 15:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-26 15:47 [RFAv2 0/2] Fix regression for multi breakpoints command line clearing Philippe Waroquiers
2018-08-26 15:47 ` [RFAv2 1/2] " Philippe Waroquiers
2018-08-28 15:59 ` Tom Tromey
2018-08-28 21:37 ` Philippe Waroquiers
2018-08-26 15:47 ` Philippe Waroquiers [this message]
2018-08-28 16:36 ` [RFAv2 2/2] Modify gdb.base/commands.exp to test multi breakpoints command clearing Tom Tromey
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=20180826154708.28601-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).