diff options
author | Tom Tromey <tom@tromey.com> | 2016-05-19 15:52:52 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-07-13 13:20:59 -0600 |
commit | 43684a7b844bce64735940b55b667f7086fa3d44 (patch) | |
tree | 25390da3dd7000fc5254800f61c4b467fedf1a1c | |
parent | cda75e7050781403875413a57c5700e67b1c6269 (diff) | |
download | gdb-43684a7b844bce64735940b55b667f7086fa3d44.zip gdb-43684a7b844bce64735940b55b667f7086fa3d44.tar.gz gdb-43684a7b844bce64735940b55b667f7086fa3d44.tar.bz2 |
use user_breakpoint_p in python code
I noticed that bppy_get_visibility and gdbpy_breakpoint_created
implemented their own visibility checks, but subtly different from
user_breakpoint_p. I think the latter is more correct, and so changed
the Python code to use it.
I suspect there isn't a decent way to test this, so no new test.
Built and regtested on x86-64 Fedora 23.
2016-07-13 Tom Tromey <tom@tromey.com>
* python/py-breakpoint.c (bppy_get_visibility)
(gdbpy_breakpoint_created): Use user_breakpoint_p.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-breakpoint.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 65adae1..437f4a5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-07-13 Tom Tromey <tom@tromey.com> + * python/py-breakpoint.c (bppy_get_visibility) + (gdbpy_breakpoint_created): Use user_breakpoint_p. + +2016-07-13 Tom Tromey <tom@tromey.com> + PR cli/18053: * jit.c (jit_reader_load_command): Use tilde_expand. (_initialize_jit): Fix help for jit-reader-unload. Set completer diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 5918bcc..513a02d 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -540,10 +540,10 @@ bppy_get_visibility (PyObject *self, void *closure) BPPY_REQUIRE_VALID (self_bp); - if (self_bp->bp->number < 0) - Py_RETURN_FALSE; + if (user_breakpoint_p (self_bp->bp)) + Py_RETURN_TRUE; - Py_RETURN_TRUE; + Py_RETURN_FALSE; } /* Python function to determine if the breakpoint is a temporary @@ -863,7 +863,7 @@ gdbpy_breakpoint_created (struct breakpoint *bp) gdbpy_breakpoint_object *newbp; PyGILState_STATE state; - if (bp->number < 0 && bppy_pending_object == NULL) + if (!user_breakpoint_p (bp) && bppy_pending_object == NULL) return; if (bp->type != bp_breakpoint |