Change gdb.Value.address from a method to an attribute.
	* python/python-value.c (value_object): Add `address' element.
	(valpy_dealloc): Decrement reference to self->address if set.
	(valpy_new): Initialize val_obj->address.
	(valpy_address): Rename to ...
	(valpy_get_address): ... this.  Change signature from method to
	attribute.  Update self->address if not set.
	(value_to_value_object): Initialize val_obj->address.
	(value_object_getset): Add `address' element.
	(value_object_methods): Remove `address' element.

gdb/testsuite/
	* gdb.python/python-value.exp: Add tests for the address
	attribute.

gdb/doc/
	* gdb.texinfo (Values From Inferior): Change gdb.Value.address
	from a method to an attribute.
This commit is contained in:
Thiago Jung Bauermann
2009-03-29 21:11:11 +00:00
parent 3cb5190557
commit c0c6f77785
6 changed files with 65 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2009-03-29 Thiago Jung Bauermann <bauerman@br.ibm.com>
* gdb.texinfo (Values From Inferior): Change gdb.Value.address
from a method to an attribute.
2009-03-26 Thiago Jung Bauermann <bauerman@br.ibm.com>
* gdb.texinfo (Values From Inferior): Document is_optimized_out

View File

@ -18325,9 +18325,15 @@ bar = some_val['foo']
Again, @code{bar} will also be a @code{gdb.Value} object.
The following attribute is provided:
The following attributes are provided:
@table @code
@defmethod Value address
If this object is addressable, this read-only attribute holds a
@code{gdb.Value} object representing the address. Otherwise,
this attribute holds @code{None}.
@end defmethod
@cindex optimized out value in Python
@defmethod Value is_optimized_out
This read-only boolean attribute is true if the compiler optimized out