The set debug changes

This commit is contained in:
Daniel Berlin 2000-03-28 02:25:14 +00:00
parent 107b56f053
commit 5d161b2419
12 changed files with 436 additions and 294 deletions

View File

@ -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.
Tue Mar 28 11:52:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
* top.c (print_gdb_version): Bump copyright year to 2000.

View File

@ -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

View File

@ -9536,17 +9536,6 @@ Example sequence of a target being stepped by a single instruction:
<- @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
@ -11273,6 +11262,7 @@ described here.
* 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
@ -11517,7 +11507,7 @@ Display the current default base for numeric input.
Display the current default base for numeric display.
@end table
@node Messages/Warnings, , Numbers, Controlling GDB
@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
@ -11593,6 +11583,77 @@ Displays state of confirmation requests.
@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

View File

@ -214,16 +214,24 @@ void _initialize_gdb_events (void);
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
add_show_from_set (add_set_cmd ("eventdebug",
#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.", &setlist),
&showlist);
When non-zero, event/notify debugging is enabled.", &setdebuglist),
&showdebuglist);
}

View File

@ -3262,6 +3262,8 @@ extern void _initialize_gdbarch (void);
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);
@ -3288,11 +3290,21 @@ _initialize_gdbarch ()
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",
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.", &setlist),
&showlist);
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");
}

View File

@ -96,6 +96,10 @@ extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
extern struct cmd_list_element *setdebuglist;
extern struct cmd_list_element *showdebuglist;
extern struct cmd_list_element *setchecklist;
extern struct cmd_list_element *showchecklist;

View File

@ -75,7 +75,7 @@ struct type *builtin_type_CORE_ADDR;
struct type *builtin_type_bfd_vma;
int opaque_type_resolution = 1;
int overload_debug = 0;
struct extra
{
@ -2186,16 +2186,10 @@ rank_one_type (parm, arg)
if (TYPE_CODE (parm) == TYPE_CODE_REF)
return (rank_one_type (arg, TYPE_TARGET_TYPE (parm))
+ REFERENCE_CONVERSION_BADNESS);
#ifdef DEBUG_OLOAD
if (overload_debug)
/* 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",
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));
#endif
/* x -> y means arg of type x being supplied for parameter of type y */
@ -3020,6 +3014,7 @@ extern void _initialize_gdbtypes PARAMS ((void));
void
_initialize_gdbtypes ()
{
struct cmd_list_element *c;
build_gdbtypes ();
/* FIXME - For the moment, handle types by swapping them in and out.
@ -3060,4 +3055,11 @@ _initialize_gdbtypes ()
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);
}

View File

@ -2410,15 +2410,11 @@ When enabled, a hashmark \'#\' is displayed.",
&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,
(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.", &setlist),
&showlist);
#endif
is displayed.", &setdebuglist),
&showdebuglist);
}

View File

@ -1400,10 +1400,10 @@ _initialize_parse ()
register_gdbarch_swap (NULL, 0, build_parse);
add_show_from_set (
add_set_cmd ("expressiondebug", class_maintenance, var_zinteger,
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.",
&setlist),
&showlist);
&setdebuglist),
&showdebuglist);
}

View File

@ -672,11 +672,11 @@ by gdbserver.",
&setlist),
&showlist);
add_show_from_set (add_set_cmd ("serialdebug",
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.", &setlist),
&showlist);
When non-zero, serial port debugging is enabled.", &setdebuglist),
&showdebuglist);
}

View File

@ -3082,11 +3082,11 @@ initialize_targets ()
add_info ("files", target_info, targ_desc);
add_show_from_set (
add_set_cmd ("targetdebug", class_maintenance, var_zinteger,
add_set_cmd ("target", class_maintenance, var_zinteger,
(char *) &targetdebug,
"Set target debugging.\n\
When non-zero, target debugging is enabled.", &setlist),
&showlist);
When non-zero, target debugging is enabled.", &setdebuglist),
&showdebuglist);
add_com ("monitor", class_obscure, do_monitor_command,

View File

@ -144,6 +144,10 @@ static void complete_command PARAMS ((char *, int));
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
@ -255,6 +259,10 @@ struct cmd_list_element *setprintlist;
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;
@ -3986,7 +3994,24 @@ float_handler (signo)
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 ()
@ -4313,12 +4338,18 @@ This value is used to set the speed of the serial port when debugging\n\
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 ("remotedebug", no_class, var_zinteger, (char *) &remote_debug,
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.", &setlist),
&showlist);
is displayed.", &setdebuglist),
&showdebuglist);
add_show_from_set (
add_set_cmd ("remotetimeout", no_class, var_integer, (char *) &remote_timeout,
@ -4358,4 +4389,7 @@ from the target.", &setlist),
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);
}