summaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index fd6120391a4..9f80145b222 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -180,6 +180,8 @@ static struct varobj *new_root_variable PARAMS ((void));
static void free_variable PARAMS ((struct varobj * var));
+static struct cleanup *make_cleanup_free_variable (struct varobj *var);
+
static struct type *get_type PARAMS ((struct varobj * var));
static struct type *get_type_deref PARAMS ((struct varobj * var));
@@ -416,7 +418,7 @@ varobj_create (char *objname,
/* Fill out a varobj structure for the (root) variable being constructed. */
var = new_root_variable ();
- old_chain = make_cleanup ((make_cleanup_func) free_variable, var);
+ old_chain = make_cleanup_free_variable (var);
if (expression != NULL)
{
@@ -1373,6 +1375,18 @@ free_variable (var)
FREEIF (var);
}
+static void
+do_free_variable_cleanup (void *var)
+{
+ free_variable (var);
+}
+
+static struct cleanup *
+make_cleanup_free_variable (struct varobj *var)
+{
+ return make_cleanup (do_free_variable_cleanup, var);
+}
+
/* This returns the type of the variable. This skips past typedefs
and returns the real type of the variable. It also dereferences
pointers and references. */