use user_breakpoint_p in python code
authorTom Tromey <tom@tromey.com>
Thu, 19 May 2016 21:52:52 +0000 (15:52 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 13 Jul 2016 19:20:59 +0000 (13:20 -0600)
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.

gdb/ChangeLog
gdb/python/py-breakpoint.c

index 65adae17bc873fa425fde2e252cf50f937280f14..437f4a5ca7677528d2a9a4de4b2d960346ee7f21 100644 (file)
@@ -1,3 +1,8 @@
+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:
index 5918bcc8f059c8029ec2d40c33f95c0ab2cc8f7a..513a02d08f261a101d6409310061c7e1862930d1 100644 (file)
@@ -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
This page took 0.029821 seconds and 4 git commands to generate.