aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-22 09:02:23 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-22 09:02:23 +0000
commit74b7792f0fcae41f7c7da524527b7261a3fd68c4 (patch)
treeb88a9a20c59780f3b51c4819b6dea5acce3ec446 /gdb/varobj.c
parent32c092c3fab0ca778242005a793cc4641c3e1b4b (diff)
downloadgdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.zip
gdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.tar.gz
gdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.tar.bz2
Purge (almost) make_cleanup_func.
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 fd61203..9f80145 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. */