Index: gdb/testsuite/gdb.base/ena-dis-br.exp |
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp |
index 530120dba8caf822aa5ef584f9bf175cb2216e4c..2cf3e9a17d2499e1b03176d59e2a0de1016e1dab 100644 |
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp |
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp |
@@ -16,12 +16,6 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-if $tracelevel then { |
- strace $tracelevel |
-} |
- |
-global usestubs |
- |
# |
# test running programs |
# |
@@ -52,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"] |
@@ -168,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.) |