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: Phil Muldoon <pmuldoon at redhat dot com>
- To: Paul Koning <paul_koning at Dell dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 16 Mar 2011 20:04:14 +0000
- Subject: Re: [python] [patch] Add is_valid to several classes
- References: <m3sjun9hp7.fsf@redhat.com> <944D0115-C1D1-47F5-B1CD-FE3EC69A2ADC@dell.com>
- Reply-to: pmuldoon at redhat dot com
Paul Koning <paul_koning@Dell.com> writes:
> On Mar 16, 2011, at 12:02 PM, Phil Muldoon wrote:
>
>>
>> ...
>> A @code{gdb.Inferior} object has the following methods:
>>
>> @table @code
>> +@defmethod Inferior is_valid
>> +Returns true if the @code{gdb.Inferior} object is valid, false if
>> +not. A @code{gdb.Inferior} object will become invalid if the inferior
>> +no longer exists within @value{GDBN}. All @code{gdb.Inferior}
>> +methods will throw an exception if it is invalid at the time the
>> +method is called.
>
> Should this be "all other ... methods since presumably it doesn't
> apply to the is_valid() method. Same in the other places.
Yes thanks, noted.
>
>> ...
>> +A @code{gdb.Block} object has the following methods:
>> +
>> +@table @code
>> +@defmethod Block is_valid
>> +Returns true if the @code{gdb.Block} object is valid, false if not. A
>> +block object can become invalid if the block it refers to doesn't
>> +exist anymore in the inferior. All @code{gdb.Block} methods will
>> +throw an exception if it is invalid at the time the method is called.
>> +This method is also made available to the Python iterator object that
>> +@code{gdb.Block} supports via the Python method @code{iter} function.
>
> The iter built-in function, or any iteration context, right? For example, if b is a gdb.Block, you could say "for x in b:", presumably, and then "x.is_valid()" works.
Yep, all iteration contexts that are valid with Python.
Thanks
Phil