Replace free() with xfree().
authorKevin Buettner <kevinb@redhat.com>
Fri, 15 Dec 2000 01:01:51 +0000 (01:01 +0000)
committerKevin Buettner <kevinb@redhat.com>
Fri, 15 Dec 2000 01:01:51 +0000 (01:01 +0000)
128 files changed:
gdb/ChangeLog
gdb/alpha-tdep.c
gdb/altos-xdep.c
gdb/arch-utils.c
gdb/arm-xdep.c
gdb/ax-general.c
gdb/bcache.c
gdb/blockframe.c
gdb/breakpoint.c
gdb/buildsym.c
gdb/c-typeprint.c
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/cli/cli-script.c
gdb/cli/cli-setshow.c
gdb/coffread.c
gdb/completer.c
gdb/convex-tdep.c
gdb/convex-xdep.c
gdb/corefile.c
gdb/corelow.c
gdb/cp-valprint.c
gdb/cxux-nat.c
gdb/d10v-tdep.c
gdb/d30v-tdep.c
gdb/dbxread.c
gdb/dcache.c
gdb/defs.h
gdb/demangle.c
gdb/dstread.c
gdb/dve3900-rom.c
gdb/dwarf2read.c
gdb/dwarfread.c
gdb/elfread.c
gdb/environ.c
gdb/event-loop.c
gdb/event-top.c
gdb/exec.c
gdb/f-lang.c
gdb/gdb-events.c
gdb/gdbarch.c
gdb/gdbtypes.c
gdb/gnu-nat.c
gdb/h8500-tdep.c
gdb/hp-psymtab-read.c
gdb/hppah-nat.c
gdb/infcmd.c
gdb/inflow.c
gdb/infrun.c
gdb/infttrace.c
gdb/irix5-nat.c
gdb/jv-typeprint.c
gdb/kod-cisco.c
gdb/kod.c
gdb/language.c
gdb/lin-lwp.c
gdb/lin-thread.c
gdb/linespec.c
gdb/linux-thread.c
gdb/main.c
gdb/maint.c
gdb/mdebugread.c
gdb/mi/mi-cmd-disas.c
gdb/mi/mi-cmd-var.c
gdb/mi/mi-console.c
gdb/mi/mi-main.c
gdb/mi/mi-parse.c
gdb/minsyms.c
gdb/mips-tdep.c
gdb/monitor.c
gdb/nlmread.c
gdb/objfiles.c
gdb/osfsolib.c
gdb/p-valprint.c
gdb/pa64solib.c
gdb/parse.c
gdb/printcmd.c
gdb/proc-service.c
gdb/procfs.c
gdb/pyr-xdep.c
gdb/remote-adapt.c
gdb/remote-bug.c
gdb/remote-eb.c
gdb/remote-es.c
gdb/remote-mips.c
gdb/remote-mm.c
gdb/remote-nindy.c
gdb/remote-rdi.c
gdb/remote-rdp.c
gdb/remote-udi.c
gdb/remote-vx.c
gdb/remote.c
gdb/rs6000-nat.c
gdb/ser-pipe.c
gdb/serial.c
gdb/solib-svr4.c
gdb/solib.c
gdb/somread.c
gdb/somsolib.c
gdb/source.c
gdb/sparcl-tdep.c
gdb/stabsread.c
gdb/stack.c
gdb/sun386-nat.c
gdb/symfile.c
gdb/symmisc.c
gdb/symtab.c
gdb/target.c
gdb/thread-db.c
gdb/thread.c
gdb/top.c
gdb/tracepoint.c
gdb/tui/tui-file.c
gdb/tui/tui.c
gdb/tui/tuiData.c
gdb/tui/tuiLayout.c
gdb/ui-file.c
gdb/ui-out.c
gdb/umax-xdep.c
gdb/utils.c
gdb/valops.c
gdb/valprint.c
gdb/values.c
gdb/varobj.c
gdb/win32-nat.c
gdb/wince.c
gdb/windows-nat.c
gdb/xcoffread.c

index de8ea5c6a542f07faaad7e7171e3b10228e21ee4..56655c6c10838ff182e933646daf16d6957aff4d 100644 (file)
@@ -1,3 +1,4 @@
+2000-12-14  Kevin Buettner  <kevinb@redhat.com>
 2000-12-14  J.T. Conklin  <jtc@redback.com>
 
        * configure.tgt (hppa*-*-bsd*, hppa*-*-osf*, m68*-*-sunos4*,
index f54a11d02fd456f7e6e8e946e339eae731bdc9d7..571c3d6257575f1925f27c24ec5c9512abcb8e84 100644 (file)
@@ -1154,7 +1154,7 @@ alpha_pop_frame (void)
       else
        linked_proc_desc_table = pi_ptr->next;
 
-      free (pi_ptr);
+      xfree (pi_ptr);
     }
 }
 \f
index bc7245a9352277e22037250e3f7fd5e34f7a0986..2ccefacf03dfbfc4c15be718f683f4f1b00845ea 100644 (file)
@@ -59,7 +59,7 @@
 /* OBSOLETE      and mark data and stack spaces as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (corefile) */
-/* OBSOLETE     free (corefile); */
+/* OBSOLETE     xfree (corefile); */
 /* OBSOLETE   corefile = 0; */
 /* OBSOLETE  */
 /* OBSOLETE   if (corechan >= 0) */
@@ -76,7 +76,7 @@
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
 /* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
index 6b3484d683b7a74c49eda2090defc5ee3b116acc..7a806287cef73f4c1fac2cc0f82910f1b37fa3f6 100644 (file)
@@ -534,7 +534,7 @@ info_architecture (char *args, int from_tty)
        {
          printf_filtered (" %s", *arch);
        }
-      free (arches);
+      xfree (arches);
     }
   else
     {
index 64ca9003665e0f978924d62a7933e9ac501f3d9b..b38d26c0b9a0e52b1dc69856d71e74cb4b2d962d 100644 (file)
 /* OBSOLETE      and mark data and stack spaces as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (corefile) */
-/* OBSOLETE     free (corefile); */
+/* OBSOLETE     xfree (corefile); */
 /* OBSOLETE   corefile = 0; */
 /* OBSOLETE  */
 /* OBSOLETE   if (corechan >= 0) */
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE  */
 /* OBSOLETE       if (have_inferior_p ()) */
 /* OBSOLETE    error ("To look at a core file, you must kill the program with \"kill\"."); */
 /* OBSOLETE      Mark text segment as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (execfile) */
-/* OBSOLETE     free (execfile); */
+/* OBSOLETE     xfree (execfile); */
 /* OBSOLETE   execfile = 0; */
 /* OBSOLETE   data_start = 0; */
 /* OBSOLETE   data_end -= exec_data_start; */
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE  */
 /* OBSOLETE       execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, */
 /* OBSOLETE                    &execfile); */
index 91aefff544287ba0a6386551dc5118315591d879..60e9edf617041440880122912346976ea41e9ca4 100644 (file)
@@ -56,8 +56,8 @@ new_agent_expr (CORE_ADDR scope)
 void
 free_agent_expr (struct agent_expr *x)
 {
-  free (x->buf);
-  free (x);
+  xfree (x->buf);
+  xfree (x);
 }
 
 static void
@@ -416,7 +416,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
       if (ax->buf[i] > (sizeof (aop_map) / sizeof (aop_map[0])))
        {
          reqs->flaw = agent_flaw_bad_instruction;
-         free (reg_mask);
+         xfree (reg_mask);
          return;
        }
 
@@ -425,14 +425,14 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
       if (!op->name)
        {
          reqs->flaw = agent_flaw_bad_instruction;
-         free (reg_mask);
+         xfree (reg_mask);
          return;
        }
 
       if (i + 1 + op->op_size > ax->len)
        {
          reqs->flaw = agent_flaw_incomplete_instruction;
-         free (reg_mask);
+         xfree (reg_mask);
          return;
        }
 
@@ -441,7 +441,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
       if (targets[i] && (heights[i] != height))
        {
          reqs->flaw = agent_flaw_height_mismatch;
-         free (reg_mask);
+         xfree (reg_mask);
          return;
        }
 
@@ -468,7 +468,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
          if (target < 0 || target >= ax->len)
            {
              reqs->flaw = agent_flaw_bad_jump;
-             free (reg_mask);
+             xfree (reg_mask);
              return;
            }
          /* Have we already found other jumps to the same location?  */
@@ -477,7 +477,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
              if (heights[i] != height)
                {
                  reqs->flaw = agent_flaw_height_mismatch;
-                 free (reg_mask);
+                 xfree (reg_mask);
                  return;
                }
            }
@@ -496,7 +496,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
          if (!targets[i + 3])
            {
              reqs->flaw = agent_flaw_hole;
-             free (reg_mask);
+             xfree (reg_mask);
              return;
            }
 
@@ -531,7 +531,7 @@ ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs)
     if (targets[i] && !boundary[i])
       {
        reqs->flaw = agent_flaw_bad_jump;
-       free (reg_mask);
+       xfree (reg_mask);
        return;
       }
 
index fcff55e5ac90b8beacf238da8e08be5311ad3da3..84e64240e87ea9496bd5aca0e49ef7efec99a5a3 100644 (file)
@@ -111,7 +111,7 @@ expand_hash_table (struct bcache *bcache)
 
   /* Plug in the new table.  */
   if (bcache->bucket)
-    free (bcache->bucket);
+    xfree (bcache->bucket);
   bcache->bucket = new_buckets;
   bcache->num_buckets = new_num_buckets;
 }
@@ -173,7 +173,7 @@ free_bcache (struct bcache *bcache)
 {
   obstack_free (&bcache->cache, 0);
   if (bcache->bucket)
-    free (bcache->bucket);
+    xfree (bcache->bucket);
 
   /* This isn't necessary, but at least the bcache is always in a
      consistent state.  */
index b90081393440863c7d260ce7c46ef4461a901f92..8e5bc21ae79f3fb88d9731056d93c7a1a97af012 100644 (file)
@@ -1137,8 +1137,8 @@ generic_push_dummy_frame (void)
     if (INNER_THAN (dummy_frame->fp, fp))      /* stale -- destroy! */
       {
        dummy_frame_stack = dummy_frame->next;
-       free (dummy_frame->registers);
-       free (dummy_frame);
+       xfree (dummy_frame->registers);
+       xfree (dummy_frame);
        dummy_frame = dummy_frame_stack;
       }
     else
@@ -1193,8 +1193,8 @@ generic_pop_dummy_frame (void)
   write_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
   flush_cached_frames ();
 
-  free (dummy_frame->registers);
-  free (dummy_frame);
+  xfree (dummy_frame->registers);
+  xfree (dummy_frame);
 }
 
 /* Function: frame_chain_valid 
index d2a2a75e639bc5eb45e3030db625bb9b759ed588..5dae6abc8ac4a9f02f8a59e1b6d17a1311d9ba6a 100644 (file)
@@ -538,11 +538,11 @@ condition_command (char *arg, int from_tty)
     {
       if (b->cond)
        {
-         free ((PTR) b->cond);
+         xfree (b->cond);
          b->cond = 0;
        }
       if (b->cond_string != NULL)
-       free ((PTR) b->cond_string);
+       xfree (b->cond_string);
 
       if (*p == 0)
        {
@@ -1655,7 +1655,7 @@ bpstat_clear (bpstat *bsp)
       q = p->next;
       if (p->old_val != NULL)
        value_free (p->old_val);
-      free ((PTR) p);
+      xfree (p);
       p = q;
     }
   *bsp = NULL;
@@ -3044,7 +3044,7 @@ bpstat_get_triggered_catchpoints (bpstat ep_list, bpstat *cp_list)
          catchpoint triggers.  Clients who may wish to know the name
          later must get it from the catchpoint itself.) */
       if (ep->triggered_dll_pathname != NULL)
-       free (ep->triggered_dll_pathname);
+       xfree (ep->triggered_dll_pathname);
       if (ep->type == bp_catch_load)
        dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
       else
@@ -4059,13 +4059,13 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
 
   /* Make sure that all storage allocated in decode_line_1 gets freed
      in case the following errors out.  */
-  old_chain = make_cleanup (free, sals.sals);
+  old_chain = make_cleanup (xfree, sals.sals);
   if (canonical != (char **) NULL)
     {
-      make_cleanup (free, canonical);
+      make_cleanup (xfree, canonical);
       canonical_strings_chain = make_cleanup (null_cleanup, 0);
       if (canonical[0] != NULL)
-       make_cleanup (free, canonical[0]);
+       make_cleanup (xfree, canonical[0]);
     }
 
   resolve_sal_pc (&sals.sals[0]);
@@ -4678,18 +4678,18 @@ break_command_1 (char *arg, int flag, int from_tty)
   old_chain = make_cleanup (null_cleanup, 0);
 
   /* Make sure that all storage allocated to SALS gets freed.  */
-  make_cleanup (free, sals.sals);
+  make_cleanup (xfree, sals.sals);
 
   /* Cleanup the addr_string array but not its contents. */
-  make_cleanup (free, addr_string);
+  make_cleanup (xfree, addr_string);
 
   /* Allocate space for all the cond expressions. */
   cond = xcalloc (sals.nelts, sizeof (struct expression *));
-  make_cleanup (free, cond);
+  make_cleanup (xfree, cond);
 
   /* Allocate space for all the cond strings. */
   cond_string = xcalloc (sals.nelts, sizeof (char **));
-  make_cleanup (free, cond_string);
+  make_cleanup (xfree, cond_string);
 
   /* ----------------------------- SNIP -----------------------------
      Anything added to the cleanup chain beyond this point is assumed
@@ -4703,7 +4703,7 @@ break_command_1 (char *arg, int flag, int from_tty)
   for (i = 0; i < sals.nelts; i++)
     {
       if (addr_string[i] != NULL)
-       make_cleanup (free, addr_string[i]);
+       make_cleanup (xfree, addr_string[i]);
     }
 
   /* Resolve all line numbers to PC's and verify that the addresses
@@ -4737,10 +4737,10 @@ break_command_1 (char *arg, int flag, int from_tty)
            {
              tok = cond_start = end_tok + 1;
              cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
-             make_cleanup (free, cond[i]);
+             make_cleanup (xfree, cond[i]);
              cond_end = tok;
              cond_string[i] = savestring (cond_start, cond_end - cond_start);
-             make_cleanup (free, cond_string[i]);
+             make_cleanup (xfree, cond_string[i]);
            }
          else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
            {
@@ -4819,18 +4819,18 @@ do_captured_breakpoint (void *data)
   old_chain = make_cleanup (null_cleanup, 0);
 
   /* Always have a addr_string array, even if it is empty. */
-  make_cleanup (free, addr_string);
+  make_cleanup (xfree, addr_string);
 
   /* Make sure that all storage allocated to SALS gets freed.  */
-  make_cleanup (free, sals.sals);
+  make_cleanup (xfree, sals.sals);
 
   /* Allocate space for all the cond expressions. */
   cond = xcalloc (sals.nelts, sizeof (struct expression *));
-  make_cleanup (free, cond);
+  make_cleanup (xfree, cond);
 
   /* Allocate space for all the cond strings. */
   cond_string = xcalloc (sals.nelts, sizeof (char **));
-  make_cleanup (free, cond_string);
+  make_cleanup (xfree, cond_string);
 
   /* ----------------------------- SNIP -----------------------------
      Anything added to the cleanup chain beyond this point is assumed
@@ -4844,7 +4844,7 @@ do_captured_breakpoint (void *data)
   for (i = 0; i < sals.nelts; i++)
     {
       if (addr_string[i] != NULL)
-       make_cleanup (free, addr_string[i]);
+       make_cleanup (xfree, addr_string[i]);
     }
 
   /* Wait until now before checking for garbage at the end of the
@@ -4866,7 +4866,7 @@ do_captured_breakpoint (void *data)
          cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
          if (*tok != '\0')
            error ("Garbage %s follows condition", tok);
-         make_cleanup (free, cond[i]);
+         make_cleanup (xfree, cond[i]);
          cond_string[i] = xstrdup (args->condition);
        }
     }
@@ -4968,7 +4968,7 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty)
          else
            sprintf (addr_string, "*0x%s", paddr_nz (high));
          break_command_1 (addr_string, flag, from_tty);
-         free (addr_string);
+         xfree (addr_string);
        }
       else
        error ("No function contains the specified address");
@@ -5037,8 +5037,8 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty)
   sals = decode_line_1 (&addr_string, 1, (struct symtab *) NULL, 0,
                        (char ***) NULL);
 
-  free (beg_addr_string);
-  old_chain = make_cleanup (free, sals.sals);
+  xfree (beg_addr_string);
+  old_chain = make_cleanup (xfree, sals.sals);
   for (i = 0; (i < sals.nelts); i++)
     {
       sal = sals.sals[i];
@@ -5050,7 +5050,7 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty)
          else
            sprintf (break_string, "*0x%s", paddr_nz (high));
          break_command_1 (break_string, flag, from_tty);
-         free (break_string);
+         xfree (break_string);
        }
       else
        error ("No function contains the specified address");
@@ -5568,7 +5568,7 @@ until_break_command (char *arg, int from_tty)
     error ("Couldn't get information on specified line.");
 
   sal = sals.sals[0];
-  free ((PTR) sals.sals);      /* malloc'd, so freed */
+  xfree (sals.sals);   /* malloc'd, so freed */
 
   if (*arg)
     error ("Junk at end of arguments.");
@@ -6309,7 +6309,7 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty)
       warning ("Multiple breakpoints were set.");
       warning ("Use the \"delete\" command to delete unwanted breakpoints.");
     }
-  free ((PTR) sals.sals);
+  xfree (sals.sals);
 }
 
 #if 0
@@ -6644,7 +6644,7 @@ clear_command (char *arg, int from_tty)
       if (from_tty)
        putchar_unfiltered ('\n');
     }
-  free ((PTR) sals.sals);
+  xfree (sals.sals);
 }
 \f
 /* Delete breakpoint in BS if they are `delete' breakpoints and
@@ -6803,25 +6803,25 @@ delete_breakpoint (struct breakpoint *bpt)
 
   free_command_lines (&bpt->commands);
   if (bpt->cond)
-    free (bpt->cond);
+    xfree (bpt->cond);
   if (bpt->cond_string != NULL)
-    free (bpt->cond_string);
+    xfree (bpt->cond_string);
   if (bpt->addr_string != NULL)
-    free (bpt->addr_string);
+    xfree (bpt->addr_string);
   if (bpt->exp != NULL)
-    free (bpt->exp);
+    xfree (bpt->exp);
   if (bpt->exp_string != NULL)
-    free (bpt->exp_string);
+    xfree (bpt->exp_string);
   if (bpt->val != NULL)
     value_free (bpt->val);
   if (bpt->source_file != NULL)
-    free (bpt->source_file);
+    xfree (bpt->source_file);
   if (bpt->dll_pathname != NULL)
-    free (bpt->dll_pathname);
+    xfree (bpt->dll_pathname);
   if (bpt->triggered_dll_pathname != NULL)
-    free (bpt->triggered_dll_pathname);
+    xfree (bpt->triggered_dll_pathname);
   if (bpt->exec_pathname != NULL)
-    free (bpt->exec_pathname);
+    xfree (bpt->exec_pathname);
 
   /* Be sure no bpstat's are pointing at it after it's been freed.  */
   /* FIXME, how can we find all bpstat's?
@@ -6843,7 +6843,7 @@ delete_breakpoint (struct breakpoint *bpt)
      bp, we mark it as deleted before freeing its storage. */
   bpt->type = bp_none;
 
-  free ((PTR) bpt);
+  xfree (bpt);
 }
 
 static void
@@ -6953,7 +6953,7 @@ breakpoint_re_set_one (PTR bint)
            {
              s = b->cond_string;
              if (b->cond)
-               free ((PTR) b->cond);
+               xfree (b->cond);
              b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
            }
 
@@ -6972,7 +6972,7 @@ breakpoint_re_set_one (PTR bint)
            )
            {
              if (b->source_file != NULL)
-               free (b->source_file);
+               xfree (b->source_file);
              if (sals.sals[i].symtab == NULL)
                b->source_file = NULL;
              else
@@ -7001,7 +7001,7 @@ breakpoint_re_set_one (PTR bint)
          check_duplicates (b->address, b->section);
 
        }
-      free ((PTR) sals.sals);
+      xfree (sals.sals);
       break;
 
     case bp_watchpoint:
@@ -7019,7 +7019,7 @@ breakpoint_re_set_one (PTR bint)
 
       /* So for now, just use a global context.  */
       if (b->exp)
-       free ((PTR) b->exp);
+       xfree (b->exp);
       b->exp = parse_expression (b->exp_string);
       b->exp_valid_block = innermost_block;
       mark = value_mark ();
@@ -7034,7 +7034,7 @@ breakpoint_re_set_one (PTR bint)
        {
          s = b->cond_string;
          if (b->cond)
-           free ((PTR) b->cond);
+           xfree (b->cond);
          b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
        }
       if (b->enable == enabled)
index 271a5e4ce6837d0ed1e535cf27d080f7ff94752b..24ef12a708331c143c9f418e3a78a1b2c16c774c 100644 (file)
@@ -171,7 +171,7 @@ really_free_pendings (PTR dummy)
   for (next = free_pendings; next; next = next1)
     {
       next1 = next->next;
-      free ((void *) next);
+      xfree ((void *) next);
     }
   free_pendings = NULL;
 
@@ -180,14 +180,14 @@ really_free_pendings (PTR dummy)
   for (next = file_symbols; next != NULL; next = next1)
     {
       next1 = next->next;
-      free ((void *) next);
+      xfree ((void *) next);
     }
   file_symbols = NULL;
 
   for (next = global_symbols; next != NULL; next = next1)
     {
       next1 = next->next;
-      free ((void *) next);
+      xfree ((void *) next);
     }
   global_symbols = NULL;
 }
@@ -205,7 +205,7 @@ free_pending_blocks (void)
   for (bnext = pending_blocks; bnext; bnext = bnext1)
     {
       bnext1 = bnext->next;
-      free ((void *) bnext);
+      xfree ((void *) bnext);
     }
 #endif
   pending_blocks = NULL;
@@ -486,7 +486,7 @@ make_blockvector (struct objfile *objfile)
   for (next = pending_blocks; next; next = next1)
     {
       next1 = next->next;
-      free (next);
+      xfree (next);
     }
 #endif
   pending_blocks = NULL;
@@ -684,7 +684,7 @@ pop_subfile (void)
     }
   name = link->name;
   subfile_stack = link->next;
-  free ((void *) link);
+  xfree ((void *) link);
   return (name);
 }
 \f
@@ -993,23 +993,23 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
        }
       if (subfile->name != NULL)
        {
-         free ((void *) subfile->name);
+         xfree ((void *) subfile->name);
        }
       if (subfile->dirname != NULL)
        {
-         free ((void *) subfile->dirname);
+         xfree ((void *) subfile->dirname);
        }
       if (subfile->line_vector != NULL)
        {
-         free ((void *) subfile->line_vector);
+         xfree ((void *) subfile->line_vector);
        }
       if (subfile->debugformat != NULL)
        {
-         free ((void *) subfile->debugformat);
+         xfree ((void *) subfile->debugformat);
        }
 
       nextsub = subfile->next;
-      free ((void *) subfile);
+      xfree ((void *) subfile);
     }
 
   /* Set this for the main source file.  */
index 99dcba33805acbe63f119dc6252fa92d72e93131..566e68f1327919250c4a1eb98e4226c403f77cd9 100644 (file)
@@ -995,15 +995,15 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show,
                          strncpy (demangled_no_static, demangled_no_class, length);
                          *(demangled_no_static + length) = '\0';
                          fputs_filtered (demangled_no_static, stream);
-                         free (demangled_no_static);
+                         xfree (demangled_no_static);
                        }
                      else
                        fputs_filtered (demangled_no_class, stream);
-                     free (demangled_name);
+                     xfree (demangled_name);
                    }
 
                  if (TYPE_FN_FIELD_STUB (f, j))
-                   free (mangled_name);
+                   xfree (mangled_name);
 
                  fprintf_filtered (stream, ";\n");
                }
index 557e1fdf8cd2a98f490640b1735dbb1dd55268f0..edf9b4d7cfe95f68be6835b9d491f23a9d7c976a 100644 (file)
@@ -227,7 +227,7 @@ complete_command (char *arg, int from_tty)
        completion = line_completion_function (arg, ++i, arg, argpoint))
     {
       printf_unfiltered ("%s\n", completion);
-      free (completion);
+      xfree (completion);
     }
 }
 
@@ -287,7 +287,7 @@ cd_command (char *dir, int from_tty)
     error_no_arg ("new working directory");
 
   dir = tilde_expand (dir);
-  make_cleanup (free, dir);
+  make_cleanup (xfree, dir);
 
   if (chdir (dir) < 0)
     perror_with_name (dir);
@@ -321,7 +321,7 @@ cd_command (char *dir, int from_tty)
        current_directory = concat (current_directory, dir, NULL);
       else
        current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
-      free (dir);
+      xfree (dir);
     }
 
   /* Now simplify any occurrences of `.' and `..' in the pathname.  */
@@ -383,7 +383,7 @@ source_command (char *args, int from_tty)
     }
 
   file = tilde_expand (file);
-  old_cleanups = make_cleanup (free, file);
+  old_cleanups = make_cleanup (xfree, file);
 
   stream = fopen (file, FOPEN_RT);
   if (!stream)
index 2889efc36ac6e761bf28b5321e3f66c28bb70744..42c126783ac1eddc09926f76e7d1c309c0ab5c9d 100644 (file)
@@ -346,7 +346,7 @@ delete_cmd (char *name, struct cmd_list_element **list)
       if ((*list)->hookee_post)
       (*list)->hookee_post->hook_post = 0; /* Hook slips out of its bottom  */
       p = (*list)->next;
-      free ((PTR) * list);
+      xfree (* list);
       *list = p;
     }
 
@@ -361,7 +361,7 @@ delete_cmd (char *name, struct cmd_list_element **list)
             c->next->hookee_post->hook_post = 0; /* remove post hook */
                                                /* :( no fishing metaphore */
            p = c->next->next;
-           free ((PTR) c->next);
+           xfree (c->next);
            c->next = p;
          }
        else
@@ -626,7 +626,7 @@ print_doc_line (struct ui_file *stream, char *str)
   if (p - str > line_size - 1)
     {
       line_size = p - str + 1;
-      free ((PTR) line_buffer);
+      xfree (line_buffer);
       line_buffer = (char *) xmalloc (line_size);
     }
   strncpy (line_buffer, str, p - str);
@@ -1258,7 +1258,7 @@ complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word)
 
   if (matches == 0)
     {
-      free ((PTR) matchlist);
+      xfree (matchlist);
       matchlist = 0;
     }
   else
@@ -1329,7 +1329,7 @@ complete_on_enum (const char *enumlist[],
 
   if (matches == 0)
     {
-      free ((PTR) matchlist);
+      xfree (matchlist);
       matchlist = 0;
     }
   else
index 67a6515ebeb9710b9d9d91ac8e9c258de3525303..66aa4fa1b9ee1c4921e4a7a4ecc33e043b73dc9e 100644 (file)
@@ -516,7 +516,7 @@ arg_cleanup (void *ignore)
     internal_error ("Internal error, arg_cleanup called with no user args.\n");
 
   user_args = user_args->next;
-  free (oargs);
+  xfree (oargs);
 }
 
 /* Bind the incomming arguments for a user defined command to
@@ -701,7 +701,7 @@ realloc_body_list (struct command_line *command, int new_length)
 
   memcpy (body_list, command->body_list, sizeof (struct command_line *) * n);
 
-  free (command->body_list);
+  xfree (command->body_list);
   command->body_list = body_list;
   command->body_count = new_length;
 }
@@ -1022,8 +1022,8 @@ free_command_lines (struct command_line **lptr)
            free_command_lines (blist);
        }
       next = l->next;
-      free (l->line);
-      free ((PTR) l);
+      xfree (l->line);
+      xfree (l);
       l = next;
     }
 }
@@ -1192,7 +1192,7 @@ document_command (char *comname, int from_tty)
   doclines = read_command_lines (tmpbuf, from_tty);
 
   if (c->doc)
-    free (c->doc);
+    xfree (c->doc);
 
   {
     register struct command_line *cl1;
@@ -1266,7 +1266,7 @@ script_from_file (FILE *stream, char *file)
   source_file_name = file;
   source_pre_error = error_pre_print == NULL ? "" : error_pre_print;
   source_pre_error = savestring (source_pre_error, strlen (source_pre_error));
-  make_cleanup (free, source_pre_error);
+  make_cleanup (xfree, source_pre_error);
   /* This will get set every time we read a line.  So it won't stay "" for
      long.  */
   error_pre_print = "";
index eebcf5ee8ab5d74f69d8cb545e338aba084fd533..b6cbfed90f4338d76181718afe80c3686f39d518 100644 (file)
@@ -146,7 +146,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
            *q++ = '\0';
            new = (char *) xrealloc (new, q - new);
            if (*(char **) c->var != NULL)
-             free (*(char **) c->var);
+             xfree (*(char **) c->var);
            *(char **) c->var = new;
          }
          break;
@@ -154,14 +154,14 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
          if (arg == NULL)
            arg = "";
          if (*(char **) c->var != NULL)
-           free (*(char **) c->var);
+           xfree (*(char **) c->var);
          *(char **) c->var = savestring (arg, strlen (arg));
          break;
        case var_filename:
          if (arg == NULL)
            error_no_arg ("filename to set it to.");
          if (*(char **) c->var != NULL)
-           free (*(char **) c->var);
+           xfree (*(char **) c->var);
          *(char **) c->var = tilde_expand (arg);
          break;
        case var_boolean:
index 5c02c00ae10159ecfe3277e8df92a77b63031ea9..414f53748c86bef5a0c14fc99bc4e49b61cfb1fc 100644 (file)
@@ -296,7 +296,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, PTR csip)
          /* This will be run after coffstab_build_psymtabs is called
             in coff_symfile_read, at which point we no longer need
             the information.  */
-         make_cleanup (free, n);
+         make_cleanup (xfree, n);
        }
     }
 }
@@ -442,7 +442,7 @@ static void
 complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
 {
   if (last_source_file != NULL)
-    free (last_source_file);
+    xfree (last_source_file);
   last_source_file = savestring (name, strlen (name));
   current_source_start_addr = start_addr;
   current_source_end_addr = start_addr + size;
@@ -774,7 +774,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
   memset (opaque_type_chain, 0, sizeof opaque_type_chain);
 
   if (type_vector)             /* Get rid of previous one */
-    free ((PTR) type_vector);
+    xfree (type_vector);
   type_vector_length = 160;
   type_vector = (struct type **)
     xmalloc (type_vector_length * sizeof (struct type *));
@@ -1243,7 +1243,7 @@ static void
 free_stringtab (void)
 {
   if (stringtab)
-    free (stringtab);
+    xfree (stringtab);
   stringtab = NULL;
 }
 
@@ -1345,7 +1345,7 @@ static void
 free_linetab (void)
 {
   if (linetab)
-    free (linetab);
+    xfree (linetab);
   linetab = NULL;
 }
 
@@ -1413,7 +1413,7 @@ patch_type (struct type *type, struct type *real_type)
   if (TYPE_NAME (real_target))
     {
       if (TYPE_NAME (target))
-       free (TYPE_NAME (target));
+       xfree (TYPE_NAME (target));
       TYPE_NAME (target) = concat (TYPE_NAME (real_target), NULL);
     }
 }
index bd23ca807dec7caf183a4b59695142bf08c2e3c5..9a665b644ebdb326ce8a7f5c9ed71a8881a78a76 100644 (file)
@@ -139,7 +139,7 @@ extern char *filename_completion_function (char *, int);
            q = xmalloc (strlen (p) + 5);
            strcpy (q, p + (word - text));
            return_val[return_val_used++] = q;
-           free (p);
+           xfree (p);
          }
        else
          {
@@ -149,7 +149,7 @@ extern char *filename_completion_function (char *, int);
            q[text - word] = '\0';
            strcat (q, p);
            return_val[return_val_used++] = q;
-           free (p);
+           xfree (p);
          }
       }
     }
@@ -228,7 +228,7 @@ line_completion_function (char *text, int matches, char *line_buffer, int point)
        {
          /* Free the storage used by LIST, but not by the strings inside.
             This is because rl_complete_internal () frees the strings. */
-         free ((PTR) list);
+         xfree (list);
        }
       list = 0;
       index = 0;
index 957518a940bee4742867e202be70a302b1300d7b..5106241daa724f6802621f4ecfc98accfc51a8f6 100644 (file)
 /* OBSOLETE      Mark text segment as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (execfile) */
-/* OBSOLETE     free (execfile); */
+/* OBSOLETE     xfree (execfile); */
 /* OBSOLETE   execfile = 0; */
 /* OBSOLETE   data_start = 0; */
 /* OBSOLETE   data_end = 0; */
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, */
 /* OBSOLETE                     &execfile); */
index a1c293aa703737b49e074222da77a7b055d4f53d..ea9fcd5a305432366f06a2b4f73df4ee82431bd1 100644 (file)
 /* OBSOLETE      and mark data and stack spaces as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (corefile) */
-/* OBSOLETE     free (corefile); */
+/* OBSOLETE     xfree (corefile); */
 /* OBSOLETE   corefile = 0; */
 /* OBSOLETE  */
 /* OBSOLETE   if (corechan >= 0) */
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
 /* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
index 38bef9a27fe8fae7a954f1da2f850876e49dafa3..4447f77747372a1f5fbd5dd1cf2894b6c3f0ae3e 100644 (file)
@@ -91,7 +91,7 @@ core_file_command (char *filename, int from_tty)
              {
                char *symfile_copy = xstrdup (symfile);
 
-               make_cleanup (free, symfile_copy);
+               make_cleanup (xfree, symfile_copy);
                symbol_file_command (symfile_copy, from_tty);
              }
            else
@@ -183,7 +183,7 @@ reopen_exec_file (void)
 
   /* If the timestamp of the exec file has changed, reopen it. */
   filename = xstrdup (bfd_get_filename (exec_bfd));
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
   mtime = bfd_get_mtime (exec_bfd);
   res = stat (filename, &st);
 
@@ -397,7 +397,7 @@ void
 set_gnutarget (char *newtarget)
 {
   if (gnutarget_string != NULL)
-    free (gnutarget_string);
+    xfree (gnutarget_string);
   gnutarget_string = savestring (newtarget, strlen (newtarget));
   set_gnutarget_command (NULL, 0, NULL);
 }
index 148f5f4440006f9513396fb7f27b87c0fe25881e..78e50ae4430ca8391ef09a972e7d16c7287d6ca2 100644 (file)
@@ -194,11 +194,11 @@ core_close (int quitting)
       if (!bfd_close (core_bfd))
        warning ("cannot close \"%s\": %s",
                 name, bfd_errmsg (bfd_get_error ()));
-      free (name);
+      xfree (name);
       core_bfd = NULL;
       if (core_ops.to_sections)
        {
-         free ((PTR) core_ops.to_sections);
+         xfree (core_ops.to_sections);
          core_ops.to_sections = NULL;
          core_ops.to_sections_end = NULL;
        }
@@ -273,11 +273,11 @@ core_open (char *filename, int from_tty)
   if (filename[0] != '/')
     {
       temp = concat (current_directory, "/", filename, NULL);
-      free (filename);
+      xfree (filename);
       filename = temp;
     }
 
-  old_chain = make_cleanup (free, filename);
+  old_chain = make_cleanup (xfree, filename);
 
   scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
   if (scratch_chan < 0)
index 2ec1c6c7025fa4c38ba0d2237fd1dded88304c75..7f48a12634966e54dbc1ebaed041f8a370fc497d 100644 (file)
@@ -152,7 +152,7 @@ common:
       else
        {
          fputs_filtered (demangled_name, stream);
-         free (demangled_name);
+         xfree (demangled_name);
        }
     }
   else
@@ -793,5 +793,5 @@ _initialize_cp_valprint (void)
   obstack_begin (&dont_print_vb_obstack, 32 * sizeof (struct type *));
   obstack_specify_allocation (&dont_print_statmem_obstack,
                              32 * sizeof (CORE_ADDR), sizeof (CORE_ADDR),
-                             xmalloc, free);
+                             xmalloc, xfree);
 }
index 74636bdd1edbe371936c14d47373a1f4a2bc43a2..74b201049ad59bb6804a7b009d7ae8048df4e4ef 100644 (file)
@@ -386,7 +386,7 @@ add_shared_symbol_files (void)
              section_addrs.other[0].addr = lms.l_addr;
               section_addrs.other[0].name = ".text";
              symbol_file_add (path_name, 1, &section_addrs, 0, 0);
-             free (path_name);
+             xfree (path_name);
            }
        }
       /* traverse links in reverse order so that we get the
index 171ff387a361201260c8e09909dde711a4482b29..ee14abacb43c1a1c2478016780a198d8f4a1b8ed 100644 (file)
@@ -986,8 +986,8 @@ pop_stack_item (struct stack_item *si)
 {
   struct stack_item *dead = si;
   si = si->prev;
-  free (dead->data);
-  free (dead);
+  xfree (dead->data);
+  xfree (dead);
   return si;
 }
 
@@ -1346,7 +1346,7 @@ d10v_eva_get_trace_data (void)
   oldsize = trace_data.size;
   trace_data.size += count;
 
-  free (tmpspace);
+  xfree (tmpspace);
 
   if (trace_display)
     display_trace (oldsize, trace_data.size);
index 125723ad436982dd6aa3726d05297ee92d331c9c..b85d0b73745f9534e039392b00273ac116996bb9 100644 (file)
@@ -1221,7 +1221,7 @@ d30v_eva_get_trace_data (void)
   oldsize = trace_data.size;
   trace_data.size += count;
 
-  free (tmpspace);
+  xfree (tmpspace);
 
   if (trace_display)
     display_trace (oldsize, trace_data.size);
index c8f9cfe1be3d5342b16cfc6d314b4fb5b97f0652..071be760ec4fced63cd8de012bd9c0bfff9e0776 100644 (file)
@@ -323,7 +323,7 @@ free_header_files (void)
 {
   if (this_object_header_files)
     {
-      free ((PTR) this_object_header_files);
+      xfree (this_object_header_files);
       this_object_header_files = NULL;
     }
   n_allocated_this_object_header_files = 0;
@@ -767,10 +767,10 @@ dbx_symfile_finish (struct objfile *objfile)
 
          while (--i >= 0)
            {
-             free (hfiles[i].name);
-             free (hfiles[i].vector);
+             xfree (hfiles[i].name);
+             xfree (hfiles[i].vector);
            }
-         free ((PTR) hfiles);
+         xfree (hfiles);
        }
       mfree (objfile->md, objfile->sym_stab_info);
     }
@@ -1093,7 +1093,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
     return;
 
   dynsyms = (asymbol **) xmalloc (dynsym_size);
-  back_to = make_cleanup (free, dynsyms);
+  back_to = make_cleanup (xfree, dynsyms);
 
   dynsym_count = bfd_canonicalize_dynamic_symtab (abfd, dynsyms);
   if (dynsym_count < 0)
@@ -1156,7 +1156,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
     }
 
   dynrels = (arelent **) xmalloc (dynrel_size);
-  make_cleanup (free, dynrels);
+  make_cleanup (xfree, dynrels);
 
   dynrel_count = bfd_canonicalize_dynamic_reloc (abfd, dynrels, dynsyms);
   if (dynrel_count < 0)
index ed30eea14e92153fb1fd2b63f5b02bf26d38d094..cdfe4762de4bbb4140bd0f7b4d779e629b44b4f1 100644 (file)
@@ -435,8 +435,8 @@ dcache_free (DCACHE *dcache)
   if (last_cache == dcache)
     last_cache = NULL;
 
-  free (dcache->the_cache);
-  free (dcache);
+  xfree (dcache->the_cache);
+  xfree (dcache);
 }
 
 /* Read or write LEN bytes from inferior memory at MEMADDR, transferring
index 63f8345dea40759bec6d6e7ec4005529ddb1c516..87e570f4b5a042f4ad590efb433f6c7d35e2f440 100644 (file)
@@ -367,6 +367,8 @@ extern void free_current_contents (void *);
 
 extern void null_cleanup (void *);
 
+extern void xfree (void *);
+
 extern int myread (int, char *, int);
 
 extern int query (char *, ...) ATTR_FORMAT (printf, 1, 2);
index 23ebcdea3788016460c54e0586b48336d8579315..2c59deca9116dc5cbef8e5c78ebac1f1126452cc 100644 (file)
@@ -109,7 +109,7 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
                             dem->demangling_style_doc);
          if (dem->demangling_style == current_demangling_style)
            {
-             free (current_demangling_style_string);
+             xfree (current_demangling_style_string);
              current_demangling_style_string =
                savestring (dem->demangling_style_name,
                            strlen (dem->demangling_style_name));
@@ -138,7 +138,7 @@ set_demangling_style (char *style)
 {
   if (current_demangling_style_string != NULL)
     {
-      free (current_demangling_style_string);
+      xfree (current_demangling_style_string);
     }
   current_demangling_style_string = savestring (style, strlen (style));
   set_demangling_command ((char *) NULL, 0, (struct cmd_list_element *) NULL);
index c49b551321af58864bcd1ba8881a0ebab95b6073..344717d49bf321f90f4dd78ef60c8371d7733785 100644 (file)
@@ -107,7 +107,7 @@ dst_start_symtab (void)
   /* Initialize the source file line number information for this file.  */
 
   if (line_vector)             /* Unlikely, but maybe possible? */
-    free ((PTR) line_vector);
+    xfree (line_vector);
   line_vector_index = 0;
   line_vector_length = 1000;
   prev_line_number = -2;       /* Force first line number to be explicit */
@@ -861,13 +861,13 @@ decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code,
   type = find_dst_structure (name);
   if (type)
     {
-      free ((PTR) name);
+      xfree (name);
       return type;
     }
   type = create_new_type (objfile);
   TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
                                    name, strlen (name));
-  free ((PTR) name);
+  xfree (name);
   TYPE_CODE (type) = code;
   TYPE_LENGTH (type) = DST_record (entry).size;
   TYPE_NFIELDS (type) = DST_record (entry).nfields;
@@ -1401,7 +1401,7 @@ process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry)
 
       block->sym[symnum] = symlist->symbol;
 
-      free ((PTR) symlist);
+      xfree (symlist);
       symlist = nextsym;
       symnum++;
     }
@@ -1497,7 +1497,7 @@ read_dst_symtab (struct objfile *objfile)
              global_block->sym[symnum] =
                dst_global_symbols->symbol;
 
-             free ((PTR) dst_global_symbols);
+             xfree (dst_global_symbols);
              dst_global_symbols = nextsym;
            }
          dst_global_symbols = NULL;
@@ -1534,7 +1534,7 @@ read_dst_symtab (struct objfile *objfile)
     {
       element = struct_list;
       struct_list = element->next;
-      free ((PTR) element);
+      xfree (element);
     }
 }
 \f
index 34707bb9b05ef2360d9aba15a70d8e461be89451..5c6755a3bb0f29d6774baa62d0ebf2e602d09776 100644 (file)
@@ -833,7 +833,7 @@ load_section (bfd *abfd, asection *s, unsigned int *data_count)
       buffer = (unsigned char *) xmalloc (section_size);
       bfd_get_section_contents (abfd, s, buffer, 0, section_size);
       process_read_request (buffer, section_size);
-      free (buffer);
+      xfree (buffer);
     }
 }
 
index 8a0513d72ced2099c035a09b04603dada1b98cf4..7f75672ceb2f20b082c65f972f87d3b7cbe8e216 100644 (file)
@@ -1739,7 +1739,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
 
   /* Allocate a new field list entry and link it in.  */
   new_field = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-  make_cleanup (free, new_field);
+  make_cleanup (xfree, new_field);
   memset (new_field, 0, sizeof (struct nextfield));
   new_field->next = fip->fields;
   fip->fields = new_field;
@@ -2026,7 +2026,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
   /* Create a new member function field and chain it to the field list
      entry. */
   new_fnfield = (struct nextfnfield *) xmalloc (sizeof (struct nextfnfield));
-  make_cleanup (free, new_fnfield);
+  make_cleanup (xfree, new_fnfield);
   memset (new_fnfield, 0, sizeof (struct nextfnfield));
   new_fnfield->next = flp->head;
   flp->head = new_fnfield;
@@ -2386,7 +2386,7 @@ read_enumeration (struct die_info *die, struct objfile *objfile,
            TYPE_ALLOC (type, sizeof (struct field) * num_fields);
          memcpy (TYPE_FIELDS (type), fields,
                  sizeof (struct field) * num_fields);
-         free (fields);
+         xfree (fields);
        }
       if (unsigned_enum)
        TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
@@ -2949,8 +2949,8 @@ free_die_list (struct die_info *dies)
   while (die)
     {
       next = die->next;
-      free (die->attrs);
-      free (die);
+      xfree (die->attrs);
+      xfree (die);
       die = next;
     }
 }
@@ -3083,8 +3083,8 @@ dwarf2_empty_abbrev_table (PTR ignore)
       while (abbrev)
        {
          next = abbrev->next;
-         free (abbrev->attrs);
-         free (abbrev);
+         xfree (abbrev->attrs);
+         xfree (abbrev);
          abbrev = next;
        }
       dwarf2_abbrevs[i] = NULL;
@@ -4064,11 +4064,11 @@ dwarf2_start_subfile (char *filename, char *dirname)
          if (STREQ (subfile->name, fullname))
            {
              current_subfile = subfile;
-             free (fullname);
+             xfree (fullname);
              return;
            }
        }
-      free (fullname);
+      xfree (fullname);
     }
   start_subfile (filename, dirname);
 }
index c6a24fa94b22de76882dae03e8306b546ad06396..70557173be9d87c042035d508b800eccd99af497 100644 (file)
@@ -696,10 +696,10 @@ dwarf_build_psymtabs (struct objfile *objfile, int mainline, file_ptr dbfoff,
   if ((bfd_seek (abfd, dbfoff, SEEK_SET) != 0) ||
       (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
     {
-      free (dbbase);
+      xfree (dbbase);
       error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
     }
-  back_to = make_cleanup (free, dbbase);
+  back_to = make_cleanup (xfree, dbbase);
 
   /* If we are reinitializing, or if we have never loaded syms yet, init.
      Since we have no idea how many DIES we are looking at, we just guess
@@ -869,7 +869,7 @@ alloc_utype (DIE_REF die_ref, struct type *utypep)
 static void
 free_utypes (PTR dummy)
 {
-  free (utypes);
+  xfree (utypes);
   utypes = NULL;
   numutypes = 0;
 }
@@ -2265,10 +2265,10 @@ read_ofile_symtab (struct partial_symtab *pst)
   if (bfd_seek (abfd, foffset, SEEK_SET) ||
       (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
     {
-      free (dbbase);
+      xfree (dbbase);
       error ("can't read DWARF data");
     }
-  back_to = make_cleanup (free, dbbase);
+  back_to = make_cleanup (xfree, dbbase);
 
   /* If there is a line number table associated with this compilation unit
      then read the size of this fragment in bytes, from the fragment itself.
@@ -2290,10 +2290,10 @@ read_ofile_symtab (struct partial_symtab *pst)
       if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
          (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
        {
-         free (lnbase);
+         xfree (lnbase);
          error ("can't read DWARF line numbers");
        }
-      make_cleanup (free, lnbase);
+      make_cleanup (xfree, lnbase);
     }
 
   process_dies (dbbase, dbbase + dbsize, pst->objfile);
index a7d5009312195f46079822e74b999b71dcfc16ab..2a5e536a498e0c802d564f0d04778dfa94a86ffa 100644 (file)
@@ -249,7 +249,7 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, symbol_table);
+      back_to = make_cleanup (xfree, symbol_table);
       if (dynamic)
        number_of_symbols = bfd_canonicalize_dynamic_symtab (objfile->obfd,
                                                             symbol_table);
index 53e63e099dcb68de4ff062e478e49628486890ea..4ce008075602c2cbedaddc5896d13486573a2254 100644 (file)
@@ -48,9 +48,9 @@ free_environ (register struct environ *e)
   register char **vector = e->vector;
 
   while (*vector)
-    free (*vector++);
+    xfree (*vector++);
 
-  free (e);
+  xfree (e);
 }
 
 /* Copy the environment given to this process into E.
@@ -137,7 +137,7 @@ set_in_environ (struct environ *e, const char *var, const char *value)
       vector[i + 1] = 0;
     }
   else
-    free (s);
+    xfree (s);
 
   s = (char *) xmalloc (len + strlen (value) + 2);
   strcpy (s, var);
@@ -171,7 +171,7 @@ unset_in_environ (struct environ *e, char *var)
     {
       if (STREQN (s, var, len) && s[len] == '=')
        {
-         free (s);
+         xfree (s);
          /* Walk through the vector, shuffling args down by one, including
             the NULL terminator.  Can't use memcpy() here since the regions
             overlap, and memmove() might not be available. */
index f46fe4df37969780f47e3d143fcaf440633ea5f6..ad7ba66f87f610193b53098777c051f6077d48c4 100644 (file)
@@ -377,7 +377,7 @@ process_event (void)
          if (event_ptr->next_event == NULL)
            event_queue.last_event = prev_ptr;
        }
-      free ((char *) event_ptr);
+      xfree (event_ptr);
 
       /* Now call the procedure associated with the event. */
       (*proc) (fd);
@@ -620,7 +620,7 @@ delete_file_handler (int fd)
              j++;
            }
        }
-      free (gdb_notifier.poll_fds);
+      xfree (gdb_notifier.poll_fds);
       gdb_notifier.poll_fds = new_poll_fds;
       gdb_notifier.num_fds--;
 #else
@@ -668,7 +668,7 @@ delete_file_handler (int fd)
        ;
       prev_ptr->next_file = file_ptr->next_file;
     }
-  free ((char *) file_ptr);
+  xfree (file_ptr);
 }
 
 /* Handle the given event by calling the procedure associated to the
@@ -973,7 +973,7 @@ delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
       if (sighandler_list.last_handler == (*async_handler_ptr))
        sighandler_list.last_handler = prev_ptr;
     }
-  free ((char *) (*async_handler_ptr));
+  xfree ((*async_handler_ptr));
   (*async_handler_ptr) = NULL;
 }
 
@@ -1080,7 +1080,7 @@ delete_timer (int id)
        ;
       prev_timer->next = timer_ptr->next;
     }
-  free ((char *) timer_ptr);
+  xfree (timer_ptr);
 
   gdb_notifier.timeout_valid = 0;
 }
@@ -1111,7 +1111,7 @@ handle_timer_event (int dummy)
       timer_ptr = timer_ptr->next;
       /* Call the procedure associated with that timer. */
       (*saved_timer->proc) (saved_timer->client_data);
-      free (saved_timer);
+      xfree (saved_timer);
     }
 
   gdb_notifier.timeout_valid = 0;
index f37ff7577ae9e2efb77a609f891f297ce88c9482..e2c511c1a8652707affb1ee8cb9ccdd6dc73312c 100644 (file)
@@ -393,13 +393,13 @@ pop_prompt (void)
        in effect, until the user does another 'set prompt'. */
     if (strcmp (PROMPT (0), PROMPT (-1)))
       {
-       free (PROMPT (-1));
+       xfree (PROMPT (-1));
        PROMPT (-1) = savestring (PROMPT (0), strlen (PROMPT (0)));
       }
 
-  free (PREFIX (0));
-  free (PROMPT (0));
-  free (SUFFIX (0));
+  xfree (PREFIX (0));
+  xfree (PROMPT (0));
+  xfree (SUFFIX (0));
   the_prompts.top--;
 }
 
@@ -643,7 +643,7 @@ command_line_handler (char *rl)
     {
       strcpy (linebuffer, readline_input_state.linebuffer);
       p = readline_input_state.linebuffer_ptr;
-      free (readline_input_state.linebuffer);
+      xfree (readline_input_state.linebuffer);
       more_to_come = 0;
       pop_prompt ();
     }
@@ -690,7 +690,7 @@ command_line_handler (char *rl)
   while (*p1)
     *p++ = *p1++;
 
-  free (rl);                   /* Allocated in readline.  */
+  xfree (rl);                  /* Allocated in readline.  */
 
   if (*(p - 1) == '\\')
     {
@@ -749,7 +749,7 @@ command_line_handler (char *rl)
          /* If there was an error, call this function again.  */
          if (expanded < 0)
            {
-             free (history_value);
+             xfree (history_value);
              return;
            }
          if (strlen (history_value) > linelength)
@@ -759,7 +759,7 @@ command_line_handler (char *rl)
            }
          strcpy (linebuffer, history_value);
          p = linebuffer + strlen (linebuffer);
-         free (history_value);
+         xfree (history_value);
        }
     }
 
@@ -868,7 +868,7 @@ gdb_readline2 (gdb_client_data client_data)
               if we are called again fgetc will still return EOF and
               we'll return NULL then.  */
            break;
-         free (result);
+         xfree (result);
          (*input_handler) (0);
        }
 
index 4a91fb169ef465cc9198d6b69d8c41025a0e8dc2..6c956bf43f24fbb9191e9e875fe8c3d986598d45 100644 (file)
@@ -126,7 +126,7 @@ exec_close (int quitting)
          FIXME-as-well: free_objfile already free'd vp->name, so it isn't
          valid here.  */
       free_named_symtabs (vp->name);
-      free (vp);
+      xfree (vp);
     }
 
   vmap = NULL;
@@ -138,13 +138,13 @@ exec_close (int quitting)
       if (!bfd_close (exec_bfd))
        warning ("cannot close \"%s\": %s",
                 name, bfd_errmsg (bfd_get_error ()));
-      free (name);
+      xfree (name);
       exec_bfd = NULL;
     }
 
   if (exec_ops.to_sections)
     {
-      free ((PTR) exec_ops.to_sections);
+      xfree (exec_ops.to_sections);
       exec_ops.to_sections = NULL;
       exec_ops.to_sections_end = NULL;
     }
@@ -199,7 +199,7 @@ exec_file_attach (char *args, int from_tty)
        error ("No executable file name was specified");
 
       filename = tilde_expand (*argv);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
 
       scratch_chan = openp (getenv ("PATH"), 1, filename,
                   write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
@@ -226,7 +226,7 @@ exec_file_attach (char *args, int from_tty)
          via the exec_bfd->name pointer, so we need to make another copy and
          leave exec_bfd as the new owner of the original copy. */
       scratch_pathname = xstrdup (scratch_pathname);
-      make_cleanup (free, scratch_pathname);
+      make_cleanup (xfree, scratch_pathname);
 
       if (!bfd_check_format (exec_bfd, bfd_object))
        {
@@ -364,7 +364,7 @@ build_section_table (bfd *some_bfd, struct section_table **start,
 
   count = bfd_count_sections (some_bfd);
   if (*start)
-    free ((PTR) * start);
+    xfree (* start);
   *start = (struct section_table *) xmalloc (count * sizeof (**start));
   *end = *start;
   bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
index b61af1d3c508550a150abdfd50aa94d028867f84..c466c51ac5f2cd4eeb78bed063ea104507ee162f 100644 (file)
@@ -635,7 +635,7 @@ add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
       STREQ (name, BLANK_COMMON_NAME_MF77))
     {
 
-      free (name);
+      xfree (name);
       name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
       strcpy (name, BLANK_COMMON_NAME_LOCAL);
     }
@@ -809,7 +809,7 @@ patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
   if ((STREQ (name, BLANK_COMMON_NAME_ORIGINAL)) ||
       (STREQ (name, BLANK_COMMON_NAME_MF77)))
     {
-      free (name);
+      xfree (name);
       name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
       strcpy (name, BLANK_COMMON_NAME_LOCAL);
     }
@@ -875,7 +875,7 @@ clear_bf_list (void)
   while (tmp != NULL)
     {
       next = tmp->next;
-      free (tmp);
+      xfree (tmp);
       tmp = next;
     }
   saved_bf_list = NULL;
@@ -946,7 +946,7 @@ clear_function_list (void)
   while (tmp != NULL)
     {
       next = tmp->next;
-      free (tmp);
+      xfree (tmp);
       tmp = next;
     }
 
index 15aeefaf22ef3c6836cab2ed62b2f9d4186eca16..708e9312b913015bc96fc6d096bab828ff46e30d 100644 (file)
@@ -179,7 +179,7 @@ gdb_events_deliver (struct gdb_events *vector)
     {
       struct event *event = delivering_events;
       delivering_events = event->next;
-      free (event);
+      xfree (event);
     }
   /* Process any pending events.  Because one of the deliveries could
      bail out we move everything off of the pending queue onto an
@@ -206,7 +206,7 @@ gdb_events_deliver (struct gdb_events *vector)
          break;
        }
       delivering_events = event->next;
-      free (event);
+      xfree (event);
     }
 }
 
index b8368cabb612151e8a13c85e096162c1ff1cf461..5cef3ff50a4848c640ac91692f28823a31c289ee 100644 (file)
@@ -463,7 +463,7 @@ void
 gdbarch_free (struct gdbarch *arch)
 {
   /* At the moment, this is trivial.  */
-  free (arch);
+  xfree (arch);
 }
 
 
index c54d4726c35582d90870f7b2c1cdfdd5d1edb67e..26d9059ae4822a004349fbcd50375acf91bbc10b 100644 (file)
@@ -1352,7 +1352,7 @@ cfront_mangle_name (struct type *type, int i, int j)
        printf ("add_mangled_type: %s\n", extras.str);  /* FIXME */
       arm_mangled_name = malloc (strlen (mangled_name) + extras.len);
       sprintf (arm_mangled_name, "%s%s", mangled_name, extras.str);
-      free (mangled_name);
+      xfree (mangled_name);
       mangled_name = arm_mangled_name;
     }
 }
@@ -1484,7 +1484,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
       argtypes[argcount] = NULL;       /* Ellist terminator */
     }
 
-  free (demangled_name);
+  xfree (demangled_name);
 
   f = TYPE_FN_FIELDLIST1 (type, method_id);
 
@@ -1835,7 +1835,7 @@ virtual_base_list (struct type *dclass)
   while (tmp_vbase)
     {
       tmp_vbase = tmp_vbase->next;
-      free (tmp_vbase_2);
+      xfree (tmp_vbase_2);
       tmp_vbase_2 = tmp_vbase;
     }
 
index dbdcfb1572218176bc63597e915deff56886d410..cceef39fac7e9446cf10c690b696728593afa4a3 100644 (file)
@@ -627,7 +627,7 @@ _proc_free (struct proc *proc)
       mach_port_deallocate (mach_task_self (), proc->port);
     }
 
-  free (proc);
+  xfree (proc);
   return next;
 }
 
index 0d96b8a3eeaa3a6dab7ded4e580665bf14901fdc..aa53d699c1c9c638bd360ac2ac13bcd9e87989c6 100644 (file)
@@ -510,7 +510,7 @@ h8500_value_of_trapped_internalvar (struct internalvar *var)
   get_saved_register (regbuf, NULL, NULL, selected_frame, regnum, NULL);
   regval |= regbuf[0] << 8 | regbuf[1];                /* XXX host/target byte order */
 
-  free (var->value);           /* Free up old value */
+  xfree (var->value);          /* Free up old value */
 
   var->value = value_from_longest (builtin_type_unsigned_long, regval);
   release_value (var->value);  /* Unchain new value */
index 0054644f709f1c6d61429b568099613ea729f03b..007b23e3225bc35e4551fb8b6f4b61c1496571db 100644 (file)
@@ -381,7 +381,7 @@ clear_pst_syms (void)
 {
   pst_syms_count = 0;
   pst_syms_size = 0;
-  free (pst_syms_array);
+  xfree (pst_syms_array);
   pst_syms_array = 0;
 }
 
@@ -1025,7 +1025,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
              /* Prepare for the next psymtab. */
              global_syms = objfile->global_psymbols.next;
              static_syms = objfile->static_psymbols.next;
-             free (class_entered);
+             xfree (class_entered);
 
              curr_fd++;
            }                   /* Psymtab for file */
@@ -1254,7 +1254,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
              /* Prepare for the next psymtab. */
              global_syms = objfile->global_psymbols.next;
              static_syms = objfile->static_psymbols.next;
-             free (class_entered);
+             xfree (class_entered);
 
              curr_md++;
              curr_fd++;
index 128d66ddc5473bedf7578ca4a50b0181c0e301ae..549ea1945ad32dff3b48458ab2560f75c207a435 100644 (file)
@@ -340,7 +340,7 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
              /* No, we still fail.  Okay, time to punt. */
              if ((pt_status == -1) && errno)
                {
-                 free (buffer);
+                 xfree (buffer);
                  return 0;
                }
            }
@@ -356,7 +356,7 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
                                   inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
          if (errno)
            {
-             free (buffer);
+             xfree (buffer);
              return 0;
            }
          QUIT;
@@ -365,7 +365,7 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
       /* Copy appropriate bytes out of the buffer.  */
       memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
     }
-  free (buffer);
+  xfree (buffer);
   return len;
 }
 
index 343853abf3d7c44d061740349c1af654eff2e866..fb788f86e0a06f7166cd09a7da21c43bb4c0bd07 100644 (file)
@@ -300,7 +300,7 @@ Start it from the beginning? "))
       if (args)
        {
          cmd = concat ("set args ", args, NULL);
-         make_cleanup (free, cmd);
+         make_cleanup (xfree, cmd);
          execute_command (cmd, from_tty);
        }
     }
@@ -696,7 +696,7 @@ jump_command (char *arg, int from_tty)
     }
 
   sal = sals.sals[0];
-  free ((PTR) sals.sals);
+  xfree (sals.sals);
 
   if (sal.symtab == 0 && sal.pc == 0)
     error ("No source file has been specified.");
@@ -1375,7 +1375,7 @@ set_environment_command (char *arg, int from_tty)
     }
   else
     set_in_environ (inferior_environ, var, val);
-  free (var);
+  xfree (var);
 }
 
 static void
@@ -1423,7 +1423,7 @@ path_command (char *dirname, int from_tty)
   exec_path = strsave (env);
   mod_path (dirname, &exec_path);
   set_in_environ (inferior_environ, path_var_name, exec_path);
-  free (exec_path);
+  xfree (exec_path);
   if (from_tty)
     path_info ((char *) NULL, from_tty);
 }
index 16047b2f178a02e332c3a1a42f16d0da47ea4d2e..17bce7fd0f332b52d7c32d262da3d6e2f8eb4bb6 100644 (file)
@@ -185,7 +185,7 @@ terminal_init_inferior_with_pgrp (int pgrp)
       /* We could just as well copy our_ttystate (if we felt like adding
          a new function SERIAL_COPY_TTY_STATE).  */
       if (inferior_ttystate)
-       free (inferior_ttystate);
+       xfree (inferior_ttystate);
       inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
 
 #ifdef PROCESS_GROUP_TYPE
@@ -331,7 +331,7 @@ terminal_ours_1 (int output_only)
 #endif
 
       if (inferior_ttystate)
-       free (inferior_ttystate);
+       xfree (inferior_ttystate);
       inferior_ttystate = SERIAL_GET_TTY_STATE (stdin_serial);
 #ifdef HAVE_TERMIOS
       inferior_process_group = tcgetpgrp (0);
index 01db98ca200c2f69d8b046ae1555dde849f8fad1..e934c9ddca97cd47265a1ec5031727efe7387651 100644 (file)
@@ -646,7 +646,7 @@ follow_vfork (int parent_pid, int child_pid)
       pending_follow.fork_event.saw_child_exec = 0;
       pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
       follow_exec (inferior_pid, pending_follow.execd_pathname);
-      free (pending_follow.execd_pathname);
+      xfree (pending_follow.execd_pathname);
     }
 }
 
@@ -1715,7 +1715,7 @@ handle_inferior_event (struct execution_control_state *ecs)
        /* This causes the eventpoints and symbol table to be reset.  Must
           do this now, before trying to determine whether to stop. */
        follow_exec (inferior_pid, pending_follow.execd_pathname);
-       free (pending_follow.execd_pathname);
+       xfree (pending_follow.execd_pathname);
 
        stop_pc = read_pc_pid (ecs->pid);
        ecs->saved_inferior_pid = inferior_pid;
@@ -3891,7 +3891,7 @@ xdb_handle_command (char *args, int from_tty)
          else
            printf_filtered ("Invalid signal handling flag.\n");
          if (argBuf)
-           free (argBuf);
+           xfree (argBuf);
        }
     }
   do_cleanups (old_chain);
@@ -3982,9 +3982,9 @@ xmalloc_inferior_status (void)
 static void
 free_inferior_status (struct inferior_status *inf_status)
 {
-  free (inf_status->registers);
-  free (inf_status->stop_registers);
-  free (inf_status);
+  xfree (inf_status->registers);
+  xfree (inf_status->stop_registers);
+  xfree (inf_status);
 }
 
 void
index 8c33d4f957c54042071770d9b5d66c407cdebc8b..a6fbc7f664932590fbbee0e4c4834ef3d18e713e 100644 (file)
@@ -686,7 +686,7 @@ clear_thread_info (void)
     {
       q = p;
       p = p->next;
-      free (q);
+      xfree (q);
     }
 
   thread_head.head = NULL;
@@ -698,7 +698,7 @@ clear_thread_info (void)
     {
       q = p;
       p = p->next;
-      free (q);
+      xfree (q);
     }
 
   deleted_threads.head = NULL;
@@ -3868,7 +3868,7 @@ kill_inferior (void)
       t = t->next;
     }
 
-  free (paranoia);
+  xfree (paranoia);
 
   call_ttrace (TT_PROC_STOP,
               inferior_pid,
@@ -5336,7 +5336,7 @@ remove_dictionary_entry_of_page (int pid, memory_page_t *page)
 
   memory_page_dictionary.page_count--;
 
-  free (page);
+  xfree (page);
 }
 
 
index d7e402ccce517127aa69000f5affd7e5aa191507..5fe41fa004be61e1573c0fb10728cbd0b20301d7 100644 (file)
@@ -409,7 +409,7 @@ solib_map_sections (void *arg)
   bfd *abfd;
 
   filename = tilde_expand (so->so_name);
-  old_chain = make_cleanup (free, filename);
+  old_chain = make_cleanup (xfree, filename);
 
   scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
                        &scratch_pathname);
@@ -1056,7 +1056,7 @@ clear_solib (void)
     {
       if (so_list_head->sections)
        {
-         free ((PTR) so_list_head->sections);
+         xfree (so_list_head->sections);
        }
       if (so_list_head->abfd)
        {
@@ -1071,9 +1071,9 @@ clear_solib (void)
 
       next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR) bfd_filename);
-      free (so_list_head->so_name);
-      free ((PTR) so_list_head);
+       xfree (bfd_filename);
+      xfree (so_list_head->so_name);
+      xfree (so_list_head);
       so_list_head = next;
     }
   debug_base = 0;
index 0bfe5595160c532ae099f730f357950df6ec2012..7747ad134f495ed18ca1a1d55c6f22e07fe9412c 100644 (file)
@@ -122,7 +122,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
        {                       /* array type */
          char *name = java_demangle_type_signature (TYPE_TAG_NAME (type));
          fputs_filtered (name, stream);
-         free (name);
+         xfree (name);
          break;
        }
 
@@ -299,11 +299,11 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
                      }
 
                    fputs_filtered (demangled_no_class, stream);
-                   free (demangled_name);
+                   xfree (demangled_name);
                  }
 
                  if (TYPE_FN_FIELD_STUB (f, j))
-                   free (mangled_name);
+                   xfree (mangled_name);
 
                  fprintf_filtered (stream, ";\n");
                }
index 0dffdb67fcd68e6f73e10f4ea540abd20fc788c6..9351734cb6d745dc6da5f6bba0af5499fd5ce87b 100644 (file)
@@ -312,6 +312,6 @@ cisco_kod_request (char *arg, int from_tty)
 
   /* Free memory.  */
   for (i = 0; i < sync_next; ++i)
-    free (sync_ids[i]);
-  free (sync_ids);
+    xfree (sync_ids[i]);
+  xfree (sync_ids);
 }
index d2687d7ac226b60935207a7cfa8400f704999ad6..6aa6769d9144142b20a9ca93fb4fe4a9cfb093ea 100644 (file)
--- a/gdb/kod.c
+++ b/gdb/kod.c
@@ -143,7 +143,7 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
   if (old_operating_system)
     {
       delete_cmd (old_operating_system, &infolist);
-      free (old_operating_system);
+      xfree (old_operating_system);
     }
   old_operating_system = xstrdup (operating_system);
 
@@ -175,7 +175,7 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
        p = "Unknown KOD library";
       printf_filtered ("%s - %s\n", operating_system, p);
 
-      free (kodlib);
+      xfree (kodlib);
     }
 }
 
index 6f7723debc6eecbcbbff1e1a8bb05170e972fea8..a5b2a863f718482e834937183a4f050aace81a09 100644 (file)
@@ -231,7 +231,7 @@ set_language_command (char *ignore, int from_tty)
   /* Reset the language (esp. the global string "language") to the 
      correct values. */
   err_lang = savestring (language, strlen (language));
-  make_cleanup (free, err_lang);       /* Free it after error */
+  make_cleanup (xfree, err_lang);      /* Free it after error */
   set_language (current_language->la_language);
   error ("Unknown language `%s'.", err_lang);
 }
@@ -421,7 +421,7 @@ set_lang_str (void)
   char *prefix = "";
 
   if (language)
-    free (language);
+    xfree (language);
   if (language_mode == language_mode_auto)
     prefix = "auto; currently ";
 
@@ -434,7 +434,7 @@ set_type_str (void)
   char *tmp = NULL, *prefix = "";
 
   if (type)
-    free (type);
+    xfree (type);
   if (type_mode == type_mode_auto)
     prefix = "auto; currently ";
 
@@ -480,7 +480,7 @@ set_range_str (void)
     }
 
   if (range)
-    free (range);
+    xfree (range);
   range = concat (pref, tmp, NULL);
 }
 
@@ -504,7 +504,7 @@ set_case_str()
      error ("Unrecognized case-sensitive setting.");
    }
 
-   free (case_sensitive);
+   xfree (case_sensitive);
    case_sensitive = concat (prefix, tmp, NULL);
 }
 
index 2d074d3e5d8d2d68eca8e5e9d70a0186d98bda34..bf52e2feaa2c189d668b9b47c44b8ca8bc034cde 100644 (file)
@@ -164,7 +164,7 @@ init_lwp_list (void)
   for (lp = lwp_list; lp; lp = lpnext)
     {
       lpnext = lp->next;
-      free (lp);
+      xfree (lp);
     }
 
   lwp_list = NULL;
@@ -222,7 +222,7 @@ delete_lwp (int pid)
   else
     lwp_list = lp->next;
 
-  free (lp);
+  xfree (lp);
 }
 
 /* Return a pointer to the structure describing the LWP corresponding
@@ -268,7 +268,7 @@ restore_inferior_pid (void *arg)
 {
   int *saved_pid_ptr = arg;
   inferior_pid = *saved_pid_ptr;
-  free (arg);
+  xfree (arg);
 }
 
 static struct cleanup *
index 3f36bd0e86ced382a6674f2791d3d3c3e3df5472..b3fd14ca961047e3128aab245d599e5a9697c409 100644 (file)
@@ -665,7 +665,7 @@ restore_inferior_pid (void *arg)
 {
   int *saved_pid_ptr = arg;
   inferior_pid = *saved_pid_ptr;
-  free (arg);
+  xfree (arg);
 }
 
 /*
index d6c330255c798fbb9fe26e2ab4f3668754ff4e4f..ae0b51a381d63bbe22b1e05e74e99441dacd5d2c 100644 (file)
@@ -163,7 +163,7 @@ find_methods (struct type *t, char *name, struct symbol **sym_arr)
                                                field_counter);
                    phys_name = alloca (strlen (tmp_name) + 1);
                    strcpy (phys_name, tmp_name);
-                   free (tmp_name);
+                   xfree (tmp_name);
                  }
                else
                  phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
@@ -306,12 +306,12 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
     alloca (nelts * sizeof (struct symtab_and_line));
   return_values.sals = (struct symtab_and_line *)
     xmalloc (nelts * sizeof (struct symtab_and_line));
-  old_chain = make_cleanup (free, return_values.sals);
+  old_chain = make_cleanup (xfree, return_values.sals);
 
   if (canonical)
     {
       canonical_arr = (char **) xmalloc (nelts * sizeof (char *));
-      make_cleanup (free, canonical_arr);
+      make_cleanup (xfree, canonical_arr);
       memset (canonical_arr, 0, nelts * sizeof (char *));
       *canonical = canonical_arr;
     }
@@ -392,7 +392,7 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
              if (canonical_arr)
                {
                  symname = SYMBOL_NAME (sym_arr[num]);
-                 make_cleanup (free, symname);
+                 make_cleanup (xfree, symname);
                  canonical_arr[i] = savestring (symname, strlen (symname));
                }
              return_values.sals[i++] = values.sals[num];
index 054188dc6b4659aaad5c5ac14d11c2a8397eda3e..32f6cbec0827d4121babfe6aeab9e2a2eb8c9ae6 100644 (file)
@@ -379,7 +379,7 @@ restore_inferior_pid (void *arg)
 {
   int *saved_pid_ptr = arg;
   inferior_pid = *saved_pid_ptr;
-  free (arg);
+  xfree (arg);
 }
 
 /* Register a cleanup to restore the value of inferior_pid.  */
index 9ed2e2acf3d6516904ee551ea2324bad6142c8b4..bf98ffadcfa7caa1039b31c2807eee743908a1c7 100644 (file)
@@ -583,7 +583,7 @@ extern int gdbtk_test (char *);
 
   for (i = 0; i < ndir; i++)
     catch_command_errors (directory_command, dirarg[i], 0, RETURN_MASK_ALL);
-  free ((PTR) dirarg);
+  xfree (dirarg);
 
   if (execarg != NULL
       && symarg != NULL
@@ -665,7 +665,7 @@ extern int gdbtk_test (char *);
 #endif
       catch_command_errors (source_command, cmdarg[i], !batch, RETURN_MASK_ALL);
     }
-  free ((PTR) cmdarg);
+  xfree (cmdarg);
 
   /* Read in the old history after all the command files have been read. */
   init_history ();
index c2fc9e1719bb0af4359d65f18dccefb304fdd04f..aa62e94adfb0b996693c4f4d4711e33aadc16112 100644 (file)
@@ -141,7 +141,7 @@ maintenance_demangle (char *args, int from_tty)
       if (demangled != NULL)
        {
          printf_unfiltered ("%s\n", demangled);
-         free (demangled);
+         xfree (demangled);
        }
       else
        {
@@ -444,7 +444,7 @@ maintenance_do_deprecate (char *text, int deprecate)
     {
 
       if (alias->flags & MALLOCED_REPLACEMENT)
-       free (alias->replacement);
+       xfree (alias->replacement);
 
       if (deprecate)
        alias->flags |= (DEPRECATED_WARN_USER | CMD_DEPRECATED);
@@ -457,7 +457,7 @@ maintenance_do_deprecate (char *text, int deprecate)
   else if (cmd)
     {
       if (cmd->flags & MALLOCED_REPLACEMENT)
-       free (cmd->replacement);
+       xfree (cmd->replacement);
 
       if (deprecate)
        cmd->flags |= (DEPRECATED_WARN_USER | CMD_DEPRECATED);
index 66828dd2f5dc3db38fc6cbe521579acc35d07f29..7ed587fb6c5fa474d7a7d38459c078e27771b9a6 100644 (file)
@@ -2286,7 +2286,7 @@ parse_partial_symbols (struct objfile *objfile)
      Minor hack: -O3 images might claim some global data belongs
      to FDR -1. We`ll go along with that */
   fdr_to_pst = (struct pst_map *) xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
-  old_chain = make_cleanup (free, fdr_to_pst);
+  old_chain = make_cleanup (xfree, fdr_to_pst);
   fdr_to_pst++;
   {
     struct partial_symtab *pst = new_psymtab ("", objfile);
@@ -2304,7 +2304,7 @@ parse_partial_symbols (struct objfile *objfile)
 
   /* Pass 0 over external syms: swap them in.  */
   ext_block = (EXTR *) xmalloc (hdr->iextMax * sizeof (EXTR));
-  make_cleanup (free, ext_block);
+  make_cleanup (xfree, ext_block);
 
   ext_out = (char *) debug_info->external_ext;
   ext_out_end = ext_out + hdr->iextMax * external_ext_size;
@@ -2704,7 +2704,7 @@ parse_partial_symbols (struct objfile *objfile)
 
                if (stabstring
                    && stabstring != debug_info->ss + fh->issBase + sh.iss)
-                 free (stabstring);
+                 xfree (stabstring);
              }
              /* end - Handle continuation */
            }
@@ -3394,7 +3394,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
          PDR *pdr_in_end;
 
          pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
-         old_chain = make_cleanup (free, pr_block);
+         old_chain = make_cleanup (xfree, pr_block);
 
          pdr_ptr = ((char *) debug_info->external_pdr
                     + fh->ipdFirst * external_pdr_size);
@@ -3503,7 +3503,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
 
              pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
 
-             old_chain = make_cleanup (free, pr_block);
+             old_chain = make_cleanup (xfree, pr_block);
 
              pdr_ptr = ((char *) debug_info->external_pdr
                         + fh->ipdFirst * external_pdr_size);
index bbd1c00d374d7a6afc1c4d3e70efc48c2935d559..accddd5d542ec02805699e1b14d9cedb540ac9a6 100644 (file)
@@ -428,9 +428,9 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
                  ui_out_field_int (uiout, "offset", offset);
                }
              if (filename != NULL)
-               free (filename);
+               xfree (filename);
              if (name != NULL)
-               free (name);
+               xfree (name);
 
              ui_file_rewind (stb->stream);
              pc += (*tm_print_insn) (pc, &di);
@@ -476,9 +476,9 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
              ui_out_field_int (uiout, "offset", offset);
            }
          if (filename != NULL)
-           free (filename);
+           xfree (filename);
          if (name != NULL)
-           free (name);
+           xfree (name);
 
          ui_file_rewind (stb->stream);
          pc += (*tm_print_insn) (pc, &di);
index a5caa2ac8e07ddbc4b6a70860e94f172e93286ef..c557a9c3bfb8f2235af34d261643992a6f71d5a3 100644 (file)
@@ -64,13 +64,13 @@ mi_cmd_var_create (char *command, char **argv, int argc)
   old_cleanups = make_cleanup (free_current_contents, &name);
 
   frame = xstrdup (argv[1]);
-  old_cleanups = make_cleanup (free, frame);
+  old_cleanups = make_cleanup (xfree, frame);
 
   expr = xstrdup (argv[2]);
 
   if (strcmp (name, "-") == 0)
     {
-      free (name);
+      xfree (name);
       name = varobj_gen_name ();
     }
   else if (!isalpha (*name))
@@ -104,7 +104,7 @@ mi_cmd_var_create (char *command, char **argv, int argc)
   else
     {
       ui_out_field_string (uiout, "type", type);
-      free (type);
+      xfree (type);
     }
 
   do_cleanups (old_cleanups);
@@ -147,9 +147,9 @@ mi_cmd_var_delete (char *command, char **argv, int argc)
       if (strcmp (name, "-c") != 0)
        error ("mi_cmd_var_delete: Invalid option.");
       children_only_p = 1;
-      free (name);
+      xfree (name);
       name = xstrdup (expr);
-      free (expr);
+      xfree (expr);
     }
 
   /* If we didn't error out, now NAME contains the name of the
@@ -289,7 +289,7 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
       cc++;
     }
   ui_out_list_end (uiout);
-  free (childlist);
+  xfree (childlist);
   return MI_CMD_DONE;
 }
 
@@ -433,7 +433,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
          varobj_update_one (*cr);
          cr++;
        }
-      free (rootlist);
+      xfree (rootlist);
       ui_out_list_end (uiout);
     }
   else
@@ -494,7 +494,7 @@ varobj_update_one (struct varobj *var)
          ui_out_field_string (uiout, "type_changed", "false");
          cc++;
        }
-      free (changelist);
+      xfree (changelist);
       return 1;
     }
   return 1;
index 8df51ab2f9186cbeed09ccd9bc8f10654e5c47af..b27d14ea74686da103903a54f07bf52fff569634 100644 (file)
@@ -66,7 +66,7 @@ mi_console_file_delete (struct ui_file *file)
   struct mi_console_file *mi_console = ui_file_data (file);
   if (mi_console->magic != &mi_console_file_magic)
     internal_error ("mi_console_file_delete: bad magic number");
-  free (mi_console);
+  xfree (mi_console);
 }
 
 static void
index 75fd435d9650159154d7a79229d3126b0e028767..1472039ba3f5d451c1743021e5b0a97673269034 100644 (file)
@@ -204,10 +204,10 @@ mi_cmd_exec_interrupt (char *args, int from_tty)
   if (last_async_command)
     fputs_unfiltered (last_async_command, raw_stdout);
   fputs_unfiltered ("^done", raw_stdout);
-  free (last_async_command);
+  xfree (last_async_command);
   if (previous_async_command)
     last_async_command = xstrdup (previous_async_command);
-  free (previous_async_command);
+  xfree (previous_async_command);
   previous_async_command = NULL;
   mi_out_put (uiout, raw_stdout);
   mi_out_rewind (uiout);
@@ -697,7 +697,7 @@ mi_cmd_target_download (char *args, int from_tty)
   struct cleanup *old_cleanups = NULL;
 
   xasprintf (&run, "load %s", args);
-  old_cleanups = make_cleanup (free, run);
+  old_cleanups = make_cleanup (xfree, run);
   execute_command (run, from_tty);
 
   do_cleanups (old_cleanups);
@@ -712,7 +712,7 @@ mi_cmd_target_select (char *args, int from_tty)
   struct cleanup *old_cleanups = NULL;
 
   xasprintf (&run, "target %s", args);
-  old_cleanups = make_cleanup (free, run);
+  old_cleanups = make_cleanup (xfree, run);
 
   /* target-select is always synchronous.  once the call has returned
      we know that we are connected. */
@@ -859,7 +859,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
   /* create a buffer and read it in. */
   total_bytes = word_size * nr_rows * nr_cols;
   mbuf = calloc (total_bytes, 1);
-  make_cleanup (free, mbuf);
+  make_cleanup (xfree, mbuf);
   if (mbuf == NULL)
     {
       xasprintf (&mi_error_message,
@@ -1075,7 +1075,7 @@ captured_mi_execute_command (void *data)
                  fputs_unfiltered (context->token, raw_stdout);
                  fputs_unfiltered ("^error,msg=\"", raw_stdout);
                  fputstr_unfiltered (mi_error_message, '"', raw_stdout);
-                 free (mi_error_message);
+                 xfree (mi_error_message);
                  fputs_unfiltered ("\"\n", raw_stdout);
                }
              mi_out_rewind (uiout);
@@ -1145,7 +1145,7 @@ mi_execute_command (char *cmd, int from_tty)
       if (rc == 0)
        {
          char *msg = error_last_message ();
-         struct cleanup *cleanup = make_cleanup (free, msg);
+         struct cleanup *cleanup = make_cleanup (xfree, msg);
          /* The command execution failed and error() was called
             somewhere */
          fputs_unfiltered (command->token, raw_stdout);
@@ -1248,7 +1248,7 @@ mi_execute_cli_command (const char *cli, char *args)
        /* FIXME: gdb_???? */
        fprintf_unfiltered (gdb_stdout, "cli=%s run=%s\n",
                            cli, run);
-      old_cleanups = make_cleanup (free, run);
+      old_cleanups = make_cleanup (xfree, run);
       execute_command ( /*ui */ run, 0 /*from_tty */ );
       do_cleanups (old_cleanups);
       return;
@@ -1275,7 +1275,7 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty)
   else
     {
       xasprintf (&run, "%s %s", mi, args);
-      old_cleanups = make_cleanup (free, run);
+      old_cleanups = make_cleanup (xfree, run);
     }
 
   if (!target_can_async_p ())
@@ -1369,7 +1369,7 @@ mi_load_progress (const char *section_name,
                 strcmp (previous_sect_name, section_name) : 1);
   if (new_section)
     {
-      free (previous_sect_name);
+      xfree (previous_sect_name);
       previous_sect_name = xstrdup (section_name);
 
       if (last_async_command)
index a7390436d83c8d1f8930566a6e72d1ea35632a77..41e0351da22257e580c9ea15dd88129798a7f038 100644 (file)
@@ -136,14 +136,14 @@ mi_parse_free (struct mi_parse *parse)
   if (parse == NULL)
     return;
   if (parse->command != NULL)
-    free (parse->command);
+    xfree (parse->command);
   if (parse->token != NULL)
-    free (parse->token);
+    xfree (parse->token);
   if (parse->args != NULL)
-    free (parse->args);
+    xfree (parse->args);
   if (parse->argv != NULL)
     freeargv (parse->argv);
-  free (parse);
+  xfree (parse);
 }
 
 
index 94faccb014cb7321a72c60d0b2e3f1b382c3e50f..9070b6fee8ffc0f64cf37f296454ae9e902fc0dc 100644 (file)
@@ -729,7 +729,7 @@ do_discard_minimal_symbols_cleanup (void *arg)
   while (msym_bunch != NULL)
     {
       next = msym_bunch->next;
-      free ((PTR) msym_bunch);
+      xfree (msym_bunch);
       msym_bunch = next;
     }
 }
index 61c9b95316d0097303ab97c9199f461f94dace1e..ffaf2abf774f6039b76767d8aa57187eb54de222 100644 (file)
@@ -2548,7 +2548,7 @@ mips_pop_frame (void)
       else
        linked_proc_desc_table = pi_ptr->next;
 
-      free (pi_ptr);
+      xfree (pi_ptr);
 
       write_register (HI_REGNUM,
                      read_memory_integer (new_sp - 2 * MIPS_SAVED_REGSIZE,
index dec36da698b27d810c052f26a715cbeab4816c02..ea7189b7d99766be49495d2fe0556aa421e4f578 100644 (file)
@@ -752,7 +752,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
   unpush_target (targ_ops);
 
   if (dev_name)
-    free (dev_name);
+    xfree (dev_name);
   dev_name = strsave (args);
 
   monitor_desc = SERIAL_OPEN (dev_name);
@@ -851,7 +851,7 @@ monitor_close (int quitting)
   /* Free breakpoint memory */
   if (breakaddr != NULL)
     {
-      free (breakaddr);
+      xfree (breakaddr);
       breakaddr = NULL;
     }
 
index dcc95d912bb2dd908be8933dc1573960f811f5e0..f5073a6a10ecbc65cff952fc49984b237885a4d0 100644 (file)
@@ -108,7 +108,7 @@ nlm_symtab_read (bfd *abfd, CORE_ADDR addr, struct objfile *objfile)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, symbol_table);
+      back_to = make_cleanup (xfree, symbol_table);
       number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
       if (number_of_symbols < 0)
        error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
index 19e95b573a314085bb18690fae5b68d5770cf53c..3ad6d29771beb007c9cc3103891aafe3c7de16d7 100644 (file)
@@ -262,13 +262,13 @@ allocate_objfile (bfd *abfd, int flags)
       memset (objfile, 0, sizeof (struct objfile));
       objfile->md = NULL;
       obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
-                                 xmalloc, free);
+                                 xmalloc, xfree);
       obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
-                                 free);
+                                 xfree);
       obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
-                                 free);
+                                 xfree);
       obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
-                                 free);
+                                 xfree);
       flags &= ~OBJF_MAPPED;
     }
 
@@ -413,7 +413,7 @@ free_objfile (struct objfile *objfile)
       if (!bfd_close (objfile->obfd))
        warning ("cannot close \"%s\": %s",
                 name, bfd_errmsg (bfd_get_error ()));
-      free (name);
+      xfree (name);
     }
 
   /* Remove it from the chain of all objfiles. */
@@ -855,7 +855,7 @@ open_mapped_file (char *filename, long mtime, int flags)
   symsfilename = concat ("./", basename (filename), ".syms", (char *) NULL);
   if ((fd = open_existing_mapped_file (symsfilename, mtime, flags)) < 0)
     {
-      free (symsfilename);
+      xfree (symsfilename);
       symsfilename = concat (filename, ".syms", (char *) NULL);
       fd = open_existing_mapped_file (symsfilename, mtime, flags);
     }
@@ -871,7 +871,7 @@ open_mapped_file (char *filename, long mtime, int flags)
 
   if ((fd < 0) && (flags & OBJF_MAPPED))
     {
-      free (symsfilename);
+      xfree (symsfilename);
       symsfilename = concat ("./", basename (filename), ".syms",
                             (char *) NULL);
       if ((fd = open (symsfilename, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0)
@@ -884,7 +884,7 @@ open_mapped_file (char *filename, long mtime, int flags)
        }
     }
 
-  free (symsfilename);
+  xfree (symsfilename);
   return (fd);
 }
 
index 7edb9ddbcd32df2accb1666403b2da8f13c029b7..0ca8f8407298642a776c8bfbebe1ca990641ddb9 100644 (file)
@@ -126,7 +126,7 @@ ldr_read_memory (CORE_ADDR memaddr, char *myaddr, int len, int readstring)
       target_read_string (memaddr, &buffer, len, &result);
       if (result == 0)
        strcpy (myaddr, buffer);
-      free (buffer);
+      xfree (buffer);
     }
   else
     result = target_read_memory (memaddr, myaddr, len);
@@ -228,7 +228,7 @@ solib_map_sections (char *arg)
   bfd *abfd;
 
   filename = tilde_expand (so->so_name);
-  old_chain = make_cleanup (free, filename);
+  old_chain = make_cleanup (xfree, filename);
 
   scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
                        &scratch_pathname);
@@ -445,7 +445,7 @@ xfer_link_map_member (struct so_list *so_list_ptr, struct link_map *lm)
        error ("xfer_link_map_member: Can't read pathname for load map: %s\n",
               safe_strerror (errcode));
       strncpy (so_list_ptr->so_name, buffer, MAX_PATH_SIZE - 1);
-      free (buffer);
+      xfree (buffer);
       so_list_ptr->so_name[MAX_PATH_SIZE - 1] = '\0';
 
       for (i = 0; i < lm->module_info.region_count; i++)
@@ -472,7 +472,7 @@ xfer_link_map_member (struct so_list *so_list_ptr, struct link_map *lm)
                region_name = "??";
              warning ("cannot handle shared library relocation for %s (%s)",
                       so_list_ptr->so_name, region_name);
-             free (buffer);
+             xfree (buffer);
            }
        }
 #endif
@@ -797,7 +797,7 @@ clear_solib (void)
     {
       if (so_list_head->sections)
        {
-         free ((PTR) so_list_head->sections);
+         xfree (so_list_head->sections);
        }
       if (so_list_head->abfd)
        {
@@ -812,8 +812,8 @@ clear_solib (void)
 
       next = so_list_head->next;
       if (bfd_filename)
-       free ((PTR) bfd_filename);
-      free ((PTR) so_list_head);
+       xfree (bfd_filename);
+      xfree (so_list_head);
       so_list_head = next;
     }
 }
index 0ba363d82055737d5e08f1504492be351c0b85cc..46774c683e4158e9b3074d3a4f9f28c931fbf32d 100644 (file)
@@ -669,7 +669,7 @@ common:
       else
        {
          fputs_filtered (demangled_name, stream);
-         free (demangled_name);
+         xfree (demangled_name);
        }
     }
   else
index 073d27132e21e6fde8c6b40f0b0d1db93394ef12..45a575b727f6d27b72f764ed5dee0b4348514dd6 100644 (file)
@@ -168,7 +168,7 @@ pa64_solib_sizeof_symbol_table (char *filename)
   if (!abfd)
     {
       close (desc);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
       error ("\"%s\": can't open to read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -176,7 +176,7 @@ pa64_solib_sizeof_symbol_table (char *filename)
   if (!bfd_check_format (abfd, bfd_object))
     {
       bfd_close (abfd);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
       error ("\"%s\": can't read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -192,7 +192,7 @@ pa64_solib_sizeof_symbol_table (char *filename)
     }
 
   bfd_close (abfd);
-  free (filename);
+  xfree (filename);
 
   /* Unfortunately, just summing the sizes of various debug info
      sections isn't a very accurate measurement of how much heap
@@ -573,7 +573,7 @@ get_out:
       struct so_list *temp;
 
       temp = so_list_head;
-      free (so_list_head);
+      xfree (so_list_head);
       so_list_head = temp->next;
     }
   clear_symtab_users ();
@@ -860,7 +860,7 @@ pa64_solib_restart (void)
   while (sl)
     {
       struct so_list *next_sl = sl->next;
-      free (sl);
+      xfree (sl);
       sl = next_sl;
     }
   so_list_head = NULL;
@@ -1213,7 +1213,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, (PTR) symbol_table);
+      back_to = make_cleanup (xfree, (PTR) symbol_table);
       number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
 
       for (i = 0; i < number_of_symbols; i++)
index 693ab95a7cac57a351037dcdb7cd77a9e05a84f7..fae00963435fb0417ada7ccb13b1537a700b6c6d 100644 (file)
@@ -177,7 +177,7 @@ end_arglist (void)
   register struct funcall *call = funcall_chain;
   funcall_chain = call->next;
   arglist_len = call->arglist_len;
-  free ((PTR) call);
+  xfree (call);
   return val;
 }
 
@@ -192,7 +192,7 @@ free_funcalls (void *ignore)
   for (call = funcall_chain; call; call = next)
     {
       next = call->next;
-      free ((PTR) call);
+      xfree (call);
     }
 }
 \f
index 65621e3e0d2bdfd5936693f2ad7333c6956fce19..c57bf8218abe0cb09c090d166dcd2f3748cc4499 100644 (file)
@@ -1438,8 +1438,8 @@ display_command (char *exp, int from_tty)
 static void
 free_display (struct display *d)
 {
-  free ((PTR) d->exp);
-  free ((PTR) d);
+  xfree (d->exp);
+  xfree (d);
 }
 
 /* Clear out the display_chain.
@@ -1453,9 +1453,9 @@ clear_displays (void)
 
   while ((d = display_chain) != NULL)
     {
-      free ((PTR) d->exp);
+      xfree (d->exp);
       display_chain = d->next;
-      free ((PTR) d);
+      xfree (d);
     }
 }
 
index b69207e6b5458eb4d3517e93897e24d186eb0a53..3cebc632c0fc28a81ec8405732d184c1ab35d148 100644 (file)
@@ -65,7 +65,7 @@ restore_inferior_pid (void *arg)
 {
   int *saved_pid_ptr = arg;
   inferior_pid = *saved_pid_ptr;
-  free (arg);
+  xfree (arg);
 }
 
 static struct cleanup *
index 5675edab480b98acdcc3b5372128d5e9764bcaf0..10f2eb94ae126bb67b868e7e1030d722622be60f 100644 (file)
@@ -631,7 +631,7 @@ destroy_one_procinfo (procinfo **list, procinfo *pi)
   close_procinfo_files (pi);
 
   /* Step three: free the memory. */
-  free (pi);
+  xfree (pi);
 }
 
 static void
@@ -2879,7 +2879,7 @@ proc_update_threads (procinfo *pi)
        malloc (sizeof (gdb_prstatus_t) * (nlwp + 1))) == 0)
     perror_with_name ("procfs: malloc failed in update_threads");
 
-  old_chain = make_cleanup (free, prstatus);
+  old_chain = make_cleanup (xfree, prstatus);
   if (ioctl (pi->ctl_fd, PIOCLSTATUS, prstatus) < 0)
     proc_error (pi, "update_threads (PIOCLSTATUS)", __LINE__);
 
index 32224500f5c12f7130ee2cbd89b2d390df29c4fb..dd0ba1c16fe6d5440d5a5846d1816860351a55ba 100644 (file)
 /* OBSOLETE      and mark data and stack spaces as empty.  *x/ */
 /* OBSOLETE  */
 /* OBSOLETE   if (corefile) */
-/* OBSOLETE     free (corefile); */
+/* OBSOLETE     xfree (corefile); */
 /* OBSOLETE   corefile = 0; */
 /* OBSOLETE  */
 /* OBSOLETE   if (corechan >= 0) */
 /* OBSOLETE   if (filename) */
 /* OBSOLETE     { */
 /* OBSOLETE       filename = tilde_expand (filename); */
-/* OBSOLETE       make_cleanup (free, filename); */
+/* OBSOLETE       make_cleanup (xfree, filename); */
 /* OBSOLETE        */
 /* OBSOLETE       if (have_inferior_p ()) */
 /* OBSOLETE     error ("To look at a core file, you must kill the program with \"kill\"."); */
index 6e97c1983a052d47ccaddaa7a9fd7c6d7fad9ba0..f370d3850eaac49b13ad4eab530310c63760592d 100644 (file)
@@ -610,7 +610,7 @@ the baud rate, and the name of the program to run on the remote system.");
     /*EMPTY */ ;
 
   if (prog_name != NULL)
-    free (prog_name);
+    xfree (prog_name);
   prog_name = savestring (p, strlen (p));
 
   adapt_close (0);
index eb18812f6fd7d65e72d4516dd1b635496210ec84..73d37b7255b10d323117850f3bbb997ee2dfd7ea 100644 (file)
@@ -156,7 +156,7 @@ bug_load (char *args, int fromtty)
              gdb_flush (gdb_stdout);
            }
          printf_filtered ("\n");
-         free (buffer);
+         xfree (buffer);
        }
       s = s->next;
     }
index 42e606ffdb9744643e80351daaad0a3c09d79916..9ccac6f3d8b1b12084fbe412d87a2130a7a693fd 100644 (file)
@@ -426,7 +426,7 @@ the baud rate, and the name of the program to run on the remote system.");
     /*EMPTY */ ;
 
   if (prog_name != NULL)
-    free (prog_name);
+    xfree (prog_name);
   prog_name = savestring (p, strlen (p));
 
   eb_close (0);
index 0bd6f6bd8769c2d41e5158e687ff339698b890b3..b2cabce5c45985b39e013e0f08fbb17baca9d736 100644 (file)
@@ -433,7 +433,7 @@ es1800_close (int quitting)
     }
   if (savename != NULL)
     {
-      free (savename);
+      xfree (savename);
     }
   savename = NULL;
 
@@ -1235,7 +1235,7 @@ es1800_load (char *filename, int from_tty)
     }
 
   filename = tilde_expand (filename);
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
 
   switch (es1800_load_format)
     {
index 82eccd57df337efe28b33840d9dee7a5bb759042..1905c613b8d5f40ae71da79e46e83ce0f56c26bb 100644 (file)
@@ -1576,9 +1576,9 @@ device is attached to the target board (e.g., /dev/ttya).\n"
             the user didn't specify a local name, assume it's the same
             as the part of the remote name after the "host:".  */
          if (tftp_name)
-           free (tftp_name);
+           xfree (tftp_name);
          if (tftp_localname)
-           free (tftp_localname);
+           xfree (tftp_localname);
          if (local_name == NULL)
            if ((local_name = strchr (remote_name, ':')) != NULL)
              local_name++;     /* skip over the colon */
@@ -1624,7 +1624,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
   set_current_frame (create_new_frame (read_fp (), stop_pc));
   select_frame (get_current_frame (), 0);
   print_stack_frame (selected_frame, -1, 1);
-  free (serial_port_name);
+  xfree (serial_port_name);
 }
 
 static void
@@ -3230,7 +3230,7 @@ pmon_end_download (int final, int bintotal)
       strcat (cmd, tftp_name);
       strcat (cmd, "\r");
       mips_send_command (cmd, 0);
-      free (cmd);
+      xfree (cmd);
       if (!mips_expect_download ("Downloading from "))
        return;
       if (!mips_expect_download (tftp_name))
index 7840ed52cbc41bc1cf639be5ba4037181d0fb85b..f6b5408733bfa4a56e4296ffeae0f37bf995369e 100644 (file)
@@ -333,7 +333,7 @@ mm_open (char *name, int from_tty)
     /*EMPTY */ ;
 
   if (prog_name != NULL)
-    free (prog_name);
+    xfree (prog_name);
   prog_name = savestring (p, strlen (p));
 
 
@@ -1086,7 +1086,7 @@ mm_load (char *arg_string, int from_tty)
     error ("The load command takes a file name");
 
   arg_string = tilde_expand (arg_string);
-  make_cleanup (free, arg_string);
+  make_cleanup (xfree, arg_string);
   QUIT;
   immediate_quit++;
   error ("File loading is not yet supported for MiniMon.");
index 6428541cec360379c253270806a03c88efa8b83f..691aa726b83ed4d8cc32c8c9f66183cb93157828 100644 (file)
@@ -161,7 +161,7 @@ nindy_close (int quitting)
   nindy_serial = NULL;
 
   if (savename)
-    free (savename);
+    xfree (savename);
   savename = 0;
 }
 
@@ -285,7 +285,7 @@ clean_up_tty (PTR ptrarg)
 {
   struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg;
   SERIAL_SET_TTY_STATE (args->serial, args->state);
-  free (args->state);
+  xfree (args->state);
   warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
 }
 
@@ -299,7 +299,7 @@ static void
 clean_up_int (void)
 {
   SERIAL_SET_TTY_STATE (tty_args.serial, tty_args.state);
-  free (tty_args.state);
+  xfree (tty_args.state);
 
   signal (SIGINT, old_ctrlc);
 #ifdef SIGTSTP
@@ -392,7 +392,7 @@ nindy_wait (int pid, struct target_waitstatus *status)
     }
 
   SERIAL_SET_TTY_STATE (tty_args.serial, tty_args.state);
-  free (tty_args.state);
+  xfree (tty_args.state);
   discard_cleanups (old_cleanups);
 
   if (stop_exit)
@@ -603,7 +603,7 @@ nindy_load (char *filename, int from_tty)
                  s->_raw_size,
                  s->vma);
          ninMemPut (s->vma, buffer, s->_raw_size);
-         free (buffer);
+         xfree (buffer);
        }
     }
   bfd_close (file);
index 2a45cad515516039a05c38a8e86686abbfb9df27..0115e4d4ebecf23bf00516904b1a5c73ee87499b 100644 (file)
@@ -331,7 +331,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
     for (entry = local_bp_list; entry != NULL; entry = entry->next)
       {
        if (preventry)
-         free (preventry);
+         xfree (preventry);
       }
   }
 
@@ -773,7 +773,7 @@ arm_rdi_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
        {
          preventry->next = entry->next;
        }
-      free (entry);
+      xfree (entry);
     }
   return 0;
 }
@@ -982,7 +982,7 @@ rdilogfile_command (char *arg, int from_tty)
     }
 
   if (log_filename)
-    free (log_filename);
+    xfree (log_filename);
 
   log_filename = xstrdup (arg);
 
index 767e0ee4e6f90228fb9205da45f3e767c18168de..223e2ef5f2fd182591c64a5e5bd45c69df3280a6 100644 (file)
@@ -696,7 +696,7 @@ rdp_set_command_line (char *command, char *args)
    */
 
   if (commandline != NULL)
-    free (commandline);
+    xfree (commandline);
 
   commandline = malloc (strlen (command) + strlen (args) + 2);
   if (commandline != NULL)
index febcf5c5ac1870dc6f0544126a8b0ba86054118d..a09c70e384da44165a108153d845d397653fec7d 100644 (file)
@@ -131,7 +131,7 @@ udi_create_inferior (char *execfile, char *args, char **env)
   if (execfile)
     {
       if (prog_name != NULL)
-       free (prog_name);
+       xfree (prog_name);
       prog_name = savestring (execfile, strlen (execfile));
     }
   else if (entry.Offset)
@@ -229,7 +229,7 @@ udi_open (char *name, int from_tty)
     bkpt_table[cnt].Type = 0;
 
   if (udi_config_id)
-    free (udi_config_id);
+    xfree (udi_config_id);
 
   if (!name)
     error ("Usage: target udi config_id, where config_id appears in udi_soc file");
@@ -1081,7 +1081,7 @@ download (char *load_arg_string, int from_tty)
     error ("Must specify at least a file name with the load command");
 
   filename = tilde_expand (filename);
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
 
   while (token = strtok (NULL, " \t"))
     {
index adf17712e50a33a00dde3c48a7a667db21ca0eff..011e1eaa737c11df66eb6ad952f1b140b4ae9e7b 100644 (file)
@@ -700,7 +700,7 @@ vx_load_command (char *arg_string, int from_tty)
     error ("The load command takes a file name");
 
   arg_string = tilde_expand (arg_string);
-  make_cleanup (free, arg_string);
+  make_cleanup (xfree, arg_string);
 
   dont_repeat ();
 
@@ -1209,7 +1209,7 @@ vx_attach (char *args, int from_tty)
   push_target (&vx_run_ops);
 
   if (vx_running)
-    free (vx_running);
+    xfree (vx_running);
   vx_running = 0;
 }
 
@@ -1294,7 +1294,7 @@ vx_proc_close (int quitting)
 {
   inferior_pid = 0;            /* No longer have a process.  */
   if (vx_running)
-    free (vx_running);
+    xfree (vx_running);
   vx_running = 0;
 }
 \f
@@ -1325,7 +1325,7 @@ vx_close (int quitting)
   pClient = 0;
 
   if (vx_host)
-    free (vx_host);            /* The hostname */
+    xfree (vx_host);           /* The hostname */
   vx_host = 0;
 }
 
index 9b49b970ba756fc68187acff3295efba084ca01f..f88c73c28614d1dfd286598298f71f9c8ca600b7 100644 (file)
@@ -4596,7 +4596,7 @@ compare_sections_command (char *args, int from_tty)
 
       /* be clever; compute the host_crc before waiting for target reply */
       sectdata = xmalloc (size);
-      old_chain = make_cleanup (free, sectdata);
+      old_chain = make_cleanup (xfree, sectdata);
       bfd_get_section_contents (exec_bfd, s, sectdata, 0, size);
       host_crc = crc32 ((unsigned char *) sectdata, size, 0xffffffff);
 
index f44d0c10e98abd448abc2e65c0ab289b78a08ea8..e89048485011bed721228457f3a4164eaa26f473 100644 (file)
@@ -977,7 +977,7 @@ xcoff_relocate_symtab (unsigned int pid)
        }
     } while (rc == -1);
   if (ldi)
-    free (ldi);
+    xfree (ldi);
 }
 \f
 /* Core file stuff.  */
index fd073c2e0a58324364ac5d10bf4a229114a85b0a..9c915b0853a601ddaef29a753f0b22ea38a31cf0 100644 (file)
@@ -124,7 +124,7 @@ pipe_close (serial_t scb)
       int pid = state->pid;
       close (scb->fd);
       scb->fd = -1;
-      free (state);
+      xfree (state);
       scb->state = NULL;
       kill (pid, SIGTERM);
       /* Might be useful to check that the child does die. */
index d78fb40c1120a9a797d2407cd2ce91ccd8d84dcc..01c15c6da892e5f910c86fd923604f1fa08e6022 100644 (file)
@@ -209,7 +209,7 @@ serial_open (const char *name)
 
   if (scb->ops->open (scb, open_name))
     {
-      free (scb);
+      xfree (scb);
       return NULL;
     }
 
@@ -310,7 +310,7 @@ do_serial_close (serial_t scb, int really_close)
     scb->ops->close (scb);
 
   if (scb->name)
-    free (scb->name);
+    xfree (scb->name);
 
   if (scb_base == scb)
     scb_base = scb_base->next;
@@ -324,7 +324,7 @@ do_serial_close (serial_t scb, int really_close)
        break;
       }
 
-  free (scb);
+  xfree (scb);
 }
 
 void
@@ -397,7 +397,7 @@ serial_printf (serial_t desc, const char *format,...)
   vasprintf (&buf, format, args);
   SERIAL_WRITE (desc, buf, strlen (buf));
 
-  free (buf);
+  xfree (buf);
   va_end (args);
 }
 
@@ -551,7 +551,7 @@ cleanup_tty (serial_ttystate ttystate)
 {
   printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
   SERIAL_SET_TTY_STATE (tty_desc, ttystate);
-  free (ttystate);
+  xfree (ttystate);
   SERIAL_CLOSE (tty_desc);
 }
 
index f7c7a78c66fc7786bf067e004a3977527407739d..0f535a61c66aa5df9ad669c7f72b7a6b575f530f 100644 (file)
@@ -308,13 +308,13 @@ allocate_rt_common_objfile (void)
   memset (objfile, 0, sizeof (struct objfile));
   objfile->md = NULL;
   obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
-                             xmalloc, free);
+                             xmalloc, xfree);
   obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
-                             free);
+                             xfree);
   obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
-                             free);
+                             xfree);
   obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
-                             free);
+                             xfree);
   objfile->name = mstrsave (objfile->md, "rt_common");
 
   /* Add this file onto the tail of the linked list of other such files. */
@@ -351,7 +351,7 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
     {
       obstack_free (&rt_common_objfile->symbol_obstack, 0);
       obstack_specify_allocation (&rt_common_objfile->symbol_obstack, 0, 0,
-                                 xmalloc, free);
+                                 xmalloc, xfree);
       rt_common_objfile->minimal_symbol_count = 0;
       rt_common_objfile->msymbols = NULL;
     }
@@ -384,7 +384,7 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
 
          prim_record_minimal_symbol (name, inferior_rtc_nlist.n_value,
                                      mst_bss, rt_common_objfile);
-         free (name);
+         xfree (name);
        }
       rtc_symp = SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb.rtc_next);
     }
@@ -439,7 +439,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, (PTR) symbol_table);
+      back_to = make_cleanup (xfree, (PTR) symbol_table);
       number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
 
       for (i = 0; i < number_of_symbols; i++)
@@ -466,7 +466,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
-      back_to = make_cleanup (free, (PTR) symbol_table);
+      back_to = make_cleanup (xfree, (PTR) symbol_table);
       number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
 
       for (i = 0; i < number_of_symbols; i++)
@@ -853,7 +853,7 @@ first_link_map_member (void)
 #else /* SVR4_SHARED_LIBS */
   struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
   char *r_map_buf = xmalloc (lmo->r_map_size);
-  struct cleanup *cleanups = make_cleanup (free, r_map_buf);
+  struct cleanup *cleanups = make_cleanup (xfree, r_map_buf);
 
   read_memory (debug_base + lmo->r_map_offset, r_map_buf, lmo->r_map_size);
 
@@ -902,7 +902,7 @@ open_symbol_file_object (void *from_ttyp)
   int from_tty = *(int *)from_ttyp;
   struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
   char *l_name_buf = xmalloc (lmo->l_name_size);
-  struct cleanup *cleanups = make_cleanup (free, l_name_buf);
+  struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);
 
   if (symfile_objfile)
     if (!query ("Attempt to reload symbols from process? "))
@@ -937,7 +937,7 @@ open_symbol_file_object (void *from_ttyp)
       return 0;
     }
 
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
   /* Have a pathname: read the symbol file.  */
   symbol_file_command (filename, from_tty);
 
@@ -1000,15 +1000,15 @@ svr4_current_sos (void)
       struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
       struct so_list *new
        = (struct so_list *) xmalloc (sizeof (struct so_list));
-      struct cleanup *old_chain = make_cleanup (free, new);
+      struct cleanup *old_chain = make_cleanup (xfree, new);
 
       memset (new, 0, sizeof (*new));
 
       new->lm_info = xmalloc (sizeof (struct lm_info));
-      make_cleanup (free, new->lm_info);
+      make_cleanup (xfree, new->lm_info);
 
       new->lm_info->lm = xmalloc (lmo->link_map_size);
-      make_cleanup (free, new->lm_info->lm);
+      make_cleanup (xfree, new->lm_info->lm);
       memset (new->lm_info->lm, 0, lmo->link_map_size);
 
       read_memory (lm, new->lm_info->lm, lmo->link_map_size);
@@ -1039,7 +1039,7 @@ svr4_current_sos (void)
            {
              strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
              new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-             free (buffer);
+             xfree (buffer);
              strcpy (new->so_original_name, new->so_name);
            }
 
@@ -1522,7 +1522,7 @@ svr4_relocate_main_executable (void)
 
       new_offsets = xcalloc (sizeof (struct section_offsets),
                             symfile_objfile->num_sections);
-      old_chain = make_cleanup (free, new_offsets);
+      old_chain = make_cleanup (xfree, new_offsets);
 
       for (i = 0; i < symfile_objfile->num_sections; i++)
        {
@@ -1667,8 +1667,8 @@ svr4_clear_solib (void)
 static void
 svr4_free_so (struct so_list *so)
 {
-  free (so->lm_info->lm);
-  free (so->lm_info);
+  xfree (so->lm_info->lm);
+  xfree (so->lm_info);
 }
 
 static void
index b8ffaa3d11bde8f01c7a7af16c2fcf71f7d7c9c0..abe4f8b095e5ab74fa5d0eecd7bf363a44dfffdf 100644 (file)
@@ -187,7 +187,7 @@ solib_map_sections (PTR arg)
 
   filename = tilde_expand (so->so_name);
 
-  old_chain = make_cleanup (free, filename);
+  old_chain = make_cleanup (xfree, filename);
   scratch_chan = solib_open (filename, &scratch_pathname);
 
   if (scratch_chan < 0)
@@ -270,7 +270,7 @@ free_so (struct so_list *so)
   char *bfd_filename = 0;
 
   if (so->sections)
-    free (so->sections);
+    xfree (so->sections);
       
   if (so->abfd)
     {
@@ -281,11 +281,11 @@ free_so (struct so_list *so)
     }
 
   if (bfd_filename)
-    free (bfd_filename);
+    xfree (bfd_filename);
 
   TARGET_SO_FREE_SO (so);
 
-  free (so);
+  xfree (so);
 }
 
 
index fb804a3b45cd88a5df5015e47ee7401b52e43bd4..43cd0fa72e451aa64fea165cb8bc82dda03f4d61 100644 (file)
@@ -597,7 +597,7 @@ init_import_symbols (struct objfile *objfile)
     }
 
   objfile->import_list_size = import_list_size;
-  free (string_buffer);
+  xfree (string_buffer);
   return import_list_size;
 }
 
@@ -728,7 +728,7 @@ init_export_symbols (struct objfile *objfile)
     }
 
   objfile->export_list_size = export_list_size;
-  free (string_buffer);
+  xfree (string_buffer);
   return export_list_size;
 }
 \f
index 892cbc9bea49bd5fe3aff7a26a92bf5198043610..dc38145cce96892ca9b2d47232d8ca2b2f57b152 100644 (file)
@@ -230,7 +230,7 @@ som_solib_sizeof_symbol_table (char *filename)
   if (!abfd)
     {
       close (desc);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
       error ("\"%s\": can't open to read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -238,7 +238,7 @@ som_solib_sizeof_symbol_table (char *filename)
   if (!bfd_check_format (abfd, bfd_object))    /* Reads in section info */
     {
       bfd_close (abfd);                /* This also closes desc */
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
       error ("\"%s\": can't read symbols: %s.", filename,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -256,7 +256,7 @@ som_solib_sizeof_symbol_table (char *filename)
     st_size += (LONGEST) bfd_section_size (abfd, sect);
 
   bfd_close (abfd);            /* This also closes desc */
-  free (filename);
+  xfree (filename);
 
   /* Unfortunately, just summing the sizes of various debug info
      sections isn't a very accurate measurement of how much heap
@@ -1007,7 +1007,7 @@ keep_going:
       struct so_list *temp;
 
       temp = so_list_head;
-      free (so_list_head);
+      xfree (so_list_head);
       so_list_head = temp->next;
     }
   clear_symtab_users ();
@@ -1500,7 +1500,7 @@ som_solib_restart (void)
   while (sl)
     {
       struct so_list *next_sl = sl->next;
-      free (sl);
+      xfree (sl);
       sl = next_sl;
     }
   so_list_head = NULL;
index b1bafeea954602cce3547200e244b751a1f7ca96..3d639b9e1a9bec853321d75c02115cf908b38dbf 100644 (file)
@@ -156,7 +156,7 @@ select_source_symtab (register struct symtab *s)
     {
       sals = decode_line_spec ("main", 1);
       sal = sals.sals[0];
-      free (sals.sals);
+      xfree (sals.sals);
       current_source_symtab = sal.symtab;
       current_source_line = max (sal.line - (lines_to_list - 1), 1);
       if (current_source_symtab)
@@ -270,7 +270,7 @@ directory_command (char *dirname, int from_tty)
     {
       if (from_tty && query ("Reinitialize source path to empty? "))
        {
-         free (source_path);
+         xfree (source_path);
          init_source_path ();
        }
     }
@@ -296,7 +296,7 @@ mod_path (char *dirname, char **which_path)
     return;
 
   dirname = strsave (dirname);
-  make_cleanup (free, dirname);
+  make_cleanup (xfree, dirname);
 
   do
     {
@@ -376,7 +376,7 @@ mod_path (char *dirname, char **which_path)
        name = concat (current_directory, SLASH_STRING, name, NULL);
       else
        name = savestring (name, p - name);
-      make_cleanup (free, name);
+      make_cleanup (xfree, name);
 
       /* Unless it's a variable, check existence.  */
       if (name[0] != '$')
@@ -449,14 +449,14 @@ mod_path (char *dirname, char **which_path)
                old[prefix] = c;
                *which_path = concat (temp, "", &old[prefix], NULL);
                prefix = strlen (temp);
-               free (temp);
+               xfree (temp);
              }
            else
              {
                *which_path = concat (name, (old[0] ? tinybuf : old), old, NULL);
                prefix = strlen (name);
              }
-           free (old);
+           xfree (old);
            old = *which_path;
          }
       }
@@ -729,7 +729,7 @@ open_source_file (struct symtab *s)
     {
       fullname = s->fullname;
       s->fullname = mstrsave (s->objfile->md, s->fullname);
-      free (fullname);
+      xfree (fullname);
     }
   return result;
 }
@@ -830,7 +830,7 @@ find_source_lines (struct symtab *s, int desc)
     /* Use malloc, not alloca, because this may be pretty large, and we may
        run into various kinds of limits on stack size.  */
     data = (char *) xmalloc (size);
-    old_cleanups = make_cleanup (free, data);
+    old_cleanups = make_cleanup (xfree, data);
 
     /* Reassign `size' to result of read for systems where \r\n -> \n.  */
     size = myread (desc, data, size);
@@ -1233,12 +1233,12 @@ list_command (char *arg, int from_tty)
       if (sals.nelts > 1)
        {
          ambiguous_line_spec (&sals);
-         free (sals.sals);
+         xfree (sals.sals);
          return;
        }
 
       sal = sals.sals[0];
-      free (sals.sals);
+      xfree (sals.sals);
     }
 
   /* Record whether the BEG arg is all digits.  */
@@ -1267,11 +1267,11 @@ list_command (char *arg, int from_tty)
          if (sals_end.nelts > 1)
            {
              ambiguous_line_spec (&sals_end);
-             free (sals_end.sals);
+             xfree (sals_end.sals);
              return;
            }
          sal_end = sals_end.sals[0];
-         free (sals_end.sals);
+         xfree (sals_end.sals);
        }
     }
 
@@ -1442,7 +1442,7 @@ line_info (char *arg, int from_tty)
        printf_filtered ("Line number %d is out of range for \"%s\".\n",
                         sal.line, sal.symtab->filename);
     }
-  free (sals.sals);
+  xfree (sals.sals);
 }
 \f
 /* Commands to search the source file for a regexp.  */
index ce9b46e1537766243cd1601f4bf713bc50e46927..6df7e70a33da195ab8abd65949fb63c4c0567709 100644 (file)
@@ -411,7 +411,7 @@ sparclite_open (char *name, int from_tty)
   unpush_target (&sparclite_ops);
 
   if (remote_target_name)
-    free (remote_target_name);
+    xfree (remote_target_name);
 
   remote_target_name = strsave (name);
 
index 730df9d80b8dc3608be89496ddd8260042b58d36..ae3802bb6a4864da60332c435e9f14bb5be332ea 100644 (file)
@@ -654,7 +654,7 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type,
   for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
     {
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (free, new);
+      make_cleanup (xfree, new);
       memset (new, 0, sizeof (struct nextfield));
       new->next = fip->list;
       fip->list = new;
@@ -814,7 +814,7 @@ read_cfront_member_functions (struct field_info *fip, char **pp,
 
       new_fnlist = (struct next_fnfieldlist *)
        xmalloc (sizeof (struct next_fnfieldlist));
-      make_cleanup (free, new_fnlist);
+      make_cleanup (xfree, new_fnlist);
       memset (new_fnlist, 0, sizeof (struct next_fnfieldlist));
 
       /* The following is code to work around cfront generated stabs.
@@ -857,7 +857,7 @@ read_cfront_member_functions (struct field_info *fip, char **pp,
 
       new_sublist =
        (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield));
-      make_cleanup (free, new_sublist);
+      make_cleanup (xfree, new_sublist);
       memset (new_sublist, 0, sizeof (struct next_fnfield));
 
       /* eat 1; from :;2A.; */
@@ -2989,7 +2989,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
 
       new_fnlist = (struct next_fnfieldlist *)
        xmalloc (sizeof (struct next_fnfieldlist));
-      make_cleanup (free, new_fnlist);
+      make_cleanup (xfree, new_fnlist);
       memset (new_fnlist, 0, sizeof (struct next_fnfieldlist));
 
       if ((*pp)[0] == 'o' && (*pp)[1] == 'p' && is_cplus_marker ((*pp)[2]))
@@ -3032,7 +3032,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
        {
          new_sublist =
            (struct next_fnfield *) xmalloc (sizeof (struct next_fnfield));
-         make_cleanup (free, new_sublist);
+         make_cleanup (xfree, new_sublist);
          memset (new_sublist, 0, sizeof (struct next_fnfield));
 
          /* Check for and handle cretinous dbx symbol name continuation!  */
@@ -3508,7 +3508,7 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
       STABS_CONTINUE (pp, objfile);
       /* Get space to record the next field's data.  */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (free, new);
+      make_cleanup (xfree, new);
       memset (new, 0, sizeof (struct nextfield));
       new->next = fip->list;
       fip->list = new;
@@ -3628,7 +3628,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
   for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
     {
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (free, new);
+      make_cleanup (xfree, new);
       memset (new, 0, sizeof (struct nextfield));
       new->next = fip->list;
       fip->list = new;
@@ -3848,7 +3848,7 @@ read_cfront_static_fields (struct field_info *fip, char **pp, struct type *type,
 
       /* allocate a new fip */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (free, new);
+      make_cleanup (xfree, new);
       memset (new, 0, sizeof (struct nextfield));
       new->next = fip->list;
       fip->list = new;
@@ -3911,7 +3911,7 @@ copy_cfront_struct_fields (struct field_info *fip, struct type *type,
     {
       /* allocate a new fip */
       new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
-      make_cleanup (free, new);
+      make_cleanup (xfree, new);
       memset (new, 0, sizeof (struct nextfield));
       new->next = fip->list;
       fip->list = new;
@@ -5150,7 +5150,7 @@ end_stabs (void)
 {
   if (type_vector)
     {
-      free ((char *) type_vector);
+      xfree (type_vector);
     }
   type_vector = 0;
   type_vector_length = 0;
@@ -5163,7 +5163,7 @@ finish_global_stabs (struct objfile *objfile)
   if (global_stabs)
     {
       patch_block_stabs (global_symbols, global_stabs, objfile);
-      free ((PTR) global_stabs);
+      xfree (global_stabs);
       global_stabs = NULL;
     }
 }
index e0f38e27cf9d6399710a05a066a73a54292bdb67..85f37d88d03ee168c02f12ea16f2fb400691c2fc 100644 (file)
@@ -737,7 +737,7 @@ parse_frame_specification (char *frame_exp)
          addr_string = savestring (frame_exp, p - frame_exp);
 
          {
-           tmp_cleanup = make_cleanup (free, addr_string);
+           tmp_cleanup = make_cleanup (xfree, addr_string);
            args[numargs++] = parse_and_eval_address (addr_string);
            do_cleanups (tmp_cleanup);
          }
@@ -1216,7 +1216,7 @@ backtrace_command (char *arg, int from_tty)
   backtrace_command_1 (argPtr, (argIndicatingFullTrace >= 0), from_tty);
 
   if (argIndicatingFullTrace >= 0 && totArgLen > 0)
-    free (argPtr);
+    xfree (argPtr);
 
   if (old_chain)
     do_cleanups (old_chain);
@@ -1959,7 +1959,7 @@ func_command (char *arg, int from_tty)
   while (!found && level == 0);
 
   if (func_bounds)
-    free (func_bounds);
+    xfree (func_bounds);
 
   if (!found)
     printf_filtered ("'%s' not within current stack frame.\n", arg);
index 987e82f0ebc3a5a496740275f37bbce27e120abb..326084e26bab4abb427235eb3201581c96b21aee 100644 (file)
@@ -53,7 +53,7 @@ core_file_command (char *filename, int from_tty)
      and mark data and stack spaces as empty.  */
 
   if (corefile)
-    free (corefile);
+    xfree (corefile);
   corefile = 0;
 
   if (corechan >= 0)
@@ -70,7 +70,7 @@ core_file_command (char *filename, int from_tty)
   if (filename)
     {
       filename = tilde_expand (filename);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
 
       if (have_inferior_p ())
        error ("To look at a core file, you must kill the program with \"kill\".");
index 60978181bb38ce3c77ee3944809f1ca97a340701..983db2278163b18422e373da014b209d6dfd2c69 100644 (file)
@@ -491,8 +491,8 @@ free_section_addr_info (struct section_addr_info *sap)
 
   for (idx = 0; idx < MAX_SECTIONS; idx++)
     if (sap->other[idx].name)
-      free (sap->other[idx].name);
-  free (sap);
+      xfree (sap->other[idx].name);
+  xfree (sap);
 }
 
 
@@ -1061,10 +1061,10 @@ symfile_bfd_open (char *name)
 #endif
   if (desc < 0)
     {
-      make_cleanup (free, name);
+      make_cleanup (xfree, name);
       perror_with_name (name);
     }
-  free (name);                 /* Free 1st new malloc'd copy */
+  xfree (name);                        /* Free 1st new malloc'd copy */
   name = absolute_name;                /* Keep 2nd malloc'd copy in bfd */
   /* It'll be freed in free_objfile(). */
 
@@ -1072,7 +1072,7 @@ symfile_bfd_open (char *name)
   if (!sym_bfd)
     {
       close (desc);
-      make_cleanup (free, name);
+      make_cleanup (xfree, name);
       error ("\"%s\": can't open to read symbols: %s.", name,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -1084,7 +1084,7 @@ symfile_bfd_open (char *name)
          on error it does not free all the storage associated with the
          bfd).  */
       bfd_close (sym_bfd);     /* This also closes desc */
-      make_cleanup (free, name);
+      make_cleanup (xfree, name);
       error ("\"%s\": can't read symbols: %s.", name,
             bfd_errmsg (bfd_get_error ()));
     }
@@ -1172,7 +1172,7 @@ generic_load (char *args, int from_tty)
   /* Parse the input argument - the user can specify a load offset as
      a second argument. */
   filename = xmalloc (strlen (args) + 1);
-  old_cleanups = make_cleanup (free, filename);
+  old_cleanups = make_cleanup (xfree, filename);
   strcpy (filename, args);
   offptr = strchr (filename, ' ');
   if (offptr != NULL)
@@ -1232,7 +1232,7 @@ generic_load (char *args, int from_tty)
                block_size = size;
 
              buffer = xmalloc (size);
-             old_chain = make_cleanup (free, buffer);
+             old_chain = make_cleanup (xfree, buffer);
 
              /* Is this really necessary?  I guess it gives the user something
                 to look at during a long download.  */
@@ -1269,7 +1269,7 @@ generic_load (char *args, int from_tty)
                          that.  remote.c could implement that method
                          using the ``qCRC'' packet.  */
                      char *check = xmalloc (len);
-                     struct cleanup *verify_cleanups = make_cleanup (free, check);
+                     struct cleanup *verify_cleanups = make_cleanup (xfree, check);
                      if (target_read_memory (lma, check, len) != 0)
                        error ("Download verify read failed at 0x%s",
                               paddr (lma));
@@ -1453,7 +1453,7 @@ add_symbol_file_command (char *args, int from_tty)
        {
          /* The first argument is the file name. */
          filename = tilde_expand (arg);
-         my_cleanups = make_cleanup (free, filename);
+         my_cleanups = make_cleanup (xfree, filename);
        }
       else
        if (argcnt == 1)
@@ -1685,13 +1685,13 @@ reread_symbols (void)
              /* obstack_specify_allocation also initializes the obstack so
                 it is empty.  */
              obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
-                                         xmalloc, free);
+                                         xmalloc, xfree);
              obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0,
-                                         xmalloc, free);
+                                         xmalloc, xfree);
              obstack_specify_allocation (&objfile->symbol_obstack, 0, 0,
-                                         xmalloc, free);
+                                         xmalloc, xfree);
              obstack_specify_allocation (&objfile->type_obstack, 0, 0,
-                                         xmalloc, free);
+                                         xmalloc, xfree);
              if (build_objfile_section_table (objfile))
                {
                  error ("Can't find the file sections in `%s': %s",
@@ -1841,7 +1841,7 @@ set_ext_lang_command (char *args, int from_tty)
       /*   query ("Really make files of type %s '%s'?", */
       /*          ext_args, language_str (lang));           */
 
-      free (filename_language_table[i].ext);
+      xfree (filename_language_table[i].ext);
       filename_language_table[i].ext = strsave (ext_args);
       filename_language_table[i].lang = lang;
     }
@@ -2954,7 +2954,7 @@ static void
 simple_free_overlay_table (void)
 {
   if (cache_ovly_table)
-    free (cache_ovly_table);
+    xfree (cache_ovly_table);
   cache_novlys = 0;
   cache_ovly_table = NULL;
   cache_ovly_table_base = 0;
@@ -2966,7 +2966,7 @@ static void
 simple_free_overlay_region_table (void)
 {
   if (cache_ovly_region_table)
-    free (cache_ovly_region_table);
+    xfree (cache_ovly_region_table);
   cache_novly_regions = 0;
   cache_ovly_region_table = NULL;
   cache_ovly_region_table_base = 0;
index 21bc3d413972747613c062b42036f36b92a1a540..5add35afbae7f539045f1379167a3ae9e74d9d68 100644 (file)
@@ -524,7 +524,7 @@ Arguments missing: an output file name and an optional symbol file name");
     }
 
   filename = tilde_expand (filename);
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
 
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
@@ -758,7 +758,7 @@ maintenance_print_psymbols (char *args, int from_tty)
     }
 
   filename = tilde_expand (filename);
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
 
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
@@ -901,7 +901,7 @@ maintenance_print_msymbols (char *args, int from_tty)
     }
 
   filename = tilde_expand (filename);
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
 
   outfile = gdb_fopen (filename, FOPEN_WT);
   if (outfile == 0)
index 9f6fb56cf2060895dd21ea71fc2aa6588da801c0..5cb29e4d15b7d4cf2df9eb72ed1751aea7753463 100644 (file)
@@ -595,7 +595,7 @@ lookup_symbol (const char *name, const struct block *block,
   returnval = lookup_symbol_aux (modified_name, block, namespace,
                                 is_a_field_of_this, symtab);
   if (needtofreename)
-    free (modified_name2);
+    xfree (modified_name2);
 
   return returnval;     
 }
@@ -2278,7 +2278,7 @@ free_search_symbols (struct symbol_search *symbols)
   for (p = symbols; p != NULL; p = next)
     {
       next = p->next;
-      free (p);
+      xfree (p);
     }
 }
 
@@ -2637,7 +2637,7 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
       else
        {
          fputs_filtered (demangled_name, stream);
-         free (demangled_name);
+         xfree (demangled_name);
        }
 #endif
     }
@@ -2876,7 +2876,7 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
          {
            if (STREQ (new, return_val[i]))
              {
-               free (new);
+               xfree (new);
                return;
              }
          }
@@ -3183,7 +3183,7 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
   /* skip symbols that cannot match */
   if (strcmp (sym_name, oload_name) != 0)
     {
-      free (sym_name);
+      xfree (sym_name);
       return;
     }
 
@@ -3206,7 +3206,7 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
   sym_return_val[sym_return_val_index++] = sym;
   sym_return_val[sym_return_val_index] = NULL;
 
-  free (sym_name);
+  xfree (sym_name);
 }
 
 /* Return a null-terminated list of pointers to function symbols that
@@ -3327,7 +3327,7 @@ make_symbol_overload_list (struct symbol *fsym)
       }
   }
 
-  free (oload_name);
+  xfree (oload_name);
 
   return (sym_return_val);
 }
index fc3e6c098988b4150a0d7b401d07cbc45a4d7d31..ec4d01eff0ba13c7a1da777312c8463cd2009484 100644 (file)
@@ -664,7 +664,7 @@ push_target (struct target_ops *t)
        else
          target_stack = cur->next;     /* Unchain first on list */
        tmp = cur->next;
-       free (cur);
+       xfree (cur);
        cur = tmp;
       }
 
@@ -718,7 +718,7 @@ unpush_target (struct target_ops *t)
   else
     prev->next = cur->next;
 
-  free (cur);                  /* Release the target_stack_item */
+  xfree (cur);                 /* Release the target_stack_item */
 
   update_current_target ();
   cleanup_target (&current_target);
index 7c3c0ae28fa4b75dd3ba19a59b9198d1af93c97b..0296149ce2cf3b752818ad09c9057560c6093ff5 100644 (file)
@@ -148,7 +148,7 @@ restore_inferior_pid (void *arg)
 {
   int *saved_pid_ptr = arg;
   inferior_pid = *saved_pid_ptr;
-  free (arg);
+  xfree (arg);
 }
 
 static struct cleanup *
index 7f509765b9c223121e12e9099e793580ddc6a29b..647976c5719694ac2905999c2b345d8a8f90ab76 100644 (file)
@@ -74,9 +74,9 @@ free_thread (struct thread_info *tp)
   /* FIXME: do I ever need to call the back-end to give it a
      chance at this private data before deleting the thread?  */
   if (tp->private)
-    free (tp->private);
+    xfree (tp->private);
 
-  free (tp);
+  xfree (tp);
 }
 
 void
@@ -491,7 +491,7 @@ do_restore_current_thread_cleanup (void *arg)
 {
   struct current_thread_cleanup *old = arg;
   restore_current_thread (old->inferior_pid);
-  free (old);
+  xfree (old);
 }
 
 static struct cleanup *
@@ -532,7 +532,7 @@ thread_apply_all_command (char *cmd, int from_tty)
   /* Save a copy of the command in case it is clobbered by
      execute_command */
   saved_cmd = strdup (cmd);
-  saved_cmd_cleanup_chain = make_cleanup (free, (void *) saved_cmd);
+  saved_cmd_cleanup_chain = make_cleanup (xfree, (void *) saved_cmd);
   for (tp = thread_list; tp; tp = tp->next)
     if (thread_alive (tp))
       {
@@ -575,7 +575,7 @@ thread_apply_command (char *tidlist, int from_tty)
   /* Save a copy of the command in case it is clobbered by
      execute_command */
   saved_cmd = strdup (cmd);
-  saved_cmd_cleanup_chain = make_cleanup (free, (void *) saved_cmd);
+  saved_cmd_cleanup_chain = make_cleanup (xfree, (void *) saved_cmd);
   while (tidlist < cmd)
     {
       struct thread_info *tp;
index f80be47e13c3934950650114e68b0e1840bb2d24..a0447777ac9f8956d952edbe0a6cb3fcd426b7fd 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -657,7 +657,7 @@ void
 do_chdir_cleanup (void *old_dir)
 {
   chdir (old_dir);
-  free (old_dir);
+  xfree (old_dir);
 }
 #endif
 
@@ -1023,7 +1023,7 @@ gdb_readline (char *prompt_arg)
               if we are called again fgetc will still return EOF and
               we'll return NULL then.  */
            break;
-         free (result);
+         xfree (result);
          return NULL;
        }
 
@@ -1275,7 +1275,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
       while (*p1)
        *p++ = *p1++;
 
-      free (rl);               /* Allocated in readline.  */
+      xfree (rl);              /* Allocated in readline.  */
 
       if (p == linebuffer || *(p - 1) != '\\')
        break;
@@ -1323,7 +1323,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
          /* If there was an error, call this function again.  */
          if (expanded < 0)
            {
-             free (history_value);
+             xfree (history_value);
              return command_line_input (prompt_arg, repeat, annotation_suffix);
            }
          if (strlen (history_value) > linelength)
@@ -1333,7 +1333,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
            }
          strcpy (linebuffer, history_value);
          p = linebuffer + strlen (linebuffer);
-         free (history_value);
+         xfree (history_value);
        }
     }
 
@@ -1574,7 +1574,7 @@ get_prompt_1 (void *data)
                         from bad user-supplied format string? */
                      sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
                               tmp);
-                     free (tmp);
+                     xfree (tmp);
                    }
                  else
                    {
@@ -1692,7 +1692,7 @@ set_prompt (char *s)
 /* ??rehrauer: I don't know why this fails, since it looks as though
    assignments to prompt are wrapped in calls to savestring...
    if (prompt != NULL)
-   free (prompt);
+   xfree (prompt);
  */
   if (event_loop_p)
     PROMPT (0) = savestring (s, strlen (s));
index c33e552e2184ec59cebeb941045a1fafb7e606ca..f275458dfa24fbf086ccb43522b086114484c7aa 100644 (file)
@@ -341,7 +341,7 @@ set_raw_tracepoint (struct symtab_and_line sal)
   struct cleanup *old_chain;
 
   t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
-  old_chain = make_cleanup (free, t);
+  old_chain = make_cleanup (xfree, t);
   memset (t, 0, sizeof (*t));
   t->address = sal.pc;
   if (sal.symtab == NULL)
@@ -576,13 +576,13 @@ tracepoint_operation (struct tracepoint *t, int from_tty,
        delete_tracepoint_hook (t);
 
       if (t->addr_string)
-       free (t->addr_string);
+       xfree (t->addr_string);
       if (t->source_file)
-       free (t->source_file);
+       xfree (t->source_file);
       if (t->actions)
        free_actions (t);
 
-      free (t);
+      xfree (t);
       break;
     }
 }
@@ -971,7 +971,7 @@ validate_actionline (char **line, struct tracepoint *t)
            error ("expression too complicated, try simplifying");
 
          ax_reqs (aexpr, &areqs);
-         (void) make_cleanup (free, areqs.reg_mask);
+         (void) make_cleanup (xfree, areqs.reg_mask);
 
          if (areqs.flaw != agent_flaw_none)
            error ("malformed expression");
@@ -1022,8 +1022,8 @@ free_actions (struct tracepoint *t)
     {
       next = line->next;
       if (line->action)
-       free (line->action);
-      free (line);
+       xfree (line->action);
+      xfree (line);
     }
   t->actions = NULL;
 }
@@ -1457,9 +1457,9 @@ free_actions_list (char **actions_list)
     return;
 
   for (ndx = 0; actions_list[ndx]; ndx++)
-    free (actions_list[ndx]);
+    xfree (actions_list[ndx]);
 
-  free (actions_list);
+  xfree (actions_list);
 }
 
 /* render all actions into gdb protocol */
@@ -2098,7 +2098,7 @@ trace_find_line_command (char *args, int from_tty)
          sal = sals.sals[0];
        }
 
-      old_chain = make_cleanup (free, sals.sals);
+      old_chain = make_cleanup (xfree, sals.sals);
       if (sal.symtab == 0)
        {
          printf_filtered ("TFIND: No line number information available");
index 34591dece84c6cd39307b229837d5638be139035..bf3574bdbb00c5b20a6472eca15d459e6199928b 100644 (file)
@@ -89,9 +89,9 @@ tui_file_delete (struct ui_file *file)
   if ((tmpstream->ts_streamtype == astring) &&
       (tmpstream->ts_strbuf != NULL))
     {
-      free (tmpstream->ts_strbuf);
+      xfree (tmpstream->ts_strbuf);
     }
-  free (tmpstream);
+  xfree (tmpstream);
 }
 
 struct ui_file *
index 9f831193c6b2b4c47528e8417055f2714a93518e..b38f67d8f7a6b24aafab2eccebaf3f7350eaa39f 100644 (file)
@@ -241,7 +241,7 @@ tuiFree (ptr)
 {
   if (ptr != (char *) NULL)
     {
-      free (ptr);
+      xfree (ptr);
     }
 
   return;
@@ -626,7 +626,7 @@ strcat_to_buf_with_fmt (va_alist)
   format = va_arg (args, char *);
 #endif
   vasprintf (&linebuffer, format, args);
-  old_cleanups = make_cleanup (free, linebuffer);
+  old_cleanups = make_cleanup (xfree, linebuffer);
   strcat_to_buf (buf, bufLen, linebuffer);
   do_cleanups (old_cleanups);
   va_end (args);
index 50fa4a75c115f80704f37d991a6aef7abe51c33a..d9b7b99241a3da222d2c3d53d40082ffc261e722 100644 (file)
@@ -1378,7 +1378,7 @@ freeWindow (winInfo)
       winInfo->generic.handle = (WINDOW *) NULL;
       freeWinContent (&winInfo->generic);
     }
-  free (winInfo);
+  xfree (winInfo);
 
   return;
 }                              /* freeWindow */
index f394205b7cdaf26020d10abf05161e65d21a4dec..8a6648a310fb8ccbe6efa8a2622c6d49243b026b 100644 (file)
@@ -603,7 +603,7 @@ _tuiSetLayoutTo (layoutName)
            newLayout = _prevLayout ();
          else
            status = TUI_FAILURE;
-         free (bufPtr);
+         xfree (bufPtr);
 
          tuiSetLayout (newLayout, dpyType);
        }
index e91838cadc10d75dffe21ac1b1c825c9aec52c59..616cc5494ceb74e240b6cfa9e6ae6fcac9b33660 100644 (file)
@@ -68,7 +68,7 @@ void
 ui_file_delete (struct ui_file *file)
 {
   file->to_delete (file);
-  free (file);
+  xfree (file);
 }
 
 static int
@@ -316,8 +316,8 @@ mem_file_delete (struct ui_file *file)
   if (stream->magic != &mem_file_magic)
     internal_error ("mem_file_delete: bad magic number");
   if (stream->buffer != NULL)
-    free (stream->buffer);
-  free (stream);
+    xfree (stream->buffer);
+  xfree (stream);
 }
 
 struct ui_file *
@@ -420,7 +420,7 @@ stdio_file_delete (struct ui_file *file)
     {
       fclose (stdio->file);
     }
-  free (stdio);
+  xfree (stdio);
 }
 
 static void
index a95831da28e7f13ce5d167696fadac22ed79292a..79533267edcc0704b4ac402069929818e580ac4e 100644 (file)
@@ -235,7 +235,7 @@ ui_out_table_end (struct ui_out *uiout)
   uo_table_end (uiout);
 
   if (uiout->table_id)
-    free (uiout->table_id);
+    xfree (uiout->table_id);
   clear_header_list (uiout);
 }
 
@@ -315,7 +315,7 @@ ui_out_field_stream (struct ui_out *uiout, char *fldname, struct ui_stream *buf)
 {
   long length;
   char *buffer = ui_file_xstrdup (buf->stream, &length);
-  struct cleanup *old_cleanup = make_cleanup (free, buffer);
+  struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
   if (length > 0)
     ui_out_field_string (uiout, fldname, buffer);
   else
@@ -425,7 +425,7 @@ void
 ui_out_stream_delete (struct ui_stream *buf)
 {
   ui_file_delete (buf->stream);
-  free (buf);
+  xfree (buf);
 }
 
 static void
@@ -770,8 +770,8 @@ clear_header_list (struct ui_out *uiout)
       uiout->headercurr = uiout->headerfirst;
       uiout->headerfirst = uiout->headerfirst->next;
       if (uiout->headercurr->colhdr != NULL)
-       free (uiout->headercurr->colhdr);
-      free (uiout->headercurr);
+       xfree (uiout->headercurr->colhdr);
+      xfree (uiout->headercurr);
     }
   uiout->headerlast = NULL;
   uiout->headercurr = NULL;
index b8a3deb163b058697b51253407f3eb670f2873d7..84431fe47a52238ac80849752eed3654fba375e9 100644 (file)
@@ -48,7 +48,7 @@ core_file_command (char *filename, int from_tty)
      and mark data and stack spaces as empty.  */
 
   if (corefile)
-    free (corefile);
+    xfree (corefile);
   corefile = 0;
 
   if (corechan >= 0)
@@ -65,7 +65,7 @@ core_file_command (char *filename, int from_tty)
   if (filename)
     {
       filename = tilde_expand (filename);
-      make_cleanup (free, filename);
+      make_cleanup (xfree, filename);
 
       if (have_inferior_p ())
        error ("To look at a core file, you must kill the program with \"kill\".");
index 6895c02db1148728cead52edf4cfd2c8e1810891..2ebe1692c5004bfce78c1d6a3fcb46bdcd178428 100644 (file)
@@ -295,7 +295,7 @@ do_my_cleanups (register struct cleanup **pmy_chain,
     {
       *pmy_chain = ptr->next;  /* Do this first incase recursion */
       (*ptr->function) (ptr->arg);
-      free (ptr);
+      xfree (ptr);
     }
 }
 
@@ -328,7 +328,7 @@ discard_my_cleanups (register struct cleanup **pmy_chain,
   while ((ptr = *pmy_chain) != old_chain)
     {
       *pmy_chain = ptr->next;
-      free (ptr);
+      xfree (ptr);
     }
 }
 
@@ -389,7 +389,7 @@ free_current_contents (void *ptr)
     internal_error ("free_current_contents: NULL pointer");
   if (*location != NULL)
     {
-      free (*location);
+      xfree (*location);
       *location = NULL;
     }
 }
@@ -449,7 +449,7 @@ do_all_continuations (void)
        (continuation_ptr->continuation_hook) (continuation_ptr->arg_list);
        saved_continuation = continuation_ptr;
        continuation_ptr = continuation_ptr->next;
-       free (saved_continuation);
+       xfree (saved_continuation);
      }
 }
 
@@ -464,7 +464,7 @@ discard_all_continuations (void)
     {
       continuation_ptr = cmd_continuation;
       cmd_continuation = continuation_ptr->next;
-      free (continuation_ptr);
+      xfree (continuation_ptr);
     }
 }
 
@@ -511,7 +511,7 @@ do_all_intermediate_continuations (void)
        (continuation_ptr->continuation_hook) (continuation_ptr->arg_list);
        saved_continuation = continuation_ptr;
        continuation_ptr = continuation_ptr->next;
-       free (saved_continuation);
+       xfree (saved_continuation);
      }
 }
 
@@ -526,7 +526,7 @@ discard_all_intermediate_continuations (void)
     {
       continuation_ptr = intermediate_continuation;
       intermediate_continuation = continuation_ptr->next;
-      free (continuation_ptr);
+      xfree (continuation_ptr);
     }
 }
 
@@ -621,7 +621,7 @@ verror (const char *string, va_list args)
   vfprintf_filtered (gdb_lasterr, string, args);
   /* Retrieve the last error and print it to gdb_stderr */
   err_string = error_last_message ();
-  err_string_cleanup = make_cleanup (free, err_string);
+  err_string_cleanup = make_cleanup (xfree, err_string);
   fputs_filtered (err_string, gdb_stderr);
   fprintf_filtered (gdb_stderr, "\n");
   do_cleanups (err_string_cleanup);
@@ -642,7 +642,7 @@ error_stream (struct ui_file *stream)
 {
   long size;
   char *msg = ui_file_xstrdup (stream, &size);
-  make_cleanup (free, msg);
+  make_cleanup (xfree, msg);
   error ("%s", msg);
 }
 
@@ -932,7 +932,7 @@ mrealloc (PTR md, PTR ptr, size_t size)
 void
 mfree (PTR md, PTR ptr)
 {
-  free (ptr);
+  xfree (ptr);
 }
 
 #endif /* USE_MMALLOC */
@@ -1077,6 +1077,16 @@ xrealloc (PTR ptr, size_t size)
 {
   return (xmrealloc ((PTR) NULL, ptr, size));
 }
+
+/* Free up space allocated by one of xmalloc(), xcalloc(), or
+   xrealloc().  */
+
+void
+xfree (void *ptr)
+{
+  if (ptr != NULL)
+    free (ptr);
+}
 \f
 
 /* Like asprintf/vasprintf but get an internal_error if the call
@@ -1636,7 +1646,7 @@ prompt_for_continue (void)
          else
            async_request_quit (0);
        }
-      free (ignore);
+      xfree (ignore);
     }
   immediate_quit--;
 
@@ -1982,7 +1992,7 @@ vfprintf_maybe_filtered (struct ui_file *stream, const char *format,
   struct cleanup *old_cleanups;
 
   xvasprintf (&linebuffer, format, args);
-  old_cleanups = make_cleanup (free, linebuffer);
+  old_cleanups = make_cleanup (xfree, linebuffer);
   fputs_maybe_filtered (linebuffer, stream, filter);
   do_cleanups (old_cleanups);
 }
@@ -2001,7 +2011,7 @@ vfprintf_unfiltered (struct ui_file *stream, const char *format, va_list args)
   struct cleanup *old_cleanups;
 
   xvasprintf (&linebuffer, format, args);
-  old_cleanups = make_cleanup (free, linebuffer);
+  old_cleanups = make_cleanup (xfree, linebuffer);
   fputs_unfiltered (linebuffer, stream);
   do_cleanups (old_cleanups);
 }
@@ -2112,7 +2122,7 @@ n_spaces (int n)
   if (n > max_spaces)
     {
       if (spaces)
-       free (spaces);
+       xfree (spaces);
       spaces = (char *) xmalloc (n + 1);
       for (t = spaces + n; t != spaces;)
        *--t = ' ';
@@ -2170,7 +2180,7 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name, enum language lang,
          fputs_filtered (demangled ? demangled : name, stream);
          if (demangled != NULL)
            {
-             free (demangled);
+             xfree (demangled);
            }
        }
     }
index 918398493bcc7ad95388ddd7fc700e243bae6979..835349c7085f50d750439adc53795e7e75299e9e 100644 (file)
@@ -2788,7 +2788,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
          default:
            break;
          }
-      free (parm_types);
+      xfree (parm_types);
       if (overload_debug)
        {
          if (method)
@@ -2860,7 +2860,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
   else
     {
       *symp = oload_syms[oload_champ];
-      free (func_name);
+      xfree (func_name);
     }
 
   return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0);
index 0432bf241865ff3e60390eda5f25b73e0a81410d..84103c65cb01fcbac639bfd8f0fcea904026d9a0 100644 (file)
@@ -990,7 +990,7 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
     {
       fprintf_filtered (stream, "%1d", digits[i]);
     }
-  free (digits);
+  xfree (digits);
 
   fprintf_filtered (stream, local_decimal_format_suffix ());
 }
@@ -1202,7 +1202,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
     {
       buffer = (char *) xmalloc (len * width);
       bufptr = buffer;
-      old_chain = make_cleanup (free, buffer);
+      old_chain = make_cleanup (xfree, buffer);
 
       nfetch = partial_memory_read (addr, bufptr, len * width, &errcode)
        / width;
@@ -1225,7 +1225,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
              buffer = (char *) xrealloc (buffer, (nfetch + bufsize) * width);
            }
 
-         old_chain = make_cleanup (free, buffer);
+         old_chain = make_cleanup (xfree, buffer);
          bufptr = buffer + bufsize * width;
          bufsize += nfetch;
 
index bd4d1af82c4592ad1077de286e5177c13b7a3e24..f17373dbe14b49f6daf7c715a1c2f52331c2b459 100644 (file)
@@ -331,9 +331,9 @@ clear_value_history (void)
     {
       for (i = 0; i < VALUE_HISTORY_CHUNK; i++)
        if ((val = value_history_chain->values[i]) != NULL)
-         free ((PTR) val);
+         xfree (val);
       next = value_history_chain->next;
-      free ((PTR) value_history_chain);
+      xfree (value_history_chain);
       value_history_chain = next;
     }
   value_history_count = 0;
@@ -475,7 +475,7 @@ set_internalvar (struct internalvar *var, value_ptr val)
      something in the value chain (i.e., before release_value is
      called), because after the error free_all_values will get called before
      long.  */
-  free ((PTR) var->value);
+  xfree (var->value);
   var->value = newval;
   release_value (newval);
   /* End code which must not call error().  */
@@ -499,9 +499,9 @@ clear_internalvars (void)
     {
       var = internalvars;
       internalvars = var->next;
-      free ((PTR) var->name);
-      free ((PTR) var->value);
-      free ((PTR) var);
+      xfree (var->name);
+      xfree (var->value);
+      xfree (var);
     }
 }
 
index 6528bcb89f225cb6ff29c3f7295bc116ba72b30e..4adfd6888508d329c17dd0a7fe29756d2d54c3c6 100644 (file)
@@ -1065,7 +1065,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 */
@@ -1182,7 +1182,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)
@@ -1507,7 +1507,7 @@ vpop (struct vstack **pstack)
   s = *pstack;
   v = s->var;
   *pstack = (*pstack)->next;
-  free (s);
+  xfree (s);
 
   return v;
 }
@@ -1537,7 +1537,7 @@ cppop (struct cpstack **pstack)
   s = *pstack;
   v = s->name;
   *pstack = (*pstack)->next;
-  free (s);
+  xfree (s);
 
   return v;
 }
index ce78a6d1818d124f8376fdd33725655dd637a680..10d6bd8c98d9e800e4d6d3c61db037e1a9f8174c 100644 (file)
@@ -249,7 +249,7 @@ child_init_thread_list (void)
       thread_info *here = th->next;
       th->next = here->next;
       (void) CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -273,7 +273,7 @@ child_delete_thread (DWORD id)
       thread_info *here = th->next;
       th->next = here->next;
       CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -619,7 +619,7 @@ child_clear_solibs (void)
   while ((so = so1) != NULL)
     {
       so1 = so->next;
-      free (so);
+      xfree (so);
     }
 
   solib_start.next = NULL;
@@ -715,7 +715,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
        ourstatus->kind = TARGET_WAITKIND_STOPPED;
     }
 
-  free (s);
+  xfree (s);
   return gotasig;
 }
 
@@ -1610,9 +1610,9 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, PTR obj)
 
 out:
   if (buf)
-    free (buf);
+    xfree (buf);
   if (dll_name)
-    free (dll_name);
+    xfree (dll_name);
   return;
 }
 
index 381cfdabeb0780d70a5799f101a5c275788e5978..7ee0b60f6c020d85398394053af45b36c8658cda 100644 (file)
@@ -1075,7 +1075,7 @@ child_init_thread_list (void)
       thread_info *here = th->next;
       th->next = here->next;
       (void) close_handle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -1099,7 +1099,7 @@ child_delete_thread (DWORD id)
       thread_info *here = th->next;
       th->next = here->next;
       close_handle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
index ce78a6d1818d124f8376fdd33725655dd637a680..10d6bd8c98d9e800e4d6d3c61db037e1a9f8174c 100644 (file)
@@ -249,7 +249,7 @@ child_init_thread_list (void)
       thread_info *here = th->next;
       th->next = here->next;
       (void) CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -273,7 +273,7 @@ child_delete_thread (DWORD id)
       thread_info *here = th->next;
       th->next = here->next;
       CloseHandle (here->h);
-      free (here);
+      xfree (here);
     }
 }
 
@@ -619,7 +619,7 @@ child_clear_solibs (void)
   while ((so = so1) != NULL)
     {
       so1 = so->next;
-      free (so);
+      xfree (so);
     }
 
   solib_start.next = NULL;
@@ -715,7 +715,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
        ourstatus->kind = TARGET_WAITKIND_STOPPED;
     }
 
-  free (s);
+  xfree (s);
   return gotasig;
 }
 
@@ -1610,9 +1610,9 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, PTR obj)
 
 out:
   if (buf)
-    free (buf);
+    xfree (buf);
   if (dll_name)
-    free (dll_name);
+    xfree (dll_name);
   return;
 }
 
index fac9a2fb8e66de41f5376e918190e1203e93dc73..6bcae9ac6ee80f985cc000b74f7728ebdaeddc11 100644 (file)
@@ -443,7 +443,7 @@ arrange_linetable (struct linetable *oldLineTb)
 
   if (function_count == 0)
     {
-      free (fentry);
+      xfree (fentry);
       return oldLineTb;
     }
   else if (function_count > 1)
@@ -473,7 +473,7 @@ arrange_linetable (struct linetable *oldLineTb)
           ++jj, ++newline)
        newLineTb->item[newline] = oldLineTb->item[jj];
     }
-  free (fentry);
+  xfree (fentry);
   newLineTb->nitems = oldLineTb->nitems - function_count;
   return newLineTb;
 }
@@ -675,7 +675,7 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
        }
       else
        {
-         free (lv);
+         xfree (lv);
          current_subfile->line_vector = lineTb;
        }
 
@@ -725,7 +725,7 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
            if (fakename == NULL)
              fakename = " ?";
            start_subfile (fakename, (char *) 0);
-           free (current_subfile->name);
+           xfree (current_subfile->name);
          }
          current_subfile->name = xstrdup (inclTable[ii].name);
 #endif
@@ -740,7 +740,7 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
            }
          else
            {
-             free (lv);
+             xfree (lv);
              current_subfile->line_vector = lineTb;
            }
 
@@ -1898,7 +1898,7 @@ xcoff_symfile_finish (struct objfile *objfile)
   /* Start with a fresh include table for the next objfile.  */
   if (inclTable)
     {
-      free (inclTable);
+      xfree (inclTable);
       inclTable = NULL;
     }
   inclIndx = inclLength = inclDepth = 0;
This page took 0.120425 seconds and 4 git commands to generate.