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]

[RFA] Deprecation fixes


This patch fixes a crash if you call "maintenance deprecate" with no
arguments.
I also added the prototype to make the warnings about it being
implicitly declared go away, and removed the unknown escape sequences
caused by spaces where they shouldn't be.

Fernando, can i check it in?
--Dan
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 maint.c
*** maint.c	2000/03/23 23:43:19	1.2
--- maint.c	2000/03/25 02:14:03
*************** static void maintenance_info_sections PA
*** 57,62 ****
--- 57,64 ----
  
  static void maintenance_print_command PARAMS ((char *, int));
  
+ static void maintenance_do_deprecate(char *text, int deprecate);
+ 
  /* Set this to the maximum number of seconds to wait instead of waiting forever
     in target_wait().  If this timer times out, then it generates an error and
     the command is aborted.  This replaces most of the need for timeouts in the
*************** the command you want to undeprecate.\n")
*** 399,405 ****
      replacement.
  */
  
! static void maintenance_do_deprecate(char *text, int deprecate){
  
    struct cmd_list_element *alias=NULL; 
    struct cmd_list_element *prefix_cmd=NULL; 
--- 401,408 ----
      replacement.
  */
  
! static 
! void maintenance_do_deprecate(char *text, int deprecate){
  
    struct cmd_list_element *alias=NULL; 
    struct cmd_list_element *prefix_cmd=NULL; 
*************** static void maintenance_do_deprecate(cha
*** 409,415 ****
    char *end_ptr=NULL;
    int len;
    char *replacement=NULL;
! 
  
    if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd)){
      printf_filtered ("Can't find command '%s' to deprecate.\n", text);
--- 412,419 ----
    char *end_ptr=NULL;
    int len;
    char *replacement=NULL;
!   if (text==NULL)
! 	  return;
  
    if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd)){
      printf_filtered ("Can't find command '%s' to deprecate.\n", text);
*************** If a SOURCE file is specified, dump only
*** 573,579 ****
           "Deprecate a command.  Note that this is just in here so the \n\
  testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\
  rather you should use the C function deprecate_cmd().  If you decide you \n\
! want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\ 
  replacement is optional.", &maintenancelist);
  
    add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate,
--- 577,583 ----
           "Deprecate a command.  Note that this is just in here so the \n\
  testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\
  rather you should use the C function deprecate_cmd().  If you decide you \n\
! want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\
  replacement is optional.", &maintenancelist);
  
    add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate,
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.173
diff -c -3 -p -r1.173 ChangeLog
*** ChangeLog	2000/03/24 11:12:11	1.173
--- ChangeLog	2000/03/25 02:14:05
***************
*** 1,3 ****
--- 1,8 ----
+ Fri Mar 24 13:00:10 2000  Daniel Berlin <dan@cgsoftware.com>
+ 
+ 	* maint.c (maintenance_do_deprecate): Fix crash if you call with no arguments, and fixed the warning.
+ 		  Added prototype for the deprecate command so it doesn't complain.
+ 
  Thu Mar 23 13:18:26 2000  Philippe De Muyter  <phdm@macqel.be>
  
  	* m68k-tdep.c (P_LINKL_FP, P_LINKW_FP): Macros renamed from P_LINK_L

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