Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [python] [patch] Add is_valid to several classes
Date: Wed, 16 Mar 2011 20:04:00 -0000	[thread overview]
Message-ID: <m3tyf2vnp6.fsf@redhat.com> (raw)
In-Reply-To: <83r5a6q39z.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Mar	2011 21:22:16 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Phil Muldoon <pmuldoon@redhat.com>
>> Date: Wed, 16 Mar 2011 16:02:44 +0000
>> 
>> --- a/gdb/NEWS
>> +++ b/gdb/NEWS
>> @@ -38,6 +38,10 @@
>>  
>>  * Python scripting
>>  
>> +  ** Symbols, Symbol Table, Symbol Table and Line, Object Files,
>> +     Inferior, Inferior Thread, Blocks, and Block Iterator APIs now
>> +     have an is_valid method.
>> +
>
> This part is okay.

Thanks.


>> +@defmethod Inferior is_valid
>> +Returns true if the @code{gdb.Inferior} object is valid, false if
>            ^^^^                                             ^^^^^
> You mean @code{true} and @code{false}, right?  These are Python
> symbols, aren't they?
>
> Same comment on the other uses of "true" and "false".

As Paul notes, probably should be @code{True} and @code{False} for
Python notation.

>> +A @code{gdb.Objfile} object can become invalid if the object file it
>> +refers to does not exist in @value{GDBN} any longer.
>
> "File does not exist in GDB" sounds awkward: GDB is not a filesystem.
> How about "file is not loaded in GDB" instead?
>
>> +Returns true if the @code{gdb.Block} object is valid, false if not. A

Okay.
                                                                      ^^
> Two spaces.

Oops.

>> +@code{gdb.Block} supports via the Python method @code{iter} function.
>
> Did you really mean to say "Python method `iter' function"?  I think
> either "method" or "function", no?

iter() is a built in Python function (nothing to do with GDB), that
extracts an iterator from a Python object if the object supports it.  I
don't mind how we word it. It was purely illustrative.  In fact in
Python there are many ways to invoke iteration in an object that
supports it.  The "in" keyword for example (IE, for x in y).
What do you think?

>> +A @code{gdb.Symbol} object can become invalid if the symbol it refers
>> +to does not exist in @value{GDBN} any longer.
>
> How can a symbol cease to exist?

The canonical case for this is the "file" command. The test cases in the
patch proves that (and in fact the test case library has a specialized
function: "gdb_unload"). So symbol, symbol tables, symbol table and
line, objfiles will be unloaded in that context.  I'm not sure why a
user would use this case, but the fact that it can exist means we have
to deal with validating the object lifetime.


>> +if not.  A @code{gdb.Symtab_and_line} object can become invalid if the
>> +Symbol table and line object it refers to does not exist in
>> +@value{GDBN} any longer.
>
> Likewise here: does GDB unload symtabs once they were loaded?
>
>> +A @code{gdb.Symtab} object can become invalid if the symbol table it
>> +refers to does not exist in @value{GDBN} any longer.

Thanks

Phil


  parent reply	other threads:[~2011-03-16 20:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 16:46 Phil Muldoon
2011-03-16 17:32 ` Tom Tromey
2011-03-17 12:19   ` Phil Muldoon
2011-03-16 19:26 ` Eli Zaretskii
2011-03-16 19:59   ` Paul Koning
2011-03-16 20:06     ` Phil Muldoon
2011-03-16 20:04   ` Phil Muldoon [this message]
2011-03-16 20:13     ` Eli Zaretskii
2011-03-16 21:50       ` Phil Muldoon
2011-03-16 20:02 ` Paul Koning
2011-03-16 20:08   ` Phil Muldoon
2011-03-16 20:14     ` Paul Koning
2011-03-16 22:01       ` Phil Muldoon
2011-03-16 23:54       ` 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=m3tyf2vnp6.fsf@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=eliz@gnu.org \
    --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