Various fixes to improve C++ debugging. See ChangeLog.
[deliverable/binutils-gdb.git] / gdb / maint.c
CommitLineData
0239d9b3
FF
1/* Support for GDB maintenance commands.
2 Copyright (C) 1992 Free Software Foundation, Inc.
3 Written by Fred Fish at Cygnus Support.
4
5This file is part of GDB.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21
22#include "defs.h"
23
24#if MAINTENANCE_CMDS /* Entire file goes away if not including maint cmds */
25
26#include <signal.h>
27#include "command.h"
28#include "gdbcmd.h"
29#include "symtab.h"
30#include "gdbtypes.h"
31
32static void
33maintenance_command PARAMS ((char *, int));
34
35static void
36maintenance_dump_me PARAMS ((char *, int));
37
38/*
39
40LOCAL FUNCTION
41
42 maintenance_command -- access the maintenance subcommands
43
44SYNOPSIS
45
46 void maintenance_command (char *args, int from_tty)
47
48DESCRIPTION
49
50*/
51
52static void
53maintenance_command (args, from_tty)
54 char *args;
55 int from_tty;
56{
2e9309df
FF
57 printf ("\"maintenance\" must be followed by the name of a maintenance command.\n");
58 help_list (maintenancelist, "maintenance ", -1, stdout);
0239d9b3
FF
59}
60
61
62/* ARGSUSED */
63static void
64maintenance_dump_me (args, from_tty)
65 char *args;
66 int from_tty;
67{
68 if (query ("Should GDB dump core? "))
69 {
70 signal (SIGQUIT, SIG_DFL);
71 kill (getpid (), SIGQUIT);
72 }
73}
74
75/* The "maintenance info" command is defined as a prefix, with allow_unknown 0.
76 Therefore, its own definition is called only for "maintenance info" with
77 no args. */
78
79/* ARGSUSED */
80static void
81maintenance_info_command (arg, from_tty)
82 char *arg;
83 int from_tty;
84{
85 printf ("\"maintenance info\" must be followed by the name of an info command.\n");
86 help_list (maintenanceinfolist, "maintenance info ", -1, stdout);
87}
88
89/*
90
91GLOBAL FUNCTION
92
93 _initialize_maint_cmds -- initialize the process file system stuff
94
95SYNOPSIS
96
97 void _initialize_maint_cmds (void)
98
99DESCRIPTION
100
101 Do required initializations during gdb startup for using the
102 /proc file system interface.
103
104*/
105
106
107void
108_initialize_maint_cmds ()
109{
110 add_prefix_cmd ("maintenance", class_maintenance, maintenance_command,
111 "Commands for use by GDB maintainers.\n\
112Includes commands to dump specific internal GDB structures in\n\
113a human readable form, including dumping of symbol tables, type\n\
114chains, etc.",
2e9309df 115 &maintenancelist, "maintenance ", 0,
0239d9b3
FF
116 &cmdlist);
117
118 add_prefix_cmd ("info", class_info, maintenance_info_command,
119 "Maintenance command for showing things about the program being debugged.",
2e9309df 120 &maintenanceinfolist, "maintenance info ", 0,
0239d9b3
FF
121 &maintenancelist);
122
123 add_cmd ("dump-me", class_maintenance, maintenance_dump_me,
124 "Get fatal error; make debugger dump its core.\n\
125GDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\n\
126itself a SIGQUIT signal.",
127 &maintenancelist);
128
129 add_cmd ("print-type", class_maintenance, maintenance_print_type,
130 "Print a type chain for a given symbol.\n\
131For each node in a type chain, print the raw data for each member of\n\
132the type structure, and the interpretation of the data.",
133 &maintenancelist);
134
135 add_cmd ("print-symbols", class_maintenance, maintenance_print_symbols,
136 "Print dump of current symbol definitions.\n\
137Entries in the full symbol table are dumped to file OUTFILE.\n\
138If a SOURCE file is specified, dump only that file's symbols.",
139 &maintenancelist);
140
141 add_cmd ("print-msymbols", class_maintenance, maintenance_print_msymbols,
142 "Print dump of current minimal symbol definitions.\n\
143Entries in the minimal symbol table are dumped to file OUTFILE.\n\
144If a SOURCE file is specified, dump only that file's minimal symbols.",
145 &maintenancelist);
146
147 add_cmd ("print-psymbols", class_maintenance, maintenance_print_psymbols,
148 "Print dump of current partial symbol definitions.\n\
149Entries in the partial symbol table are dumped to file OUTFILE.\n\
150If a SOURCE file is specified, dump only that file's partial symbols.",
151 &maintenancelist);
152
153 add_cmd ("print-objfiles", class_maintenance, maintenance_print_objfiles,
154 "Print dump of current object file definitions.",
155 &maintenancelist);
156
157}
158
159#endif /* MAINTENANCE_CMDS */
This page took 0.028413 seconds and 4 git commands to generate.