diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-breakpoint.exp | 34 |
2 files changed, 38 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 40ff298..11ca125 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-11-07 Phil Muldoon <pmuldoon@redhat.com> + + * gdb.python/py-breakpoint.exp: Add temporary breakpoint tests. + 2013-11-06 Doug Evans <dje@sebabeach.org> * gdb.python/py-arch.exp: Tweak test name for bad memory access test. diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index 687182d..e2a169b 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -300,3 +300,37 @@ gdb_py_test_silent_cmd "python wp1 = wp_eval (\"result\", type=gdb.BP_WATCHPOIN gdb_test "continue" ".*\[Ww\]atchpoint.*result.*Old value =.*New value = 788.*" "Test watchpoint write" gdb_test "python print (never_eval_bp1.count)" "0" \ "Check that this unrelated breakpoints eval function was never called." + +# Test temporary breakpoint + +# Start with a fresh gdb. +clean_restart ${testfile} + +if ![runto_main] then { + fail "Cannot run to main." + return 0 +} +delete_breakpoints +gdb_py_test_multiple "Sub-class and check temporary breakpoint" \ + "python" "" \ + "class temp_bp (gdb.Breakpoint):" "" \ + " count = 0" "" \ + " def stop (self):" "" \ + " self.count = self.count + 1" "" \ + " return True" "" \ + "end" "" +gdb_py_test_silent_cmd "python ibp = temp_bp(\"$ibp_location\", temporary=True)" \ + "Set temporary breakpoint" 0 +gdb_test "info breakpoints" "2.*breakpoint.*del.*py-breakpoint\.c:$ibp_location.*" \ + "Check info breakpoints shows breakpoint with temporary status" +gdb_test "python print (ibp.location)" "py-breakpoint\.c:$ibp_location*" \ + "Check temporary breakpoint location" +gdb_test "python print (ibp.temporary)" "True" \ + "Check breakpoint temporary status" +gdb_continue_to_breakpoint "Break at multiply." ".*/$srcfile:$ibp_location.*" +gdb_test "python print (ibp.count)" "1" \ + "Check temporary stop callback executed before deletion." +gdb_test "python print (ibp.temporary)" "RuntimeError: Breakpoint 2 is invalid.*" \ + "Check temporary breakpoint is deleted after being hit" +gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \ + "Check info breakpoints shows temporary breakpoint is deleted" |