From: Kevin Pouget <kevin.pouget@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, pmuldoon@redhat.com
Subject: Re: [PATCH] Add bp_location to Python interface
Date: Tue, 10 Jan 2012 16:03:00 -0000 [thread overview]
Message-ID: <CAPftXUJN-yP5JvDw0iX=fFQNC9_coCGYN6v7nUtidYn+iu5pEA@mail.gmail.com> (raw)
In-Reply-To: <CAPftXULwT9pTagJOzVsDjtdFkcoFwTWm3gs0=a=EYzMbZYHPgA@mail.gmail.com>
On Tue, Jan 10, 2012 at 3:50 PM, Kevin Pouget <kevin.pouget@gmail.com> wrote:
> On Mon, Jan 9, 2012 at 6:23 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> From: Kevin Pouget <kevin.pouget@gmail.com>
>>> Date: Mon, 9 Jan 2012 12:46:30 +0100
>>> Cc: pmuldoon@redhat.com
>>>
>>> ping
>>
>> Sorry for missing it the first time.
>
> no problem, thanks for your feedbacks, I replied inline
>
>>> --- 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"
>
> fixed
>
>>> +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".
>
> fixed
>
>> 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.
>
> That's a point Phil also noted so I've try to explain it a bit
> further, although my knowledge about the internal mechanisms involved
> is quite limited. A maintainer will have to confirm these words. I
> also mentioned explicitly that it's the *objects* related to the
> locations which are volatile, because the location (ie, address)
> itself actually doesn't change:
>
>> Please note that breakpoint location objects are very volatile entities in
>> @value{GDBN}, so one should avoid keeping references to them. They can be
>> destructed and recreated on any breakpoint creation and deletion, shared-
>> library event, inferior function call, @dots{}
>
>
>
>>> +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.
>
> No, "one-to-many" is what I meant, I've changed it (spelled with the
> dashes, right?)
>
>>> +This attribute holds a reference to the @code{gdb.Inferior} inferior object
>>
>> I'd drop the second instance of "inferior", it looks redundant.
>
> dropped
>
>>> +@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?
>
> that's already discussed above, but I don't want you to be scared, so
> let me explain what I meant:
> it's not "at any moment", but rather "after any call to GDB's Python
> interface". We may want to say that it's only breakpoint or
> execution-related calls, but _I_ can't ensure that this is true, and
> it 'might' change in the future:
>
>> A @code{gdb.BpLocation} object may be invalidated during
>> any call to @{GDB}'s API for internal reasons (for instance, but not limited to,
>> breakpoint or execution-related mechanisms).
Sorry there is a missing 'value' in @{GDB} here and in the patch, it
will be fixed for the next submission.
And a typo,
> @defvar BpLocation.owner
> ... even if two breakpoints are set on at same address.
I removed the redundant 'on'.
Kevin
> (I'm not sure what's the right Python term here for 'mechanisms',
> reading/writing an attribute may trigger internal functions, so 'call'
> or 'function' seem not to suit very well)
>
>
> Cordially,
>
> Kevin
next prev parent reply other threads:[~2012-01-10 15:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 10:17 Kevin Pouget
2011-12-08 13:39 ` Phil Muldoon
2011-12-08 14:28 ` Kevin Pouget
2011-12-08 14:56 ` Phil Muldoon
2011-12-09 13:49 ` Kevin Pouget
2011-12-09 14:15 ` Phil Muldoon
2011-12-13 15:55 ` Kevin Pouget
2012-01-09 11:47 ` Kevin Pouget
2012-01-09 17:23 ` Eli Zaretskii
2012-01-10 15:09 ` Kevin Pouget
2012-01-10 16:03 ` Kevin Pouget [this message]
2012-01-10 17:25 ` Eli Zaretskii
2012-01-11 10:16 ` Kevin Pouget
2012-01-11 10:27 ` Eli Zaretskii
2012-01-10 22:24 ` Doug Evans
2012-01-11 9:05 ` Kevin Pouget
2012-01-11 19:45 ` Doug Evans
2012-01-27 13:04 ` Kevin Pouget
2012-03-30 19:51 ` Tom Tromey
2012-04-03 10:35 ` Kevin Pouget
2012-04-03 12:15 ` Phil Muldoon
2012-04-03 14:43 ` Paul_Koning
2012-04-04 8:36 ` Kevin Pouget
2012-05-09 7:18 ` Kevin Pouget
2012-04-05 16:27 ` 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='CAPftXUJN-yP5JvDw0iX=fFQNC9_coCGYN6v7nUtidYn+iu5pEA@mail.gmail.com' \
--to=kevin.pouget@gmail.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
/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