diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-03-29 21:11:11 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-03-29 21:11:11 +0000 |
commit | c0c6f77785d5f523f929919b66cf90bcd273a9fe (patch) | |
tree | edc6c9f326c1edbb4823fff90eadeac7bceb9469 /gdb/testsuite | |
parent | 3cb51905575ddbdc88eee13144b537d222e61cb4 (diff) | |
download | gdb-c0c6f77785d5f523f929919b66cf90bcd273a9fe.zip gdb-c0c6f77785d5f523f929919b66cf90bcd273a9fe.tar.gz gdb-c0c6f77785d5f523f929919b66cf90bcd273a9fe.tar.bz2 |
gdb/
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python-value.exp | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e30eeab..c9eca11 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-03-29 Thiago Jung Bauermann <bauerman@br.ibm.com> + + * gdb.python/python-value.exp: Add tests for the address + attribute. + 2009-03-29 Andreas Schwab <schwab@linux-m68k.org> * gdb.arch/powerpc-prologue.exp: Update for disassemble-next-line. diff --git a/gdb/testsuite/gdb.python/python-value.exp b/gdb/testsuite/gdb.python/python-value.exp index 2d1ece6..b3b5746 100644 --- a/gdb/testsuite/gdb.python/python-value.exp +++ b/gdb/testsuite/gdb.python/python-value.exp @@ -70,6 +70,9 @@ proc test_value_creation {} { gdb_py_test_silent_cmd "python a = gdb.Value (u'unicode test')" "create unicode value" 1 gdb_test "python print a" "\"unicode test\"" "print Unicode string" gdb_test "python print a.__class__" "<type 'gdb.Value'>" "verify type of unicode string" + + # Test address attribute is None in a non-addressable value + gdb_test "python print 'result =', i.address" "= None" "Test address attribute in non-addressable value" } proc test_value_numeric_ops {} { @@ -228,6 +231,9 @@ proc test_value_in_inferior {} { # Smoke-test is_optimized_out attribute gdb_test "python print 'result =', arg0.is_optimized_out" "= False" "Test is_optimized_out attribute" + + # Test address attribute + gdb_test "python print 'result =', arg0.address" "= 0x\[\[:xdigit:\]\]+" "Test address attribute" } |