diff options
author | Stan Shebs <shebs@codesourcery.com> | 2012-02-14 23:28:15 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 2012-02-14 23:28:15 +0000 |
commit | 816338b5632aeb20e01a18a1d96a59fac6459cd9 (patch) | |
tree | a3b34e55155e514aec5502505fe8f53dd9cc537b /gdb/testsuite | |
parent | 9395078e8d48c8a34db048c8247175e3b90107c6 (diff) | |
download | gdb-816338b5632aeb20e01a18a1d96a59fac6459cd9.zip gdb-816338b5632aeb20e01a18a1d96a59fac6459cd9.tar.gz gdb-816338b5632aeb20e01a18a1d96a59fac6459cd9.tar.bz2 |
2012-02-14 Stan Shebs <stan@codesourcery.com>
* NEWS: Mention enable count command.
* breakpoint.h (struct breakpoint): New field enable_count.
* breakpoint.c (enable_breakpoint_disp): Add count argument.
(enable_breakpoint): Add arg to call.
(struct disp_data): New struct.
(do_enable_breakpoint_disp): Interp arg as disp_data and unpack.
(do_map_enable_once_breakpoint): Create a struct and pass it.
(do_map_enable_delete_breakpoint): Ditto.
(do_map_enable_count_breakpoint): New function.
(enable_count_command): New function.
(bpstat_stop_status): Decrement enable_count.
(print_one_breakpoint_location): Report enable count.
(_initialize_breakpoint): Add enable count command.
* gdb.texinfo (Disabling Breakpoints): Document enable count.
* gdb.base/ena-dis-br.exp: Add enable count test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ena-dis-br.exp | 26 |
2 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 35b1df5..463a6ae 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-02-14 Stan Shebs <stan@codesourcery.com> + + * gdb.base/ena-dis-br.exp: Add enable count test. + 2012-02-13 Pedro Alves <palves@redhat.com> * config/mips-idt.exp: Delete. diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp index 2e5cdb1..2cf3e9a 100644 --- a/gdb/testsuite/gdb.base/ena-dis-br.exp +++ b/gdb/testsuite/gdb.base/ena-dis-br.exp @@ -46,6 +46,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] +set bp_location7 [gdb_get_line_number "set breakpoint 7 here"] set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1] set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] @@ -162,6 +163,31 @@ gdb_test "info break $bp" \ "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*" \ "info break marker4" +if ![runto_main] then { + fail "enable/disable break tests suppressed" +} + +# Test enable count by stopping at a location until it is disabled +# and passes through. + +set bp [break_at $bp_location7 "line $bp_location7"] + +set bp2 [break_at marker1 " line ($bp_location15|$bp_location16)"] + +gdb_test_no_output "enable count 2 $bp" "disable break with count" + +gdb_test "continue" \ + ".*factorial .*:$bp_location7.*" \ + "continue from enable count, first time" + +gdb_test "continue" \ + ".*factorial .*:$bp_location7.*" \ + "continue from enable count, second time" + +gdb_test "continue" \ + ".*marker1 .*:($bp_location15|$bp_location16).*" \ + "continue through enable count, now disabled" + # Verify that we can set a breakpoint with an ignore count N, which # should cause the next N triggers of the bp to be ignored. (This is # a flavor of enablement/disablement, after all.) |