summaryrefslogtreecommitdiff
path: root/gdb/python/py-value.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2010-05-17 21:23:24 +0000
committerMichael Snyder <msnyder@specifix.com>2010-05-17 21:23:24 +0000
commit170e47f96ba50ff4490f2bad2b8cf4f4e43c23db (patch)
tree51c72cceadcbab961116cf53eef756e4dfaa3134 /gdb/python/py-value.c
parentd9bf14323312dd125063f69cf91853a4739b2621 (diff)
downloadgdb-170e47f96ba50ff4490f2bad2b8cf4f4e43c23db.tar.gz
2010-05-17 Michael Snyder <msnyder@vmware.com>
* python/py-auto-load.c: White space. * python/py-block.c: White space. * python/py-breakpoint.c: White space. * python/py-cmd.c: White space. * python/py-function.c: White space. * python/py-lazy-string.c: White space. * python/py-objfile.c: White space. * python/py-param.c: White space. * python/py-prettyprint.c: White space. * python/py-progspace.c: White space. * python/py-symtab.c: White space. * python/python.c: White space. * python/py-type.c: White space. * python/py-utils.c: White space. * python/py-value.c: White space.
Diffstat (limited to 'gdb/python/py-value.c')
-rw-r--r--gdb/python/py-value.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index abf50ffb7ee..eb20de8cf2f 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -207,6 +207,7 @@ static PyObject *
valpy_get_type (PyObject *self, void *closure)
{
value_object *obj = (value_object *) self;
+
if (!obj->type)
{
obj->type = type_to_type_object (value_type (obj->value));
@@ -356,11 +357,13 @@ valpy_getitem (PyObject *self, PyObject *key)
value code throw an exception if the index has an invalid
type. */
struct value *idx = convert_value_from_python (key);
+
if (idx != NULL)
{
/* Check the value's type is something that can be accessed via
a subscript. */
struct type *type;
+
tmp = coerce_ref (tmp);
type = check_typedef (value_type (tmp));
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
@@ -632,6 +635,7 @@ static PyObject *
valpy_absolute (PyObject *self)
{
struct value *value = ((value_object *) self)->value;
+
if (value_less (value, value_zero (value_type (value), not_lval)))
return valpy_negative (self);
else
@@ -917,6 +921,7 @@ struct value *
value_object_to_value (PyObject *self)
{
value_object *real;
+
if (! PyObject_TypeCheck (self, &value_object_type))
return NULL;
real = (value_object *) self;
@@ -984,6 +989,7 @@ convert_value_from_python (PyObject *obj)
{
PyObject *result;
PyObject *function = PyString_FromString ("value");
+
result = PyObject_CallMethodObjArgs (obj, function, NULL);
value = value_copy (((value_object *) result)->value);
}