From 0239d9b3289ab977e563150cfab9a98cd1c2e216 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Mon, 6 Jul 1992 00:22:57 +0000 Subject: [PATCH] * maint.c: New file. * Makefile.in (SFILES_MAINDIR): Add new file maint.c. * Makefile.in (OBS): Add new file maint.o. * defs.h (command_class): Add class_maintenance. * defs.h (MAINTENANCE_CMDS): Default to including maintenance commands. Allow for them (and other nonessential parts of gdb) to be selectively left out under special circumstances. * gdbtypes.c (recursive_dump_type): New function; supports maintenance print-type command. * gdbtypes.h (recursive_dump_type, maintenance_print_type): Add prototypes. * main.c (maintenancelist, maintenanceinfolist): Add maintenance command lists. * main.c (initialize_cmd_lists): Eliminate unnecessary casts on initializers. Add initializations for setprintlist, showprintlist, setchecklist, showchecklist, maintenancelist, and maintenanceinfolist. * printcmd.c (maintenance_print_type): New maintenance cmd. * valprint.c (setprintlist, showprintlist): Move to main.c, as implied by comment that all cmd lists are owned by main.c. * infcmd.c (unsetlist): Move to main.c, as implied by comment that all cmd lists are owned by main.c. * language.c (setchecklist, showchecklist): Move to main.c, as implied by comment that all cmd lists are owned by main.c * breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist, deletelist): Remove redundant declarations (also in gdbcmd.h). * symmisc.c (printsyms_command): Now maintenance_print_symbols. * symmisc.c (printmsyms_command): Now maintenance_print_msymbols. * symmisc.c (printpsyms_command): Now maintenance_print_psymbols. * symmisc.c (printobjfiles_command): Now maintenance_print_objfiles. * symtab.h (maintenance_print_symbols, maintenance_print_psymbols, maintenance_print_msymbols, maintenance_print_objfiles): Add prototypes. * symmisc.c (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): Removed from _initialize_symmisc. * main.c (dump_me_command): Moved to maint.c and renamed to maintenance_dump_me. * breakpoint.c (all_breakpoints_info): Rename to maintenance_info_breakpoints. * breakpoint.c (_initialize_breakpoint): Convert add_info of all_breakpoints_info to add maintenance_info_breakpoints to the maintenanceinfolist instead. main.c (initialize_main): Set up maintenance class commands. --- gdb/.Sanitize | 1 + gdb/ChangeLog | 46 +++++++++++++++++ gdb/Makefile.in | 4 +- gdb/defs.h | 17 +++++- gdb/gdbcmd.h | 62 +++++++++++++++++----- gdb/gdbtypes.c | 110 +++++++++++++++++++++++++++++++++++++++ gdb/gdbtypes.h | 8 +++ gdb/language.c | 3 -- gdb/main.c | 77 +++++++++++++++++---------- gdb/maint.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/valprint.c | 3 -- 11 files changed, 439 insertions(+), 50 deletions(-) create mode 100644 gdb/maint.c diff --git a/gdb/.Sanitize b/gdb/.Sanitize index 5101723..c72be7e 100644 --- a/gdb/.Sanitize +++ b/gdb/.Sanitize @@ -128,6 +128,7 @@ m88k-tdep.c m88k-xdep.c mach386-xdep.c main.c +maint.c mem-break.c minimon.h minsyms.c diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6e0cbc6..6757671 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,49 @@ +Sun Jul 5 17:17:16 1992 Fred Fish (fnf@cygnus.com) + + * maint.c: New file. + * Makefile.in (SFILES_MAINDIR): Add new file maint.c. + * Makefile.in (OBS): Add new file maint.o. + * defs.h (command_class): Add class_maintenance. + * defs.h (MAINTENANCE_CMDS): Default to including maintenance + commands. Allow for them (and other nonessential parts of gdb) + to be selectively left out under special circumstances. + * gdbtypes.c (recursive_dump_type): New function; supports + maintenance print-type command. + * gdbtypes.h (recursive_dump_type, maintenance_print_type): + Add prototypes. + * main.c (maintenancelist, maintenanceinfolist): Add maintenance + command lists. + * main.c (initialize_cmd_lists): Eliminate unnecessary casts on + initializers. Add initializations for setprintlist, showprintlist, + setchecklist, showchecklist, maintenancelist, and maintenanceinfolist. + * printcmd.c (maintenance_print_type): New maintenance cmd. + * valprint.c (setprintlist, showprintlist): Move to main.c, as + implied by comment that all cmd lists are owned by main.c. + * infcmd.c (unsetlist): Move to main.c, as implied by comment + that all cmd lists are owned by main.c. + * language.c (setchecklist, showchecklist): Move to main.c, as + implied by comment that all cmd lists are owned by main.c + * breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist, + deletelist): Remove redundant declarations (also in gdbcmd.h). + * symmisc.c (printsyms_command): Now maintenance_print_symbols. + * symmisc.c (printmsyms_command): Now maintenance_print_msymbols. + * symmisc.c (printpsyms_command): Now maintenance_print_psymbols. + * symmisc.c (printobjfiles_command): Now maintenance_print_objfiles. + * symtab.h (maintenance_print_symbols, maintenance_print_psymbols, + maintenance_print_msymbols, maintenance_print_objfiles): + Add prototypes. + * symmisc.c (printsyms_command, printpsyms_command, + printmsyms_command, printobjfiles_command): Removed from + _initialize_symmisc. + * main.c (dump_me_command): Moved to maint.c and renamed to + maintenance_dump_me. + * breakpoint.c (all_breakpoints_info): Rename to + maintenance_info_breakpoints. + * breakpoint.c (_initialize_breakpoint): Convert add_info of + all_breakpoints_info to add maintenance_info_breakpoints to the + maintenanceinfolist instead. + main.c (initialize_main): Set up maintenance class commands. + Sun Jul 5 11:03:53 1992 Stu Grossman (grossman at cygnus.com) * energize-patches: Fix minor problems with building energize lib. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 6c99944..18eddd3 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -194,7 +194,7 @@ SFILES_MAINDIR = \ ${DEMANGLER}.c mem-break.c target.c inftarg.c \ dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \ ieee-float.c language.c parse.c buildsym.c objfiles.c \ - minsyms.c mipsread.c + minsyms.c mipsread.c maint.c # Source files in subdirectories (which will be handled separately by # 'make gdb.tar.Z'). @@ -280,7 +280,7 @@ OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \ command.o utils.o expprint.o environ.o version.o gdbtypes.o \ copying.o $(DEPFILES) ${DEMANGLER}.o mem-break.o target.o \ inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \ - buildsym.o objfiles.o minsyms.o \ + buildsym.o objfiles.o minsyms.o maint.o \ dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES) diff --git a/gdb/defs.h b/gdb/defs.h index 1190f05..d093646 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -57,7 +57,7 @@ enum command_class /* Classes of commands */ no_class = -1, class_run = 0, class_vars, class_stack, class_files, class_support, class_info, class_breakpoint, - class_alias, class_obscure, class_user + class_alias, class_obscure, class_user, class_maintenance }; /* the cleanup list records things that have to be undone @@ -787,4 +787,19 @@ push_word PARAMS ((CORE_ADDR, REGISTER_TYPE)); extern CORE_ADDR push_word (); +/* Some parts of gdb might be considered optional, in the sense that they + are not essential for being able to build a working, usable debugger + for a specific environment. For example, the maintenance commands + are there for the benefit of gdb maintainers. As another example, + some environments really don't need gdb's that are able to read N + different object file formats. In order to make it possible (but + not necessarily recommended) to build "stripped down" versions of + gdb, the following defines control selective compilation of those + parts of gdb which can be safely left out when necessary. Note that + the default is to include everything. */ + +#ifndef MAINTENANCE_CMDS +#define MAINTENANCE_CMDS 1 +#endif + #endif /* !defined (DEFS_H) */ diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h index 39151f5..f5f7d82 100644 --- a/gdb/gdbcmd.h +++ b/gdb/gdbcmd.h @@ -1,19 +1,22 @@ /* Header file for GDB-specific command-line stuff. - Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc. + Copyright 1986, 1989, 1990, 1992 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#if !defined (GDBCMD_H) +#define GDBCMD_H 1 #include "command.h" @@ -45,7 +48,12 @@ extern struct cmd_list_element *enablebreaklist; extern struct cmd_list_element *setlist; +/* Chain containing all defined unset subcommands */ + +extern struct cmd_list_element *unsetlist; + /* Chain containing all defined show subcommands. */ + extern struct cmd_list_element *showlist; /* Chain containing all defined \"set history\". */ @@ -53,11 +61,37 @@ extern struct cmd_list_element *showlist; extern struct cmd_list_element *sethistlist; /* Chain containing all defined \"show history\". */ + extern struct cmd_list_element *showhistlist; /* Chain containing all defined \"unset history\". */ extern struct cmd_list_element *unsethistlist; -void execute_command (); -char **noop_completer (); +/* Chain containing all defined maintenance subcommands. */ + +#if MAINTENANCE_CMDS +extern struct cmd_list_element *maintenancelist; +#endif + +/* Chain containing all defined "maintenance info" subcommands. */ + +#if MAINTENANCE_CMDS +extern struct cmd_list_element *maintenanceinfolist; +#endif + +extern struct cmd_list_element *setprintlist; + +extern struct cmd_list_element *showprintlist; + +extern struct cmd_list_element *setchecklist; + +extern struct cmd_list_element *showchecklist; + +extern void +execute_command PARAMS ((char *, int)); + +extern char ** +noop_completer PARAMS ((char *)); + +#endif /* !defined (GDBCMD_H) */ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 28e8aa4..5f03549 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1105,3 +1105,113 @@ lookup_fundamental_type (objfile, typeid) return (type); } +#if MAINTENANCE_CMDS + +void recursive_dump_type (type, spaces) + struct type *type; + int spaces; +{ + int idx; + struct field *fldp; + + print_spaces_filtered (spaces, stdout); + printf_filtered ("type node @ 0x%x\n", type); + print_spaces_filtered (spaces, stdout); + printf_filtered ("name: 0x%x '%s'\n", type -> name, + type -> name ? type -> name : ""); + print_spaces_filtered (spaces, stdout); + printf_filtered ("code: 0x%x ", type -> code); + switch (type -> code) + { + case TYPE_CODE_UNDEF: printf_filtered ("TYPE_CODE_UNDEF"); break; + case TYPE_CODE_PTR: printf_filtered ("TYPE_CODE_PTR"); break; + case TYPE_CODE_ARRAY: printf_filtered ("TYPE_CODE_ARRAY"); break; + case TYPE_CODE_STRUCT: printf_filtered ("TYPE_CODE_STRUCT"); break; + case TYPE_CODE_UNION: printf_filtered ("TYPE_CODE_UNION"); break; + case TYPE_CODE_ENUM: printf_filtered ("TYPE_CODE_ENUM"); break; + case TYPE_CODE_FUNC: printf_filtered ("TYPE_CODE_FUNC"); break; + case TYPE_CODE_INT: printf_filtered ("TYPE_CODE_INT"); break; + case TYPE_CODE_FLT: printf_filtered ("TYPE_CODE_FLT"); break; + case TYPE_CODE_VOID: printf_filtered ("TYPE_CODE_VOID"); break; + case TYPE_CODE_SET: printf_filtered ("TYPE_CODE_SET"); break; + case TYPE_CODE_RANGE: printf_filtered ("TYPE_CODE_RANGE"); break; + case TYPE_CODE_PASCAL_ARRAY: printf_filtered ("TYPE_CODE_PASCAL_ARRAY"); break; + case TYPE_CODE_ERROR: printf_filtered ("TYPE_CODE_ERROR"); break; + case TYPE_CODE_MEMBER: printf_filtered ("TYPE_CODE_MEMBER"); break; + case TYPE_CODE_METHOD: printf_filtered ("TYPE_CODE_METHOD"); break; + case TYPE_CODE_REF: printf_filtered ("TYPE_CODE_REF"); break; + case TYPE_CODE_CHAR: printf_filtered ("TYPE_CODE_CHAR"); break; + case TYPE_CODE_BOOL: printf_filtered ("TYPE_CODE_BOOL"); break; + default: printf_filtered (""); break; + } + printf_filtered ("\n"); + print_spaces_filtered (spaces, stdout); + printf_filtered ("length: %d\n", type -> length); + print_spaces_filtered (spaces, stdout); + printf_filtered ("objfile: 0x%x\n", type -> objfile); + print_spaces_filtered (spaces, stdout); + printf_filtered ("target_type: 0x%x\n", type -> target_type); + if (type -> target_type != NULL) + { + recursive_dump_type (type -> target_type, spaces + 2); + } + print_spaces_filtered (spaces, stdout); + printf_filtered ("pointer_type: 0x%x\n", type -> pointer_type); + print_spaces_filtered (spaces, stdout); + printf_filtered ("reference_type: 0x%x\n", type -> reference_type); + print_spaces_filtered (spaces, stdout); + printf_filtered ("function_type: 0x%x\n", type -> function_type); + + print_spaces_filtered (spaces, stdout); + printf_filtered ("flags: 0x%x", type -> flags); + if (type -> flags & TYPE_FLAG_UNSIGNED) + printf_filtered (" TYPE_FLAG_UNSIGNED"); + if (type -> flags & TYPE_FLAG_SIGNED) + printf_filtered (" TYPE_FLAG_SIGNED"); + if (type -> flags & TYPE_FLAG_STUB) + printf_filtered (" TYPE_FLAG_STUB"); + printf_filtered ("\n"); + + print_spaces_filtered (spaces, stdout); + printf_filtered ("nfields: %d at 0x%x\n", type -> nfields, type -> fields); + for (idx = 0; idx < type -> nfields; idx++) + { + fldp = &(type -> fields[idx]); + print_spaces_filtered (spaces + 2, stdout); + printf_filtered ("[%d] bitpos %d bitsize %d type 0x%x name 0x%x '%s'\n", + idx, fldp -> bitpos, fldp -> bitsize, fldp -> type, + fldp -> name, fldp -> name ? fldp -> name : ""); + if (fldp -> type != NULL) + { + recursive_dump_type (fldp -> type, spaces + 4); + } + } + + print_spaces_filtered (spaces, stdout); + printf_filtered ("vptr_basetype: 0x%x\n", type -> vptr_basetype); + if (type -> vptr_basetype != NULL) + { + recursive_dump_type (type -> vptr_basetype, spaces + 2); + } + + print_spaces_filtered (spaces, stdout); + printf_filtered ("vptr_fieldno: %d\n", type -> vptr_fieldno); + + switch (type -> code) + { + case TYPE_CODE_METHOD: + case TYPE_CODE_FUNC: + print_spaces_filtered (spaces, stdout); + printf_filtered ("arg_types: 0x%x\n", + type -> type_specific.arg_types); + break; + + case TYPE_CODE_STRUCT: + print_spaces_filtered (spaces, stdout); + printf_filtered ("cplus_stuff: 0x%x\n", + type -> type_specific.cplus_stuff); + break; + } +} + +#endif /* MAINTENANCE_CMDS */ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 7e51e45..699eff0 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -557,9 +557,17 @@ lookup_fundamental_type PARAMS ((struct objfile *, int)); extern void fill_in_vptr_fieldno PARAMS ((struct type *)); +#if MAINTENANCE_CMDS +extern void recursive_dump_type PARAMS ((struct type *, int)); +#endif + /* printcmd.c */ extern void print_scalar_formatted PARAMS ((char *, struct type *, int, int, FILE *)); +#if MAINTENANCE_CMDS +extern void maintenance_print_type PARAMS ((char *, int)); +#endif + #endif /* GDBTYPES_H */ diff --git a/gdb/language.c b/gdb/language.c index c9fc34b..2ecb150 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -981,9 +981,6 @@ language_str(lang) return "Unknown"; } -struct cmd_list_element *setchecklist = NULL; -struct cmd_list_element *showchecklist = NULL; - static void set_check (ignore, from_tty) char *ignore; diff --git a/gdb/main.c b/gdb/main.c index 5efb478..0eb254f 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -120,9 +120,6 @@ static void show_commands PARAMS ((char *, int)); static void -dump_me_command PARAMS ((char *, int)); - -static void echo_command PARAMS ((char *, int)); static void @@ -227,7 +224,12 @@ struct cmd_list_element *enablebreaklist; struct cmd_list_element *setlist; +/* Chain containing all defined unset subcommands */ + +struct cmd_list_element *unsetlist; + /* Chain containing all defined show subcommands. */ + struct cmd_list_element *showlist; /* Chain containing all defined \"set history\". */ @@ -235,12 +237,33 @@ struct cmd_list_element *showlist; struct cmd_list_element *sethistlist; /* Chain containing all defined \"show history\". */ + struct cmd_list_element *showhistlist; /* Chain containing all defined \"unset history\". */ struct cmd_list_element *unsethistlist; +/* Chain containing all defined maintenance subcommands. */ + +#if MAINTENANCE_CMDS +struct cmd_list_element *maintenancelist; +#endif + +/* Chain containing all defined "maintenance info" subcommands. */ + +#if MAINTENANCE_CMDS +struct cmd_list_element *maintenanceinfolist; +#endif + +struct cmd_list_element *setprintlist; + +struct cmd_list_element *showprintlist; + +struct cmd_list_element *setchecklist; + +struct cmd_list_element *showchecklist; + /* stdio stream that command input is being read from. */ FILE *instream; @@ -1998,18 +2021,6 @@ echo_command (text, from_tty) fflush (stdout); } -/* ARGSUSED */ -static void -dump_me_command (args, from_tty) - char *args; - int from_tty; -{ - if (query ("Should GDB dump core? ")) - { - signal (SIGQUIT, SIG_DFL); - kill (getpid (), SIGQUIT); - } -} /* Functions to manipulate command line editing control variables. */ @@ -2178,17 +2189,26 @@ batch_mode () static void initialize_cmd_lists () { - cmdlist = (struct cmd_list_element *) 0; - infolist = (struct cmd_list_element *) 0; - enablelist = (struct cmd_list_element *) 0; - disablelist = (struct cmd_list_element *) 0; - deletelist = (struct cmd_list_element *) 0; - enablebreaklist = (struct cmd_list_element *) 0; - setlist = (struct cmd_list_element *) 0; + cmdlist = NULL; + infolist = NULL; + enablelist = NULL; + disablelist = NULL; + deletelist = NULL; + enablebreaklist = NULL; + setlist = NULL; + unsetlist = NULL; showlist = NULL; - sethistlist = (struct cmd_list_element *) 0; + sethistlist = NULL; showhistlist = NULL; - unsethistlist = (struct cmd_list_element *) 0; + unsethistlist = NULL; +#if MAINTENANCE_CMDS + maintenancelist = NULL; + maintenanceinfolist = NULL; +#endif + setprintlist = NULL; + showprintlist = NULL; + setchecklist = NULL; + showchecklist = NULL; } /* Init the history buffer. Note that we are called after the init file(s) @@ -2247,6 +2267,12 @@ initialize_main () /* Define the classes of commands. They will appear in the help list in the reverse of this order. */ + add_cmd ("internals", class_maintenance, NO_FUNCTION, + "Maintenance commands.\n\ +Some gdb commands are provided just for use by gdb maintainers.\n\ +These commands are subject to frequent change, and may not be as\n\ +well documented as user commands.", + &cmdlist); add_cmd ("obscure", class_obscure, NO_FUNCTION, "Obscure features.", &cmdlist); add_cmd ("aliases", class_alias, NO_FUNCTION, "Aliases of other commands.", &cmdlist); add_cmd ("user-defined", class_user, NO_FUNCTION, "User-defined commands.\n\ @@ -2325,9 +2351,6 @@ when gdb is started."); c->function.sfunc = set_verbose; set_verbose (NULL, 0, c); - add_com ("dump-me", class_obscure, dump_me_command, - "Get fatal error; make debugger dump its core."); - add_show_from_set (add_set_cmd ("editing", class_support, var_boolean, (char *)&command_editing_p, "Set editing of command lines as they are typed.\n\ diff --git a/gdb/maint.c b/gdb/maint.c new file mode 100644 index 0000000..f1e8999 --- /dev/null +++ b/gdb/maint.c @@ -0,0 +1,158 @@ +/* Support for GDB maintenance commands. + Copyright (C) 1992 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#include "defs.h" + +#if MAINTENANCE_CMDS /* Entire file goes away if not including maint cmds */ + +#include +#include "command.h" +#include "gdbcmd.h" +#include "symtab.h" +#include "gdbtypes.h" + +static void +maintenance_command PARAMS ((char *, int)); + +static void +maintenance_dump_me PARAMS ((char *, int)); + +/* + +LOCAL FUNCTION + + maintenance_command -- access the maintenance subcommands + +SYNOPSIS + + void maintenance_command (char *args, int from_tty) + +DESCRIPTION + +*/ + +static void +maintenance_command (args, from_tty) + char *args; + int from_tty; +{ + error ("Unimplemented maintenance command '%s'", args); +} + + +/* ARGSUSED */ +static void +maintenance_dump_me (args, from_tty) + char *args; + int from_tty; +{ + if (query ("Should GDB dump core? ")) + { + signal (SIGQUIT, SIG_DFL); + kill (getpid (), SIGQUIT); + } +} + +/* The "maintenance info" command is defined as a prefix, with allow_unknown 0. + Therefore, its own definition is called only for "maintenance info" with + no args. */ + +/* ARGSUSED */ +static void +maintenance_info_command (arg, from_tty) + char *arg; + int from_tty; +{ + printf ("\"maintenance info\" must be followed by the name of an info command.\n"); + help_list (maintenanceinfolist, "maintenance info ", -1, stdout); +} + +/* + +GLOBAL FUNCTION + + _initialize_maint_cmds -- initialize the process file system stuff + +SYNOPSIS + + void _initialize_maint_cmds (void) + +DESCRIPTION + + Do required initializations during gdb startup for using the + /proc file system interface. + +*/ + + +void +_initialize_maint_cmds () +{ + add_prefix_cmd ("maintenance", class_maintenance, maintenance_command, + "Commands for use by GDB maintainers.\n\ +Includes commands to dump specific internal GDB structures in\n\ +a human readable form, including dumping of symbol tables, type\n\ +chains, etc.", + &maintenancelist, "maintenance ", 1, + &cmdlist); + + add_prefix_cmd ("info", class_info, maintenance_info_command, + "Maintenance command for showing things about the program being debugged.", + &maintenanceinfolist, "maintenance info ", 1, + &maintenancelist); + + add_cmd ("dump-me", class_maintenance, maintenance_dump_me, + "Get fatal error; make debugger dump its core.\n\ +GDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\n\ +itself a SIGQUIT signal.", + &maintenancelist); + + add_cmd ("print-type", class_maintenance, maintenance_print_type, + "Print a type chain for a given symbol.\n\ +For each node in a type chain, print the raw data for each member of\n\ +the type structure, and the interpretation of the data.", + &maintenancelist); + + add_cmd ("print-symbols", class_maintenance, maintenance_print_symbols, + "Print dump of current symbol definitions.\n\ +Entries in the full symbol table are dumped to file OUTFILE.\n\ +If a SOURCE file is specified, dump only that file's symbols.", + &maintenancelist); + + add_cmd ("print-msymbols", class_maintenance, maintenance_print_msymbols, + "Print dump of current minimal symbol definitions.\n\ +Entries in the minimal symbol table are dumped to file OUTFILE.\n\ +If a SOURCE file is specified, dump only that file's minimal symbols.", + &maintenancelist); + + add_cmd ("print-psymbols", class_maintenance, maintenance_print_psymbols, + "Print dump of current partial symbol definitions.\n\ +Entries in the partial symbol table are dumped to file OUTFILE.\n\ +If a SOURCE file is specified, dump only that file's partial symbols.", + &maintenancelist); + + add_cmd ("print-objfiles", class_maintenance, maintenance_print_objfiles, + "Print dump of current object file definitions.", + &maintenancelist); + +} + +#endif /* MAINTENANCE_CMDS */ diff --git a/gdb/valprint.c b/gdb/valprint.c index 4e5525f..e8c99ec 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2001,9 +2001,6 @@ set_radix (arg, from_tty, c) set_output_radix (arg, 0, c); } -struct cmd_list_element *setprintlist = NULL; -struct cmd_list_element *showprintlist = NULL; - /*ARGSUSED*/ static void set_print (arg, from_tty) -- 2.7.4