aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-value.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-17 21:23:25 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-17 21:23:25 +0000
commitd59b6f6c38a3e9c229dae40bd6c668be47fe8e48 (patch)
treed3e248c0abb4d8baf265767d9542537bd1b0d373 /gdb/python/py-value.c
parent102040f0d08b06980adf402c17b2f039fee7d23c (diff)
downloadgdb-d59b6f6c38a3e9c229dae40bd6c668be47fe8e48.zip
gdb-d59b6f6c38a3e9c229dae40bd6c668be47fe8e48.tar.gz
gdb-d59b6f6c38a3e9c229dae40bd6c668be47fe8e48.tar.bz2
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 abf50ff..eb20de8 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);
}