diff options
author | Paul Koning <pkoning@equallogic.com> | 2011-10-03 16:14:39 +0000 |
---|---|---|
committer | Paul Koning <pkoning@equallogic.com> | 2011-10-03 16:14:39 +0000 |
commit | 3fcaed3833ab21b4d36489b7662084a5a9f1e12e (patch) | |
tree | 0e8c79f43519fa32f58ddd70d91b4e86023c38d3 /gdb | |
parent | 34788f4a2b8feaf47fd5bf9c24c6e60f3eb63fc9 (diff) | |
download | gdb-3fcaed3833ab21b4d36489b7662084a5a9f1e12e.zip gdb-3fcaed3833ab21b4d36489b7662084a5a9f1e12e.tar.gz gdb-3fcaed3833ab21b4d36489b7662084a5a9f1e12e.tar.bz2 |
* python/py-value.c (valpy_get_address): Use Py_XINCREF.
(value_to_value_object): Fetch value if it was lazy.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-value.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 931fb05..625bbbb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-10-03 Paul Koning <paul_koning@dell.com> + + * python/py-value.c (valpy_get_address): Use Py_XINCREF. + (value_to_value_object): Fetch value if it was lazy. + 2011-10-02 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup. diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index fc5053a..252d9b9 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -209,7 +209,7 @@ valpy_get_address (PyObject *self, void *closure) val_obj->address = value_to_value_object (res_val); } - Py_INCREF (val_obj->address); + Py_XINCREF (val_obj->address); return val_obj->address; } @@ -1045,7 +1045,15 @@ PyObject * value_to_value_object (struct value *val) { value_object *val_obj; + volatile struct gdb_exception except; + TRY_CATCH (except, RETURN_MASK_ALL) + { + if (value_lazy (val)) + value_fetch_lazy (val); + } + GDB_PY_HANDLE_EXCEPTION (except); + val_obj = PyObject_New (value_object, &value_object_type); if (val_obj != NULL) { |