summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-breakpoint.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-05-19 15:51:00 -0600
committerTom Tromey <tom@tromey.com>2016-07-13 13:21:00 -0600
commit93daf339a4d9496ecde15d3b1e852fbdb38c07d0 (patch)
tree6d1b762e04a3b9cbd963284be33ccfdb7c3f9249 /gdb/testsuite/gdb.python/py-breakpoint.exp
parent43684a7b844bce64735940b55b667f7086fa3d44 (diff)
downloadbinutils-gdb-93daf339a4d9496ecde15d3b1e852fbdb38c07d0.tar.gz
PR python/17698 - add Breakpoint.pending
This patch adds a "pending" attribute to gdb.Breakpoint. Built and regtested on x86-64 Fedora 23. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * NEWS: Update. * python/py-breakpoint.c (bppy_get_pending): New function. (breakpoint_object_getset): Add entry for "pending". * breakpoint.h (pending_breakpoint_p): Declare. * breakpoint.c (pending_breakpoint_p): New function. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * python.texi (Breakpoints In Python): Document Breakpoint.pending. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * gdb.python/py-breakpoint.exp (test_bkpt_basic): Add "pending" test. (test_watchpoints): Likewise. (test_bkpt_pending): New proc.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-breakpoint.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-breakpoint.exp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index f501aa91d8a..eb8ec886692 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -49,6 +49,8 @@ proc test_bkpt_basic { } {
"<gdb.Breakpoint object at $hex>" "Check obj exists @main"
gdb_test "python print (blist\[0\].location)" \
"main." "Check breakpoint location @main"
+ gdb_test "python print (blist\[0\].pending)" "False" \
+ "Check pending status of main breakpoint"
set mult_line [gdb_get_line_number "Break at multiply."]
gdb_breakpoint ${mult_line}
@@ -267,6 +269,7 @@ proc test_watchpoints { } {
gdb_py_test_silent_cmd "python wp1 = gdb.Breakpoint (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE )" \
"Set watchpoint" 0
+ gdb_test "python print (wp1.pending)" "False"
gdb_test "continue" \
".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*main.*" \
"Test watchpoint write"
@@ -497,6 +500,13 @@ proc test_bkpt_address {} {
".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
}
+proc test_bkpt_pending {} {
+ delete_breakpoints
+ gdb_breakpoint "nosuchfunction" allow-pending
+ gdb_test "python print (gdb.breakpoints()\[0\].pending)" "True" \
+ "Check pending status of pending breakpoint"
+}
+
test_bkpt_basic
test_bkpt_deletion
test_bkpt_cond_and_cmds
@@ -506,3 +516,4 @@ test_bkpt_internal
test_bkpt_eval_funcs
test_bkpt_temporary
test_bkpt_address
+test_bkpt_pending