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]: New set debug patch


This patch deprecates the old commands, adds the new commands, and
adds documentation for the set/show debug command.
Of course, the documentation needs work, but I think it's in the right
place, and none of the stuff was documented before, so it's better
than it was before.
--Dan
Index: gdb-events.c
===================================================================
RCS file: /cvs/src/src/gdb/gdb-events.c,v
retrieving revision 1.1.1.2
diff -c -3 -p -r1.1.1.2 gdb-events.c
*** gdb-events.c	1999/12/22 21:45:05	1.1.1.2
--- gdb-events.c	2000/03/27 16:21:21
*************** void _initialize_gdb_events (void);
*** 214,229 ****
  void
  _initialize_gdb_events (void)
  {
  #if WITH_GDB_EVENTS
    queue_event_hooks.breakpoint_create = queue_breakpoint_create;
    queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
    queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
! #endif
!   add_show_from_set (add_set_cmd ("eventdebug",
                                    class_maintenance,
                                    var_zinteger,
                                    (char *)&gdb_events_debug,
                                    "Set event debugging.\n\
! When non-zero, event/notify debugging is enabled.", &setlist),
!                      &showlist);
  }
--- 214,237 ----
  void
  _initialize_gdb_events (void)
  {
+   struct cmd_list_element *c;
  #if WITH_GDB_EVENTS
    queue_event_hooks.breakpoint_create = queue_breakpoint_create;
    queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
    queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
! #endif	/* WITH_GDB_EVENTS */
! 
!   c=add_set_cmd("eventdebug", class_maintenance, var_zinteger,
! 		(char *)&gdb_events_debug, "Set event debugging.\n\
! When non-zero, event/notify debugging is enabled.", &setlist);
!   deprecate_cmd(c,"set debug event");
!   deprecate_cmd(add_show_from_set(c,&showlist),"show debug event");
! 
!   add_show_from_set (add_set_cmd ("event",
                                    class_maintenance,
                                    var_zinteger,
                                    (char *)&gdb_events_debug,
                                    "Set event debugging.\n\
! When non-zero, event/notify debugging is enabled.", &setdebuglist),
!                      &showdebuglist);
  }
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 gdbarch.c
*** gdbarch.c	2000/03/21 20:40:43	1.4
--- gdbarch.c	2000/03/27 16:21:22
*************** extern void _initialize_gdbarch (void);
*** 3262,3267 ****
--- 3262,3269 ----
  void
  _initialize_gdbarch ()
  {
+   struct cmd_list_element *c;
+ 
    add_prefix_cmd ("endian", class_support, set_endian,
  		  "Set endianness of target.",
  		  &endianlist, "set endian ", 0, &setlist);
*************** _initialize_gdbarch ()
*** 3288,3298 ****
    tm_print_insn_info.memory_error_func = dis_asm_memory_error;
    tm_print_insn_info.print_address_func = dis_asm_print_address;
  
!   add_show_from_set (add_set_cmd ("archdebug",
  				  class_maintenance,
  				  var_zinteger,
  				  (char *)&gdbarch_debug,
  				  "Set architecture debugging.\n\
! When non-zero, architecture debugging is enabled.", &setlist),
! 		     &showlist);
  }
--- 3290,3310 ----
    tm_print_insn_info.memory_error_func = dis_asm_memory_error;
    tm_print_insn_info.print_address_func = dis_asm_print_address;
  
!   add_show_from_set (add_set_cmd ("arch",
  				  class_maintenance,
  				  var_zinteger,
  				  (char *)&gdbarch_debug,
  				  "Set architecture debugging.\n\
! When non-zero, architecture debugging is enabled.", &setdebuglist),
! 		     &showdebuglist);
!   c=add_set_cmd("archdebug",
! 		class_maintenance,
! 		var_zinteger,
! 		(char *)&gdbarch_debug,
! 		"Set architecture debugging.\n\
! When non-zero, architecture debugging is enabled.", &setlist);
! 
!   deprecate_cmd(c,"set debug arch");
!   deprecate_cmd(add_show_from_set(c,&showlist),"show debug arch");
! 
  }
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 gdbtypes.c
*** gdbtypes.c	2000/03/24 01:51:13	1.5
--- gdbtypes.c	2000/03/27 16:21:22
*************** struct type *builtin_type_CORE_ADDR;
*** 75,82 ****
  struct type *builtin_type_bfd_vma;
  
  int opaque_type_resolution = 1;
  
- 
  struct extra
    {
      char str[128];
--- 75,82 ----
  struct type *builtin_type_bfd_vma;
  
  int opaque_type_resolution = 1;
+ int overload_debug = 0;
  
  struct extra
    {
      char str[128];
*************** rank_one_type (parm, arg)
*** 2186,2201 ****
    if (TYPE_CODE (parm) == TYPE_CODE_REF)
      return (rank_one_type (arg, TYPE_TARGET_TYPE (parm))
  	    + REFERENCE_CONVERSION_BADNESS);
! 
! #ifdef DEBUG_OLOAD
    /* Debugging only. */
!   /* FIXME/FYI: cagney/2000-03-13: No need to #ifdef this sort of
!      thing.  Instead add a command like ``set debug gdbtypes <int>''.
!      (A predicate to this is the addition of the ``set debug''). Also,
!      send the output to gdb_stderr and don't use printf. */
!   printf ("------ Arg is %s [%d], parm is %s [%d]\n",
!       TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
! #endif
  
    /* x -> y means arg of type x being supplied for parameter of type y */
  
--- 2186,2195 ----
    if (TYPE_CODE (parm) == TYPE_CODE_REF)
      return (rank_one_type (arg, TYPE_TARGET_TYPE (parm))
  	    + REFERENCE_CONVERSION_BADNESS);
!   if (overload_debug)
    /* Debugging only. */
!     fprintf_filtered (gdb_stderr,"------ Arg is %s [%d], parm is %s [%d]\n",
!         TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
  
    /* x -> y means arg of type x being supplied for parameter of type y */
  
*************** extern void _initialize_gdbtypes PARAMS 
*** 3020,3025 ****
--- 3014,3020 ----
  void
  _initialize_gdbtypes ()
  {
+   struct cmd_list_element *c;
    build_gdbtypes ();
  
    /* FIXME - For the moment, handle types by swapping them in and out.
*************** _initialize_gdbtypes ()
*** 3060,3063 ****
--- 3055,3065 ----
    REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);
    REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma);
    register_gdbarch_swap (NULL, 0, build_gdbtypes);
+ 
+   add_show_from_set (
+ 		     add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug,
+ 				  "Set debugging of C++ overloading.\n\
+ 			  When enabled, ranking of the functions\n\
+ 			  is displayed.", &setdebuglist),
+ 		     &showdebuglist);
  }
Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 monitor.c
*** monitor.c	2000/02/09 08:52:46	1.2
--- monitor.c	2000/03/27 16:21:23
*************** When enabled, a hashmark \'#\' is displa
*** 2410,2424 ****
  				  &setlist),
  		     &showlist);
  
- #if 0
-   /* FIXME: cagney/1999-10-07: Wait until there is a generic ``set
-      debug ...'' rather than another ``set ...debug'' command. */
    add_show_from_set
!     (add_set_cmd ("monitordebug", no_class, var_zinteger,
  		  (char *) &monitor_debug_p,
  		  "Set debugging of remote monitor communication.\n\
  When enabled, communication between GDB and the remote monitor\n\
! is displayed.", &setlist),
!      &showlist);
! #endif
  }
--- 2410,2420 ----
  				  &setlist),
  		     &showlist);
  
    add_show_from_set
!     (add_set_cmd ("monitor", no_class, var_zinteger,
  		  (char *) &monitor_debug_p,
  		  "Set debugging of remote monitor communication.\n\
  When enabled, communication between GDB and the remote monitor\n\
! is displayed.", &setdebuglist),
!      &showdebuglist);
  }
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.190
diff -c -3 -p -r1.190 ChangeLog
*** ChangeLog	2000/03/27 10:24:58	1.190
--- ChangeLog	2000/03/27 16:21:24
***************
*** 1,3 ****
--- 1,23 ----
+ 2000-03-24  Daniel Berlin  <dan@cgsoftware.com>
+ 
+ 	* gdbtypes.c (_initialize_gdbtypes): Add "set debug overload",
+ 	which never existed before, and thus, has no deprecated old command.
+ 
+ 	* gdbarch.c (_initialize_gdbarch): Add "set debug arch", deprecate
+ 	"set archdebug" (same goes for the show commands).
+ 	* gdb-events.c (_initialize_gdb_events): Add "set debug event",
+ 	deprecate "set eventdebug" (same goes for the show commands).
+ 	* gdbcmd.h: Add the setdebuglist and showdebuglist externs.
+ 	* top.c (init_main): Deprecate remotedebug, use "set/show debug remote"
+ 	instead.
+ 	x(init_main): Add the "set debug" and "show debug" commands.
+ 	Add setdebuglist and showdebuglist.
+ 
+ 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.
+ 
  Mon Mar 27 19:53:29 2000  Andrew Cagney  <cagney@b1.cygnus.com>
  
  	* TODO: Update.  Add criteria for next release of GDB.
Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.1.1.11
diff -c -3 -p -r1.1.1.11 parse.c
*** parse.c	1999/10/12 04:37:23	1.1.1.11
--- parse.c	2000/03/27 16:21:24
*************** _initialize_parse ()
*** 1400,1409 ****
    register_gdbarch_swap (NULL, 0, build_parse);
  
    add_show_from_set (
! 	    add_set_cmd ("expressiondebug", class_maintenance, var_zinteger,
  			 (char *) &expressiondebug,
  			 "Set expression debugging.\n\
  When non-zero, the internal representation of expressions will be printed.",
! 			 &setlist),
! 		      &showlist);
  }
--- 1400,1409 ----
    register_gdbarch_swap (NULL, 0, build_parse);
  
    add_show_from_set (
! 	    add_set_cmd ("expression", class_maintenance, var_zinteger,
  			 (char *) &expressiondebug,
  			 "Set expression debugging.\n\
  When non-zero, the internal representation of expressions will be printed.",
! 			 &setdebuglist),
! 		      &showdebuglist);
  }
Index: serial.c
===================================================================
RCS file: /cvs/src/src/gdb/serial.c,v
retrieving revision 1.1.1.10
diff -c -3 -p -r1.1.1.10 serial.c
*** serial.c	2000/02/02 00:21:10	1.1.1.10
--- serial.c	2000/03/27 16:21:24
*************** by gdbserver.",
*** 672,682 ****
  		       &setlist),
       &showlist);
  
!   add_show_from_set (add_set_cmd ("serialdebug",
  				  class_maintenance,
  				  var_zinteger,
  				  (char *)&global_serial_debug_p,
  				  "Set serial debugging.\n\
! When non-zero, serial port debugging is enabled.", &setlist),
! 		     &showlist);
  }
--- 672,682 ----
  		       &setlist),
       &showlist);
  
!   add_show_from_set (add_set_cmd ("serial",
  				  class_maintenance,
  				  var_zinteger,
  				  (char *)&global_serial_debug_p,
  				  "Set serial debugging.\n\
! When non-zero, serial port debugging is enabled.", &setdebuglist),
! 		     &showdebuglist);
  }
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 target.c
*** target.c	2000/03/15 16:55:07	1.4
--- target.c	2000/03/27 16:21:25
*************** initialize_targets ()
*** 3082,3092 ****
    add_info ("files", target_info, targ_desc);
  
    add_show_from_set (
! 		add_set_cmd ("targetdebug", class_maintenance, var_zinteger,
  			     (char *) &targetdebug,
  			     "Set target debugging.\n\
! When non-zero, target debugging is enabled.", &setlist),
! 		      &showlist);
  
  
    add_com ("monitor", class_obscure, do_monitor_command,
--- 3082,3092 ----
    add_info ("files", target_info, targ_desc);
  
    add_show_from_set (
! 		add_set_cmd ("target", class_maintenance, var_zinteger,
  			     (char *) &targetdebug,
  			     "Set target debugging.\n\
! When non-zero, target debugging is enabled.", &setdebuglist),
! 		      &showdebuglist);
  
  
    add_com ("monitor", class_obscure, do_monitor_command,
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 top.c
*** top.c	2000/03/23 23:43:19	1.5
--- top.c	2000/03/27 16:21:26
*************** static void complete_command PARAMS ((ch
*** 144,149 ****
--- 144,153 ----
  
  static void do_nothing PARAMS ((int));
  
+ static void show_debug PARAMS ((char *, int));
+ 
+ static void set_debug PARAMS ((char *, int));
+ 
  #ifdef SIGHUP
  /* NOTE 1999-04-29: This function will be static again, once we modify
     gdb to use the event loop as the default command loop and we merge
*************** struct cmd_list_element *setprintlist;
*** 255,260 ****
--- 259,268 ----
  
  struct cmd_list_element *showprintlist;
  
+ struct cmd_list_element *setdebuglist;
+ 
+ struct cmd_list_element *showdebuglist;
+ 
  struct cmd_list_element *setchecklist;
  
  struct cmd_list_element *showchecklist;
*************** float_handler (signo)
*** 3986,3992 ****
    signal (SIGFPE, float_handler);
    error ("Erroneous arithmetic operation.");
  }
! 
  
  static void
  init_cmd_lists ()
--- 3994,4017 ----
    signal (SIGFPE, float_handler);
    error ("Erroneous arithmetic operation.");
  }
! 
! 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_cmd_lists ()
*************** This value is used to set the speed of t
*** 4313,4324 ****
  using remote targets.", &setlist),
  		     &showlist);
  
    add_show_from_set (
!   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),
! 		      &showlist);
  
    add_show_from_set (
  		      add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
--- 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,
*************** from the target.", &setlist),
*** 4358,4361 ****
--- 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);
  }
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.14
diff -c -3 -p -r1.14 ChangeLog
*** ChangeLog	2000/03/24 07:30:06	1.14
--- ChangeLog	2000/03/27 16:21:26
***************
*** 1,3 ****
--- 1,8 ----
+ 2000-03-27  Daniel Berlin  <dan@cgsoftware.com>
+ 
+ 	* gdb.texinfo (Debugging Output): Added new section, documenting
+ 	the "set/show debug" commands.
+ 
  Fri Mar 24 18:06:34 2000  Andrew Cagney  <cagney@b1.cygnus.com>
  
  	* annotate.texi (Annotations): When GDBN omit @chapter and @node
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.7
diff -c -3 -p -r1.7 gdb.texinfo
*** gdb.texinfo	2000/03/24 07:30:06	1.7
--- gdb.texinfo	2000/03/27 16:21:29
*************** Example sequence of a target being stepp
*** 9536,9552 ****
  <- @code{+}
  @end example

- @kindex set remotedebug@r{, serial protocol}
- @kindex show remotedebug@r{, serial protocol}
- @cindex packets, reporting on stdout
- @cindex serial connections, debugging
- If you have trouble with the serial connection, you can use the command
- @code{set remotedebug}.  This makes @value{GDBN} report on all packets sent
- back and forth across the serial line to the remote machine.  The
- packet-debugging information is printed on the @value{GDBN} standard output
- stream.  @code{set remotedebug off} turns it off, and @code{show
- remotedebug} shows you its current state.
-
  @node Server, NetWare, Protocol, Remote Serial
  @subsubsection Using the @code{gdbserver} program

--- 9536,9541 ----
*************** described here.
*** 11273,11278 ****
--- 11262,11268 ----
  * Screen Size::                 Screen size
  * Numbers::                     Numbers
  * Messages/Warnings::           Optional warnings and messages
+ * Debugging Output::            Optional messages about internal happenings
  @end menu
  
  @node Prompt, Editing, Controlling GDB, Controlling GDB
*************** Display the current default base for num
*** 11517,11523 ****
  Display the current default base for numeric display.
  @end table
  
! @node Messages/Warnings,  , Numbers, Controlling GDB
  @section Optional warnings and messages
  
  By default, @value{GDBN} is silent about its inner workings.  If you are
--- 11507,11513 ----
  Display the current default base for numeric display.
  @end table
  
! @node Messages/Warnings, Debugging Output , Numbers, Controlling GDB
  @section Optional warnings and messages
  
  By default, @value{GDBN} is silent about its inner workings.  If you are
*************** Displays state of confirmation requests.
*** 11593,11598 ****
--- 11583,11659 ----
  
  @end table
  
+ @node Debugging Output, ,Messages/Warnings, Controlling GDB
+ @section Optional messages about internal happenings
+ @table @code
+ @kindex set debug arch
+ @item set debug arch
+ Turns on or off display of gdbarch debugging info. The default is off
+ @kindex show debug arch
+ @item show debug arch
+ Displays the current state of displaying gdbarch debugging info.
+ @kindex set debug event
+ @item set debug event
+ Turns on or off display of @value{GDBN} event debugging info. The
+ default is off.
+ @kindex show debug event
+ @item show debug event
+ Displays the current state of displaying @value{GDBN} event debugging
+ info.
+ @kindex set debug expression
+ @item set debug expression
+ Turns on or off display of @value{GDBN} expression debugging info. The
+ default is off.
+ @kindex show debug expression
+ @item show debug expression
+ Displays the current state of displaying @value{GDBN} expression
+ debugging info.
+ @kindex set debug overload
+ @item set debug overload
+ Turns on or off display of @value{GDBN} C++ overload debugging
+ info. This includes info such as ranking of functions, etc. The default
+ is off.
+ @kindex show debug overload
+ @item show debug overload
+ Displays the current state of displaying @value{GDBN} C++ overload
+ debugging info.
+ @kindex set debug remote
+ @cindex packets, reporting on stdout
+ @cindex serial connections, debugging
+ @item set debug remote
+ Turns on or off display of reports on all packets sent back and forth across
+ the serial line to the remote machine.  The info is printed on the
+ @value{GDBN} standard output stream. The default is off.
+ @kindex show debug remote
+ @item show debug remote
+ Displays the state of display of remote packets.
+ @kindex set debug serial
+ @item set debug serial
+ Turns on or off display of @value{GDBN} serial debugging info. The
+ default is off.
+ @kindex show debug serial
+ @item show debug serial
+ Displays the current state of displaying @value{GDBN} serial debugging
+ info.
+ @kindex set debug target
+ @item set debug target
+ Turns on or off display of @value{GDBN} target debugging info. This info
+ includes what is going on at the target level of GDB, as it happens. The
+ default is off.
+ @kindex show debug target
+ @item show debug target
+ Displays the current state of displaying @value{GDBN} target debugging
+ info.
+ @kindex set debug varobj
+ @item set debug varobj
+ Turns on or off display of @value{GDBN} variable object debugging
+ info. The default is off.
+ @kindex show debug varobj
+ @item show debug varobj
+ Displays the current state of displaying @value{GDBN} variable object
+ debugging info.
+ @end table
+ 
  @node Sequences, Emacs, Controlling GDB, Top
  @chapter Canned Sequences of Commands
  

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