aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
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/python/py-breakpoint.c
parent43684a7b844bce64735940b55b667f7086fa3d44 (diff)
downloadgdb-93daf339a4d9496ecde15d3b1e852fbdb38c07d0.zip
gdb-93daf339a4d9496ecde15d3b1e852fbdb38c07d0.tar.gz
gdb-93daf339a4d9496ecde15d3b1e852fbdb38c07d0.tar.bz2
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/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 513a02d..f2d4385 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -563,6 +563,24 @@ bppy_get_temporary (PyObject *self, void *closure)
Py_RETURN_FALSE;
}
+/* Python function to determine if the breakpoint is a pending
+ breakpoint. */
+
+static PyObject *
+bppy_get_pending (PyObject *self, void *closure)
+{
+ gdbpy_breakpoint_object *self_bp = (gdbpy_breakpoint_object *) self;
+
+ BPPY_REQUIRE_VALID (self_bp);
+
+ if (is_watchpoint (self_bp->bp))
+ Py_RETURN_FALSE;
+ if (pending_breakpoint_p (self_bp->bp))
+ Py_RETURN_TRUE;
+
+ Py_RETURN_FALSE;
+}
+
/* Python function to get the breakpoint's number. */
static PyObject *
bppy_get_number (PyObject *self, void *closure)
@@ -1054,6 +1072,8 @@ or None if no condition set."},
"Whether the breakpoint is visible to the user."},
{ "temporary", bppy_get_temporary, NULL,
"Whether this breakpoint is a temporary breakpoint."},
+ { "pending", bppy_get_pending, NULL,
+ "Whether this breakpoint is a pending breakpoint."},
{ NULL } /* Sentinel. */
};