This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] xfree() replacements for free() in gdb


Kevin,
Thanks for your comments, I'll fix and re-submit. I was editing the
diff files for the 2001 copyright following suggestions of Elena,
which explains why the diffs were different (than expected if
they had been autogenerated). Taking out the (PTR) will require
re-compiling and retesting, which I'll do tonight. The two spaces
after a period was new to me (It used to be that way before
word processors), so I'll make sure I follow that here.

Cheers,

John

On Thu, 25 Jan 2001, Kevin Buettner wrote:

> On Jan 25,  4:47pm, John R. Moore wrote:
>
> > 2001-01-25  John R. Moore  <jmoore@cygnus.com>
> >
> >         * cli/cli-cmds.c (apropos_command): Changed free() to xfree() where
>   ^^^^^^^^
> Use a tab here.
>
> > 	appropriate. Also changed Copyright to include 2001.
>                     ^
> Also, you need two spaces between the period and the start of the next
> sentence.
>
> > 	* gdbarch.sh (gdbarch_free): Likewise.
> > 	* remote-utils.h (sr_set_device): Likewise.
> > 	* symtab.h (obstack_chunk_free, SYMBOL_INIT_DEMANGLED_NAME): Likewise.
> > 	* value.h (value_free): Likewise.
> > 	* gdbarch.c: Regenerated.
> > 	* gdbarch.h: Regenerated.
>
> A minor point, but I would've grouped the changes for gdbarch.sh,
> gdbarch.c, and gdbarch.h together as follows:
>
> 	...
> 	* value.h (value_free): Likewise.
> 	* gdbarch.sh (gdbarch_free): Likewise.
> 	* gdbarch.c, gdbarch.h: Regenerated.
>
> [...]
>
> I'm puzzled about how you managed to regenerate gdbarch.h out of
> gdbarch.sh.  (Look at the copyright notices.  It looks like you got
> it right in gdbarch.sh, but it doesn't appear to me that the gdbarch.h
> copyright notice matches your fixes in gdbarch.sh...
>
> > Index: gdbarch.h
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/gdbarch.h,v
> > retrieving revision 1.40
> > diff -p -u -w -r1.40 gdbarch.h
> > --- gdbarch.h	2001/01/22 23:32:49	1.40
> > +++ gdbarch.h	2001/01/25 22:11:58
> > @@ -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-2001, Free Software Foundation, Inc.
> >
> >     This file is part of GDB.
> >
> > Index: gdbarch.sh
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/gdbarch.sh,v
> > retrieving revision 1.51
> > diff -p -u -w -r1.51 gdbarch.sh
> > --- gdbarch.sh	2001/01/22 23:32:49	1.51
> > +++ gdbarch.sh	2001/01/25 22:11: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, 2000, 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, 2000, 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: value.h
> [...]
> > -#define value_free(val) free ((PTR)val)
> > +#define value_free(val) xfree ((PTR)val)
>
> I think I commented on this one before...  I am against the (PTR)
> coercion being here.  Since xfree() takes a void *, it should not
> be necessary to coerce pointer values being passed to it.  OTOH,
> if xfree is (inadvertently or otherwise) used on an int or a long,
> the above define will mask a real problem that ought to be fixed
> in some other fashion.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]