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

File diff suppressed because it is too large Load Diff

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",
TYPE_NAME (arg), TYPE_CODE (arg), TYPE_NAME (parm), TYPE_CODE (parm));
#endif
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 */
@ -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);
}