From 4e7a5ef5a84e2f120a52def047ef671f8dbd7954 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 13 Aug 2009 18:39:20 +0000 Subject: * varobj.c (update_dynamic_varobj_children): Don't use value_copy. * value.h: (preserve_one_value): Declare. (value_prepend_to_list, value_remove_from_list): Remove. * value.c (preserve_one_value): No longer static. (preserve_values): Call preserve_python_values. (value_prepend_to_list): Remove. (value_remove_from_list): Remove. * python/python.h (values_in_python): Don't declare. (preserve_python_values): Declare. * python/python-value.c (values_in_python): Change type. Move lower. Now static. (struct value_object): Add struct tag. : New fields. (valpy_dealloc): Update. (note_value): New function. (valpy_new): Use value_incref, note_value. (preserve_python_values): New function. (valpy_positive): Don't use value_copy. (value_to_value_object): Use value_incref, note_value. (convert_value_from_python): Update comment. --- gdb/value.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'gdb/value.c') diff --git a/gdb/value.c b/gdb/value.c index 65a5aa9..97f236c 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -312,31 +312,6 @@ allocate_repeat_value (struct type *type, int count) return allocate_value (array_type); } -/* Needed if another module needs to maintain its on list of values. */ -void -value_prepend_to_list (struct value **head, struct value *val) -{ - val->next = *head; - *head = val; -} - -/* Needed if another module needs to maintain its on list of values. */ -void -value_remove_from_list (struct value **head, struct value *val) -{ - struct value *prev; - - if (*head == val) - *head = (*head)->next; - else - for (prev = *head; prev->next; prev = prev->next) - if (prev->next == val) - { - prev->next = val->next; - break; - } -} - struct value * allocate_computed_value (struct type *type, struct lval_funcs *funcs, @@ -1430,7 +1405,7 @@ add_internal_function (const char *name, const char *doc, /* Update VALUE before discarding OBJFILE. COPIED_TYPES is used to prevent cycles / duplicates. */ -static void +void preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types) { @@ -1490,8 +1465,7 @@ preserve_values (struct objfile *objfile) for (var = internalvars; var; var = var->next) preserve_one_internalvar (var, objfile, copied_types); - for (val = values_in_python; val; val = val->next) - preserve_one_value (val, objfile, copied_types); + preserve_python_values (objfile, copied_types); htab_delete (copied_types); } -- cgit v1.1