This is the mail archive of the gdb-patches@sourceware.cygnus.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]

[PATCH] Re-indent (almost) top.c


FYI,

I've committed the attatched re-indent of top.c. Putting the resultant
top.c through indent gives:

$  indent < top.c | indent | diff -c - top.c
*** -   Mon Apr  3 15:22:55 2000
--- top.c       Mon Apr  3 15:15:49 2000
***************
*** 666,676 ****
  }
  
  struct captured_command_args
! {
!   catch_command_errors_ftype *command;
!   char *arg;
!   int from_tty;
! };
  
  static int
  do_captured_command (void *data)
--- 666,676 ----
  }
  
  struct captured_command_args
!   {
!     catch_command_errors_ftype *command;
!     char *arg;
!     int from_tty;
!   };
  
  static int
  do_captured_command (void *data)
***************
*** 3652,3658 ****
  #if defined(_WIN32) || defined(__MSDOS__)
          && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3)   /* "d:/"
*/
  #endif
!       )
        len--;
      }
  
--- 3652,3658 ----
  #if defined(_WIN32) || defined(__MSDOS__)
          && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3)   /* "d:/"
*/
  #endif
!         )
        len--;
      }
  
which is pretty close.

	Andrew
Mon Apr  3 14:56:11 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* top.c: Re-indent.
	(set_hook, error_hook): Remove PARAMS.

Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.7
diff -p -r1.7 top.c
*** top.c	2000/03/28 02:25:14	1.7
--- top.c	2000/04/03 05:19:15
*************** void (*call_command_hook) PARAMS ((struc
*** 477,483 ****
  /* Called after a `set' command has finished.  Is only run if the
     `set' command succeeded.  */
  
! void (*set_hook) PARAMS ((struct cmd_list_element *c));
  
  /* Called when the current thread changes.  Argument is thread id.  */
  
--- 477,483 ----
  /* Called after a `set' command has finished.  Is only run if the
     `set' command succeeded.  */
  
! void (*set_hook) (struct cmd_list_element * c);
  
  /* Called when the current thread changes.  Argument is thread id.  */
  
*************** void (*context_hook) PARAMS ((int id));
*** 486,493 ****
  /* Takes control from error ().  Typically used to prevent longjmps out of the
     middle of the GUI.  Usually used in conjunction with a catch routine.  */
  
! NORETURN void (*error_hook)
! PARAMS ((void)) ATTR_NORETURN;
  
  
  /* One should use catch_errors rather than manipulating these
--- 486,492 ----
  /* Takes control from error ().  Typically used to prevent longjmps out of the
     middle of the GUI.  Usually used in conjunction with a catch routine.  */
  
! NORETURN void (*error_hook) (void) ATTR_NORETURN;
  
  
  /* One should use catch_errors rather than manipulating these
*************** return_to_top_level (reason)
*** 540,546 ****
       to that call via setjmp's return value.  Note that REASON can't
       be zero, by definition in defs.h. */
  
!   (NORETURN void) SIGLONGJMP (*catch_return, (int)reason);
  }
  
  /* Call FUNC with arg ARGS, catching any errors.  If there is no
--- 539,545 ----
       to that call via setjmp's return value.  Note that REASON can't
       be zero, by definition in defs.h. */
  
!   (NORETURN void) SIGLONGJMP (*catch_return, (int) reason);
  }
  
  /* Call FUNC with arg ARGS, catching any errors.  If there is no
*************** do_captured_command (void *data)
*** 690,696 ****
  }
  
  int
! catch_command_errors (catch_command_errors_ftype *command,
  		      char *arg, int from_tty, return_mask mask)
  {
    struct captured_command_args args;
--- 689,695 ----
  }
  
  int
! catch_command_errors (catch_command_errors_ftype * command,
  		      char *arg, int from_tty, return_mask mask)
  {
    struct captured_command_args args;
*************** execute_command (p, from_tty)
*** 1504,1510 ****
      {
        char *arg;
        line = p;
!       
        c = lookup_cmd (&p, cmdlist, "", 0, 1);
  
        /* If the target is running, we allow only a limited set of
--- 1503,1509 ----
      {
        char *arg;
        line = p;
! 
        c = lookup_cmd (&p, cmdlist, "", 0, 1);
  
        /* If the target is running, we allow only a limited set of
*************** execute_command (p, from_tty)
*** 1527,1539 ****
  	    p--;
  	  *(p + 1) = '\0';
  	}
!       
        /* If this command has been hooked, run the hook first. */
        if (c->hook)
  	execute_user_command (c->hook, (char *) 0);
  
        if (c->flags & DEPRECATED_WARN_USER)
!       deprecated_cmd_warning (&line);
  
        if (c->class == class_user)
  	execute_user_command (c, arg);
--- 1526,1538 ----
  	    p--;
  	  *(p + 1) = '\0';
  	}
! 
        /* If this command has been hooked, run the hook first. */
        if (c->hook)
  	execute_user_command (c->hook, (char *) 0);
  
        if (c->flags & DEPRECATED_WARN_USER)
! 	deprecated_cmd_warning (&line);
  
        if (c->class == class_user)
  	execute_user_command (c, arg);
*************** cd_command (dir, from_tty)
*** 3645,3657 ****
  #endif
  
    len = strlen (dir);
!   if (SLASH_P (dir[len-1]))
      {
        /* Remove the trailing slash unless this is a root directory
! 	 (including a drive letter on non-Unix systems).  */
!       if (!(len == 1) /* "/" */
  #if defined(_WIN32) || defined(__MSDOS__)
! 	  && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */
  #endif
  	  )
  	len--;
--- 3644,3656 ----
  #endif
  
    len = strlen (dir);
!   if (SLASH_P (dir[len - 1]))
      {
        /* Remove the trailing slash unless this is a root directory
!          (including a drive letter on non-Unix systems).  */
!       if (!(len == 1)		/* "/" */
  #if defined(_WIN32) || defined(__MSDOS__)
! 	  && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3)	/* "d:/" */
  #endif
  	  )
  	len--;
*************** float_handler (signo)
*** 3997,4016 ****
  
  static void
  set_debug (arg, from_tty)
! 	char *arg;
! 	int from_tty;
  {
! 	printf_unfiltered (
! 			"\"set debug\" must be followed by the name of a print subcommand.\n");
! 	help_list (setdebuglist, "set debug ", -1, gdb_stdout);
  }
  
  static void
  show_debug (args, from_tty)
! 	char *args;
! 	int from_tty;
  {
! 	          cmd_show_list (showdebuglist, from_tty, "");
  }
  
  static void
--- 3996,4014 ----
  
  static void
  set_debug (arg, from_tty)
!      char *arg;
!      int from_tty;
  {
!   printf_unfiltered ("\"set debug\" must be followed by the name of a print subcommand.\n");
!   help_list (setdebuglist, "set debug ", -1, gdb_stdout);
  }
  
  static void
  show_debug (args, from_tty)
!      char *args;
!      int from_tty;
  {
!   cmd_show_list (showdebuglist, from_tty, "");
  }
  
  static void
*************** init_history ()
*** 4067,4074 ****
           directories the file written will be the same as the one
           that was read.  */
  #ifdef __MSDOS__
!     /* No leading dots in file names are allowed on MSDOS.  */
!     history_filename = concat (current_directory, "/_gdb_history", NULL);
  #else
        history_filename = concat (current_directory, "/.gdb_history", NULL);
  #endif
--- 4065,4072 ----
           directories the file written will be the same as the one
           that was read.  */
  #ifdef __MSDOS__
!       /* No leading dots in file names are allowed on MSDOS.  */
!       history_filename = concat (current_directory, "/_gdb_history", NULL);
  #else
        history_filename = concat (current_directory, "/.gdb_history", NULL);
  #endif
*************** This value is used to set the speed of t
*** 4338,4355 ****
  using remote targets.", &setlist),
  		     &showlist);
  
!   c = add_set_cmd("remotedebug", no_class, var_zinteger, (char *) &remote_debug, "Set debugging of remote protocol.\n\
  When enabled, each packet sent or received with the remote target\n\
! is displayed.",&setlist);
!   deprecate_cmd(c,"set debug remote");
!   deprecate_cmd(add_show_from_set(c,&showlist),"show debug remote");
! 
!   add_show_from_set (
!   add_set_cmd ("remote", no_class, var_zinteger, (char *) &remote_debug,
! 	       "Set debugging of remote protocol.\n\
  When enabled, each packet sent or received with the remote target\n\
  is displayed.", &setdebuglist),
! 		      &showdebuglist);
  
    add_show_from_set (
  		      add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
--- 4336,4355 ----
  using remote targets.", &setlist),
  		     &showlist);
  
!   c = add_set_cmd ("remotedebug", no_class, var_zinteger,
! 		   (char *) &remote_debug,
! 		   "Set debugging of remote protocol.\n\
  When enabled, each packet sent or received with the remote target\n\
! is displayed.", &setlist);
!   deprecate_cmd (c, "set debug remote");
!   deprecate_cmd (add_show_from_set (c, &showlist), "show debug remote");
! 
!   add_show_from_set (add_set_cmd ("remote", no_class, var_zinteger,
! 				  (char *) &remote_debug,
! 				  "Set debugging of remote protocol.\n\
  When enabled, each packet sent or received with the remote target\n\
  is displayed.", &setdebuglist),
! 		     &showdebuglist);
  
    add_show_from_set (
  		      add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
*************** from the target.", &setlist),
*** 4389,4395 ****
  Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist),
  	 &showlist);
      }
! 	add_prefix_cmd("debug",no_class,set_debug, "Generic command for setting gdb debugging flags", &setdebuglist, "set debug ", 0, &setlist);
! 
! 	add_prefix_cmd("debug",no_class,show_debug,"Generic command for showing gdb debugging flags", &showdebuglist, "show debug ", 0, &showlist);
  }
--- 4389,4399 ----
  Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist),
  	 &showlist);
      }
!   add_prefix_cmd ("debug", no_class, set_debug,
! 		  "Generic command for setting gdb debugging flags",
! 		  &setdebuglist, "set debug ", 0, &setlist);
! 
!   add_prefix_cmd ("debug", no_class, show_debug,
! 		  "Generic command for showing gdb debugging flags",
! 		  &showdebuglist, "show debug ", 0, &showlist);
  }

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