This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python][rfc] Remove unused value_object attribute `owned_by_gdb'.


I noticed that the owned_by_gdb element in value_object can only be set
to 0 in the current code. Is this a remnant of some dropped effort? Any
reason not to commit this patch?

I'll commit it in a few days if no one comments...
Thiago Jung Bauermann
IBM Linux Technology Center

	Remove unused value_object attribute `owned_by_gdb'.
	* python/python-value.c (value_object): Remove owned_by_gdb
	(valpy_dealloc): Remove reference to self->owned_by_gdb.
	(valpy_new): Likewise.
	(value_to_value_object): Likewise.

diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index f3d24d1..b55463c 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -62,7 +62,6 @@ struct value *values_in_python = NULL;
 typedef struct {
   struct value *value;
-  int owned_by_gdb;
   PyObject *address;
 } value_object;
@@ -74,8 +73,7 @@ valpy_dealloc (PyObject *obj)
   value_remove_from_list (&values_in_python, self->value);
-  if (!self->owned_by_gdb)
-    value_free (self->value);
+  value_free (self->value);
   if (self->address)
     /* Use braces to appease gcc warning.  *sigh*  */
@@ -116,7 +114,6 @@ valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords)
   value_obj->value = value;
-  value_obj->owned_by_gdb = 0;
   value_obj->address = NULL;
   release_value (value);
   value_prepend_to_list (&values_in_python, value);
@@ -786,7 +783,6 @@ value_to_value_object (struct value *val)
   if (val_obj != NULL)
       val_obj->value = val;
-      val_obj->owned_by_gdb = 0;
       val_obj->address = NULL;
       release_value (val);
       value_prepend_to_list (&values_in_python, val);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]