Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Don Howard <dhoward@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [Patch]: grep ^func
Date: Thu, 25 Jan 2001 15:52:00 -0000	[thread overview]
Message-ID: <3A70BC48.60B1A42C@cygnus.com> (raw)
In-Reply-To: <Pine.SOL.3.91.1010125143122.14868G-100000@taarna.cygnus.com>

Don Howard wrote:
> 
> Here is a simple patch that cleans up function declarations/definitions
> so that grep ^func will turn up only the function definition.   Tested
> on native Linux x86.

Don, in the cases where this change results in lines of 79 chars or more, 
would you mind breaking the lines up?  Emacs default indentation, eg.

extern int foo (int, char, 
                char, int);

Thanks,
Michael
From dhoward@cygnus.com Thu Jan 25 15:56:00 2001
From: Don Howard <dhoward@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [Patch]: grep ^func
Date: Thu, 25 Jan 2001 15:56:00 -0000
Message-id: <Pine.SOL.3.91.1010125155450.15338A-100000@taarna.cygnus.com>
References: <3A70BC48.60B1A42C@cygnus.com>
X-SW-Source: 2001-01/msg00290.html
Content-length: 539

Sure thing. Next time.

--
-Don
dhoward@cygnus.com


On Thu, 25 Jan 2001, Michael Snyder wrote:

> Don Howard wrote:
> > 
> > Here is a simple patch that cleans up function declarations/definitions
> > so that grep ^func will turn up only the function definition.   Tested
> > on native Linux x86.
> 
> Don, in the cases where this change results in lines of 79 chars or more, 
> would you mind breaking the lines up?  Emacs default indentation, eg.
> 
> extern int foo (int, char, 
>                 char, int);
> 
> Thanks,
> Michael
> 
From fnasser@redhat.com Thu Jan 25 16:08:00 2001
From: Fernando Nasser <fnasser@redhat.com>
To: "John R. Moore" <jmoore@dhcp-81.wirespeed.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] xfree() replacements for free() in gdb
Date: Thu, 25 Jan 2001 16:08:00 -0000
Message-id: <3A70BF7C.FDC22682@redhat.com>
References: <200101260047.f0Q0ljE31390@dhcp-81.wirespeed.com>
X-SW-Source: 2001-01/msg00291.html
Content-length: 8360

The cli part is approved.


"John R. Moore" wrote:
> 
> Resubmitting the xfree fixes for RFA
> 
> 2001-01-25  John R. Moore  <jmoore@cygnus.com>
> 
>         * cli/cli-cmds.c (apropos_command): Changed free() to xfree() where
>         appropriate. Also changed Copyright to include 2001.
>         * 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.
> 
> Index: 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
> --- cli/cli-cmds.c      2000/12/15 01:01:51     1.2
> +++ cli/cli-cmds.c      2001/01/25 22:11:12
> @@ -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: gdbarch.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbarch.c,v
> retrieving revision 1.51
> diff -p -u -w -r1.51 gdbarch.c
> --- gdbarch.c   2001/01/22 23:32:49     1.51
> +++ gdbarch.c   2001/01/25 22:11:44
> @@ -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: 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: 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
> --- remote-utils.h      2000/11/03 22:00:56     1.5
> +++ remote-utils.h      2001/01/25 22:12:09
> @@ -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: symtab.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/symtab.h,v
> retrieving revision 1.16
> diff -p -u -w -r1.16 symtab.h
> --- symtab.h    2000/11/10 23:02:56     1.16
> +++ symtab.h    2001/01/25 22:13:10
> @@ -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: value.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/value.h,v
> retrieving revision 1.13
> diff -p -u -w -r1.13 value.h
> --- value.h     2001/01/09 00:12:48     1.13
> +++ value.h     2001/01/25 22:13:21
> @@ -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 ((PTR)val)
> 
>  extern void free_all_values (void);
> 

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9
From kevinb@cygnus.com Thu Jan 25 16:28:00 2001
From: Kevin Buettner <kevinb@cygnus.com>
To: Don Howard <dhoward@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [Patch]: grep ^func
Date: Thu, 25 Jan 2001 16:28:00 -0000
Message-id: <1010126002825.ZM4371@ocotillo.lan>
References: <Pine.SOL.3.91.1010125143122.14868G-100000@taarna.cygnus.com> <dhoward@cygnus.com>
X-SW-Source: 2001-01/msg00292.html
Content-length: 4359

On Jan 25,  2:33pm, Don Howard wrote:

> 2001-01-25  Don Howard  <dhoward@redhat.com>
> 
> 	* ch-lang.h: Whitespace fixes so that function names appear at the
> 		     very start of a line. This is so that ``grep ^func'' works.

You need to move the line beginning with "very" so that the 'v' lines
up under the "*".

> 	* config/alpha/tm-alpha.h: ""

Instead of "", the convention is to use ``Likewise.'' or ``Ditto.''  E.g,

	* config/alpha/tm-alpha.h: Likewise.

> Index: ch-lang.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/ch-lang.h,v
> retrieving revision 1.2
> diff -p -u -w -r1.2 ch-lang.h
> --- ch-lang.h	2000/05/28 01:12:26	1.2
> +++ ch-lang.h	2001/01/25 20:55:18
> @@ -1,5 +1,5 @@
>  /* Chill language support definitions for GDB, the GNU debugger.
> -   Copyright 1992, 2000 Free Software Foundation, Inc.
> +   Copyright 1992, 2000, 2001 Free Software Foundation, Inc.
>  
>     This file is part of GDB.
>  
> @@ -36,5 +36,4 @@ extern int chill_val_print (struct type 
>  extern int chill_value_print (struct value *, struct ui_file *,
>  			      int, enum val_prettyprint);
>  
> -extern LONGEST
> -type_lower_upper (enum exp_opcode, struct type *, struct type **);
> +extern LONGEST type_lower_upper (enum exp_opcode, struct type *, struct type **);

I think it'd also be nice to reindent these declarations so that
individual lines do not exceed 80 characters.  For something like
this, I usually run GNU indent on the line in question (and no more). 
So, the above changes from...

extern LONGEST type_lower_upper (enum exp_opcode, struct type *, struct type **);

to...

extern LONGEST type_lower_upper (enum exp_opcode, struct type *,
				 struct type **);

Oddly enough, you have to put ``extern LONGEST'' on the same line as
``type_lower_upper'' for indent to do anything.

There are a number of other declarations that you've reformatted
which need the same treatment.  I'll leave it to you to find the
rest of them.

> Index: go32-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/go32-nat.c,v
> retrieving revision 1.6
> diff -p -u -w -r1.6 go32-nat.c
> --- go32-nat.c	2000/08/06 07:19:38	1.6
> +++ go32-nat.c	2001/01/25 20:55:29
> @@ -1,6 +1,6 @@
>  /* Native debugging support for Intel x86 running DJGPP.
> -   Copyright 1997, 1999 Free Software Foundation, Inc.
> -   Written by Robert Hoehne.
> +   Copyright 1997, 1999, 2001 Free Software Foundation, Inc.  Written
> +   by Robert Hoehne.
>  
>     This file is part of GDB.
>  
> @@ -118,20 +118,31 @@ typedef struct {
>    int redirected;
>  } cmdline_t;
>  
> -void redir_cmdline_delete (cmdline_t *ptr) {ptr->redirected = 0;}
> -int  redir_cmdline_parse (const char *args, cmdline_t *ptr)
> +void 
> +redir_cmdline_delete (cmdline_t *ptr) 
>  {
> +  ptr->redirected = 0; 
> +}
> +int  
> +redir_cmdline_parse (const char *args, cmdline_t *ptr) 
> +{ 
>    return -1;
>  }
> -int redir_to_child (cmdline_t *ptr)
> +int 
> +redir_to_child (cmdline_t *ptr) 
>  {
>    return 1;
>  }
> -int redir_to_debugger (cmdline_t *ptr)
> +int 
> +redir_to_debugger (cmdline_t *ptr) 
>  {
>    return 1;
> +}
> +int 
> +redir_debug_init (cmdline_t *ptr) 
> +{ 
> +  return 0; 
>  }
> -int redir_debug_init (cmdline_t *ptr) { return 0; }
>  #endif /* __DJGPP_MINOR < 3 */
>  
>  extern void _initialize_go32_nat (void);

For the above, I think it'd be nice to put a blank line between functions.

> Index: somsolib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/somsolib.h,v
> retrieving revision 1.2
> diff -p -u -w -r1.2 somsolib.h
> --- somsolib.h	2000/05/28 01:12:29	1.2
> +++ somsolib.h	2001/01/25 20:55:53
> @@ -1,5 +1,5 @@
>  /* HP SOM Shared library declarations for GDB, the GNU Debugger.
> -   Copyright (C) 1992 Free Software Foundation, Inc.
> +   Copyright (C) 1992, 2001 Free Software Foundation, Inc.

I think you should nuke the (C) while you're at it.

> Index: stabsread.c
[...]
> -static void
> -read_one_struct_field (struct field_info *, char **, char *,
> +static void read_one_struct_field (struct field_info *, char **, char *,
>  		       struct type *, struct objfile *);

Another note on reindenting... declarations like the above (which already
spanned multiple lines) should be reindented too.


      reply	other threads:[~2001-01-25 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-25 14:33 Don Howard
2001-01-25 15:52 ` Michael Snyder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A70BC48.60B1A42C@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=dhoward@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox