aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-03-24 21:24:09 +0000
committerTom Tromey <tromey@redhat.com>2010-03-24 21:24:09 +0000
commit95a42b64a16624a206a54fd5ee20c7a0f4b05606 (patch)
tree4f9b72d8b53d2eb33d1fce94d024ca158692e412 /gdb/testsuite
parent2390201f4bbde371e4a97f149976d335a1aa909c (diff)
downloadgdb-95a42b64a16624a206a54fd5ee20c7a0f4b05606.zip
gdb-95a42b64a16624a206a54fd5ee20c7a0f4b05606.tar.gz
gdb-95a42b64a16624a206a54fd5ee20c7a0f4b05606.tar.bz2
gdb
PR breakpoints/9352: * NEWS: Mention changes to `commands' and `rbreak'. * symtab.c (do_end_rbreak_breakpoints): New function. (rbreak_command): Call start_rbreak_breakpoints; arrange to call end_rbreak_breakpoints. * breakpoint.c (breakpoint_count, tracepoint_count): Now static. (set_breakpoint_count): Likewise. Clear last_was_multi. (multi_start, multi_end, last_was_multi): New globals. (start_rbreak_breakpoints, end_rbreak_breakpoints): New functions. (struct commands_info): New (do_map_commands_command): New function. (commands_command_1): New function. (commands_command): Use it. (commands_from_control_command): Likewise. (do_delete_breakpoint): New function. (delete_command): Use it. (map_breakpoint_numbers): Add 'data' argument. Pass to callback. (do_map_disable_breakpoint): New function. (disable_command): Use it. (do_map_enable_breakpoint): New function. (enable_command): Use it. (enable_once_breakpoint): Add argument. (enable_once_command): Update. (enable_delete_breakpoint): Add argument. (enable_delete_command): Update. (break_command_really): Set last_was_multi when needed. (check_tracepoint_command): Fix formatting. (validate_commands_for_breakpoint): New function. (breakpoint_set_commands): Use it. (tracepoint_save_command): Update. * breakpoint.h (start_rbreak_breakpoints, end_rbreak_breakpoints): Declare. gdb/doc PR breakpoints/9352: * gdb.texinfo (Break Commands): Update. gdb/testsuite PR breakpoints/9352: * gdb.base/default.exp: Update. * gdb.base/commands.exp: Update. * gdb.cp/extern-c.exp: Test setting commands on multiple breakpoints at once.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.base/commands.exp6
-rw-r--r--gdb/testsuite/gdb.base/default.exp2
-rw-r--r--gdb/testsuite/gdb.cp/extern-c.exp19
4 files changed, 31 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5aa6398..d031729 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-24 Tom Tromey <tromey@redhat.com>
+
+ PR breakpoints/9352:
+ * gdb.base/default.exp: Update.
+ * gdb.base/commands.exp: Update.
+ * gdb.cp/extern-c.exp: Test setting commands on multiple
+ breakpoints at once.
+
2010-03-24 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/call-signal-resume.exp, gdb.base/unwindonsignal.exp: Skip
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index 8bb4147..ee3d787 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -299,7 +299,7 @@ proc watchpoint_command_test {} {
send_gdb "commands $wp_id\n"
gdb_expect {
- -re "Type commands for when breakpoint $wp_id is hit, one per line.*>" {
+ -re "Type commands for all specified breakpoints.*>" {
pass "begin commands on watch"
}
-re "$gdb_prompt $" {fail "begin commands on watch"}
@@ -452,7 +452,7 @@ proc bp_deleted_in_command_test {} {
send_gdb "commands\n"
gdb_expect {
- -re "Type commands for when breakpoint .* is hit, one per line.*>" {
+ -re "Type commands for all specified breakpoints.*>" {
pass "begin commands in bp_deleted_in_command_test"
}
-re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_test"}
@@ -519,7 +519,7 @@ proc temporary_breakpoint_commands {} {
send_gdb "commands\n"
gdb_expect {
- -re "Type commands for when breakpoint .* is hit, one per line.*>" {
+ -re "Type commands for all specified breakpoints.*>" {
pass "begin commands in bp_deleted_in_command_test"
}
-re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_test"}
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 808435d..bed00e6 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -100,7 +100,7 @@ gdb_test "cd" "Argument required .new working directory.*" "cd"
gdb_test "clear" "No source file specified..*" "clear"
#test commands
-gdb_test "commands" "No breakpoint number 0..*" "commands"
+gdb_test "commands" "Argument required .one or more breakpoint numbers...*" "commands"
#test condition
gdb_test "condition" "Argument required .breakpoint number.*" "condition"
diff --git a/gdb/testsuite/gdb.cp/extern-c.exp b/gdb/testsuite/gdb.cp/extern-c.exp
index 99b7874..5ad4e9c 100644
--- a/gdb/testsuite/gdb.cp/extern-c.exp
+++ b/gdb/testsuite/gdb.cp/extern-c.exp
@@ -40,7 +40,26 @@ if { [gdb_breakpoint "c_func"] == 1 } {
}
gdb_continue_to_breakpoint "c_func" ".*c_func.*"
+gdb_test "set \$counter = 0" "" "initialize counter"
+
gdb_test "rbreak c_funcs" \
"Breakpoint.* at .*c_funcs_1.*Breakpoint.* at .*c_funcs_2.*"
+
+# Test that "commands" without an argument puts commands on both
+# breakpoints.
+gdb_test_multiple "commands" "set commands on multiple breakpoints" {
+ -re "Type commands for all specified breakpoints\r\nEnd with a line saying just \"end\".\r\n>$" {
+ gdb_test_multiple "set \$counter = \$counter + 1\nend" \
+ "command details for multiple breakpoints" {
+ -re "$gdb_prompt $" {
+ pass "command details for multiple breakpoints"
+ }
+ }
+ pass "set commands on multiple breakpoints"
+ }
+}
+
gdb_continue_to_breakpoint "c_funcs_1" ".*c_funcs_1.*"
+gdb_test "print \$counter" " = 1" "verify counter at first breakpoint"
gdb_continue_to_breakpoint "c_funcs_2" ".*c_funcs_2.*"
+gdb_test "print \$counter" " = 2" "verify counter at second breakpoint"