[RFA] Changes from free() to xfree()

John R. Moore jmoore@dhcp-81.wirespeed.com
Fri Jan 26 09:40:00 GMT 2001


Here goes the xfree() fix, one more time. The fixes were tested on
RedHat Linux 7.0 upgraded to kernel 2.4.0 on an Intel Pentium III.

ChangeLog and patches follow:

2001-01-25  John R. Moore  <jmoore@redhat.com>

	* cli/cli-cmds.c (apropos_command): Changed free() to xfree() where 
	appropriate.  Also changed Copyright to include 2001.
	* remote-utils.h (sr_set_device): Likewise.
	* symtab.h (obstack_chunk_free, SYMBOL_INIT_DEMANGLED_NAME): Likewise.
	* value.h  (value_free): Likewise.
	* gdbarch.sh (gdbarch_free): Likewise.
	* gdbarch.c, gdbarch.h: Regenerated.

Index: gdb/cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.2
diff -p -u -w -r1.2 cli-cmds.c
--- gdb/cli/cli-cmds.c	2000/12/15 01:01:51	1.2
+++ gdb/cli/cli-cmds.c	2001/01/26 15:47:18
@@ -1,5 +1,5 @@
 /* GDB CLI commands.
-   Copyright 2000 Free Software Foundation, Inc.
+   Copyright 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -557,7 +557,7 @@ apropos_command (char *searchstr, int fr
       regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
       error("Error in regular expression:%s",errorbuffer);
     }
-  free(pattern_fastmap);
+  xfree (pattern_fastmap);
 }
 
 static void

Index: gdb/gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.51
diff -p -u -w -r1.51 gdbarch.c
--- gdb/gdbarch.c	2001/01/22 23:32:49	1.51
+++ gdb/gdbarch.c	2001/01/26 15:48:02
@@ -1,7 +1,7 @@
 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
 
 /* Dynamic architecture support for GDB, the GNU debugger.
-   Copyright 1998-1999, Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -467,7 +467,7 @@ void
 gdbarch_free (struct gdbarch *arch)
 {
   /* At the moment, this is trivial.  */
-  free (arch);
+  xfree (arch);
 }
 
 
Index: gdb/gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.40
diff -p -u -w -r1.40 gdbarch.h
--- gdb/gdbarch.h	2001/01/22 23:32:49	1.40
+++ gdb/gdbarch.h	2001/01/26 15:48:16
@@ -1,7 +1,7 @@
 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
 
 /* Dynamic architecture support for GDB, the GNU debugger.
-   Copyright 1998-1999, Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
Index: gdb/gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.51
diff -p -u -w -r1.51 gdbarch.sh
--- gdb/gdbarch.sh	2001/01/22 23:32:49	1.51
+++ gdb/gdbarch.sh	2001/01/26 15:47:25
@@ -1,7 +1,7 @@
 #!/bin/sh -u
 
 # Architecture commands for GDB, the GNU debugger.
-# Copyright 1998-2000 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
 #
 # This file is part of GDB.
 #
@@ -531,7 +531,7 @@ cat <<EOF
 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
 
 /* Dynamic architecture support for GDB, the GNU debugger.
-   Copyright 1998-1999, Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1239,7 +1239,7 @@ void
 gdbarch_free (struct gdbarch *arch)
 {
   /* At the moment, this is trivial.  */
-  free (arch);
+  xfree (arch);
 }
 EOF
 
Index: gdb/remote-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/remote-utils.h,v
retrieving revision 1.5
diff -p -u -w -r1.5 remote-utils.h
--- gdb/remote-utils.h	2000/11/03 22:00:56	1.5
+++ gdb/remote-utils.h	2001/01/26 15:48:19
@@ -1,6 +1,6 @@
 /* Generic support for remote debugging interfaces.
 
-   Copyright 1993 Free Software Foundation, Inc.
+   Copyright 1993, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -53,7 +53,7 @@ extern struct _sr_settings sr_settings;
 #define sr_get_device()			(sr_settings.device)
 #define sr_set_device(newval) \
 { \
-    if (sr_settings.device) free(sr_settings.device); \
+    if (sr_settings.device) xfree (sr_settings.device); \
     sr_settings.device = (newval); \
 }
 
Index: gdb/symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.16
diff -p -u -w -r1.16 symtab.h
--- gdb/symtab.h	2000/11/10 23:02:56	1.16
+++ gdb/symtab.h	2001/01/26 15:48:25
@@ -1,5 +1,5 @@
 /* Symbol table definitions for GDB.
-   Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
+   Copyright 1986, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -26,7 +26,7 @@
 
 #include "obstack.h"
 #define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
+#define obstack_chunk_free xfree
 #include "bcache.h"
 
 /* Don't do this; it means that if some .o's are compiled with GNU C
@@ -182,7 +182,7 @@ extern CORE_ADDR symbol_overlayed_addres
 	    SYMBOL_LANGUAGE (symbol) = language_cplus;			\
 	    SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = 			\
 	      obsavestring (demangled, strlen (demangled), (obstack));	\
-	    free (demangled);						\
+	    xfree (demangled);						\
 	  }								\
 	else								\
 	  {								\
@@ -199,7 +199,7 @@ extern CORE_ADDR symbol_overlayed_addres
 	    SYMBOL_LANGUAGE (symbol) = language_java;			\
 	    SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = 			\
 	      obsavestring (demangled, strlen (demangled), (obstack));	\
-	    free (demangled);						\
+	    xfree (demangled);						\
 	  }								\
 	else								\
 	  {								\
@@ -217,7 +217,7 @@ extern CORE_ADDR symbol_overlayed_addres
 	    SYMBOL_LANGUAGE (symbol) = language_chill;			\
 	    SYMBOL_CHILL_DEMANGLED_NAME (symbol) = 			\
 	      obsavestring (demangled, strlen (demangled), (obstack));	\
-	    free (demangled);						\
+	    xfree (demangled);						\
 	  }								\
 	else								\
 	  {								\
Index: gdb/value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.13
diff -p -u -w -r1.13 value.h
--- gdb/value.h	2001/01/09 00:12:48	1.13
+++ gdb/value.h	2001/01/26 15:48:35
@@ -1,5 +1,6 @@
 /* Definitions for values of C expressions, for GDB.
-   Copyright 1986, 1987, 1989, 1992-1996, 2000 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -456,7 +457,7 @@ extern int unop_user_defined_p (enum exp
 
 extern int destructor_name_p (const char *name, const struct type *type);
 
-#define value_free(val) free ((PTR)val)
+#define value_free(val) xfree (val)
 
 extern void free_all_values (void);
 


More information about the Gdb-patches mailing list