From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 2/3] use user_breakpoint_p in python code
Date: Thu, 19 May 2016 22:06:00 -0000 [thread overview]
Message-ID: <1463695563-4130-3-git-send-email-tom@tromey.com> (raw)
In-Reply-To: <1463695563-4130-1-git-send-email-tom@tromey.com>
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-05-19 Tom Tromey <tom@tromey.com>
* python/py-breakpoint.c (bppy_get_visibility)
(gdbpy_breakpoint_created): Use user_breakpoint_p.
---
gdb/ChangeLog | 5 +++++
gdb/python/py-breakpoint.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0968b85..a03d290 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-19 Tom Tromey <tom@tromey.com>
+
+ * python/py-breakpoint.c (bppy_get_visibility)
+ (gdbpy_breakpoint_created): Use user_breakpoint_p.
+
2016-05-19 Andreas Schwab <schwab@suse.de>
* ia64-libunwind-tdep.c (libunwind_descr): Add cast from void *.
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 611a41e..f86da8d 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
@@ -862,7 +862,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
--
2.5.5
next prev parent reply other threads:[~2016-05-19 22:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 22:06 [RFA 0/4] Add "pending" attribute to gdb.Breakpoint Tom Tromey
2016-05-19 22:06 ` [RFA 3/3] PR python/17698 - add Breakpoint.pending Tom Tromey
2016-05-20 5:46 ` Eli Zaretskii
2016-05-20 14:29 ` Phil Muldoon
2016-07-13 8:16 ` Yao Qi
2016-05-19 22:06 ` Tom Tromey [this message]
2016-05-20 14:30 ` [RFA 2/3] use user_breakpoint_p in python code Phil Muldoon
2016-07-13 8:09 ` Yao Qi
2016-05-19 22:06 ` [RFA 1/3] Rearrange Python breakpoint node in documentation Tom Tromey
2016-05-20 5:45 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463695563-4130-3-git-send-email-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox