Revert call to bfd_cache_close().
[deliverable/binutils-gdb.git] / gdb / varobj.c
index 6528bcb89f225cb6ff29c3f7295bc116ba72b30e..40bc209de3ef0eb14a664c44738d7e3d24f460d2 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the GDB variable objects API.
-   Copyright 1999, 2000 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@
 #include "value.h"
 #include "expression.h"
 #include "frame.h"
-#include "valprint.h"
 #include "language.h"
 #include "wrapper.h"
 #include "gdbcmd.h"
@@ -391,11 +390,6 @@ static int rootcount = 0;  /* number of root varobjs in the list */
 /* Pointer to the varobj hash table (built at run time) */
 static struct vlist **varobj_table;
 
-#if defined(FREEIF)
-#undef FREEIF
-#endif
-#define FREEIF(x) if (x != NULL) free((char *) (x))
-
 /* Is the variable X one of our "fake" children? */
 #define CPLUS_FAKE_CHILD(x) \
 ((x) != NULL && (x)->type == NULL && (x)->value == NULL)
@@ -788,7 +782,7 @@ varobj_set_value (struct varobj *var, char *expression)
       if (!gdb_evaluate_expression (exp, &value))
        {
          /* We cannot proceed without a valid expression. */
-         FREEIF (exp);
+         xfree (exp);
          return 0;
        }
 
@@ -1065,7 +1059,7 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp, struct varobj *var,
        vc->child->parent = NULL;
       delete_variable_1 (resultp, delcountp, vc->child, 0, only_children_p);
       next = vc->next;
-      free (vc);
+      xfree (vc);
     }
 
   /* if we were called to delete only the children we are done here */
@@ -1077,7 +1071,7 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp, struct varobj *var,
      yet been installed, don't report it, it belongs to the caller... */
   if (var->obj_name != NULL)
     {
-      cppush (resultp, strdup (var->obj_name));
+      cppush (resultp, xstrdup (var->obj_name));
       *delcountp = *delcountp + 1;
     }
 
@@ -1182,7 +1176,7 @@ uninstall_variable (struct varobj *var)
   else
     prev->next = cv->next;
 
-  free (cv);
+  xfree (cv);
 
   /* If root, remove varobj from root list */
   if (var->root->rootvar == var)
@@ -1353,12 +1347,12 @@ free_variable (struct varobj *var)
   if (var->root->rootvar == var)
     {
       free_current_contents ((char **) &var->root->exp);
-      FREEIF (var->root);
+      xfree (var->root);
     }
 
-  FREEIF (var->name);
-  FREEIF (var->obj_name);
-  FREEIF (var);
+  xfree (var->name);
+  xfree (var->obj_name);
+  xfree (var);
 }
 
 static void
@@ -1507,7 +1501,7 @@ vpop (struct vstack **pstack)
   s = *pstack;
   v = s->var;
   *pstack = (*pstack)->next;
-  free (s);
+  xfree (s);
 
   return v;
 }
@@ -1537,7 +1531,7 @@ cppop (struct cpstack **pstack)
   s = *pstack;
   v = s->name;
   *pstack = (*pstack)->next;
-  free (s);
+  xfree (s);
 
   return v;
 }
This page took 0.025539 seconds and 4 git commands to generate.