This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [python] [patch] Add is_valid to several classes
- From: Eli Zaretskii <eliz at gnu dot org>
- To: pmuldoon at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 16 Mar 2011 21:22:16 +0200
- Subject: Re: [python] [patch] Add is_valid to several classes
- References: <m3sjun9hp7.fsf@redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.
> +@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".
> +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
^^
Two spaces.
> +@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?
> +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?
> +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.
And here.
Thanks.