From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20771 invoked by alias); 9 Jan 2012 17:23:17 -0000 Received: (qmail 20747 invoked by uid 22791); 9 Jan 2012 17:23:14 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Jan 2012 17:23:01 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LXJ00N00K3B4Y00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Mon, 09 Jan 2012 19:23:00 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.34.201]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LXJ0040YKAA7UC5@a-mtaout20.012.net.il>; Mon, 09 Jan 2012 19:23:00 +0200 (IST) Date: Mon, 09 Jan 2012 17:23:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Add bp_location to Python interface In-reply-to: To: Kevin Pouget Cc: gdb-patches@sourceware.org, pmuldoon@redhat.com Reply-to: Eli Zaretskii Message-id: <83r4z8eqoa.fsf@gnu.org> References: X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00277.txt.bz2 > From: Kevin Pouget > Date: Mon, 9 Jan 2012 12:46:30 +0100 > Cc: pmuldoon@redhat.com > > ping Sorry for missing it the first time. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -9,6 +9,12 @@ > * The binary "gdbtui" can no longer be built or installed. > Use "gdb -tui" instead. > > +* Python scripting > + > + ** A new method "gdb.Breakpoint.locations" has been added, as well as > + the class gdb.BpLocation to provide further details about breakpoint > + locations. > + This is OK. > +@defun gdb.locations () > +Return a tuple containing a sequence of @code{gdb.BpLocation} objects > +(see below) associated with this breakpoint. A breakpoint with no location > +is a pending breakpoint (@xref{Set Breaks, , pending breakpoints}). @pxref, not @xref, as this cross-reference is inside parentheses. > +A breakpoint location is represented with a @code{gdb.BpLocation} object, ^^^^ "by" > +which offers the following attributes (all read only) and methods. > +Please note that breakpoint locations are very transient entities in > +@value{GDBN}, so one should avoid keeping references to them. I'd use "volatile" instead of "transient". Also, perhaps a sentence or two about _why_ the locations are volatile would help. E.g., if I knew what actions invalidate locations, I could avoid them and leave the locations valid for longer. > +owns this location. This attribute is not writable. From an implementation > +point of view, there is a @code{1 ... n} relation between a breakpoint and "1 ... n" here means one to many? If so, I suggest to say that literally. In any case, "@code{1 ... n}" is not a good idea, because of the whitespace and because we use @dots{} instead of literal periods. If "one to many" is not what you meant, I can suggest how to mark up whatever needs to be written here. > +This attribute holds a reference to the @code{gdb.Inferior} inferior object I'd drop the second instance of "inferior", it looks redundant. > +@defun BpLocation.is_valid () > +Returns @code{True} if the @code{gdb.BpLocation} object is valid, > +@code{False} if not. A @code{gdb.BpLocation} object may be invalidated by > +GDB at any moment for internal reasons. All other @code{gdb.BpLocation} > +methods and attributes will throw an exception if the object is invalid. @value{GDBN} instead of "GDB". In any case, the last 2 sentences sound scary: I could interpret them as meaning I cannot trust the locations at all. If that is indeed so, what use are they? Thanks.