]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/maint.c
Add R_AARCH64_P32_MOVW_PREL_* ELF32 relocs
[thirdparty/binutils-gdb.git] / gdb / maint.c
CommitLineData
c906108c 1/* Support for GDB maintenance commands.
c6f0559b 2
42a4f53d 3 Copyright (C) 1992-2019 Free Software Foundation, Inc.
c6f0559b 4
c906108c
SS
5 Written by Fred Fish at Cygnus Support.
6
c5aa993b 7 This file is part of GDB.
c906108c 8
c5aa993b
JM
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
a9762ec7 11 the Free Software Foundation; either version 3 of the License, or
c5aa993b 12 (at your option) any later version.
c906108c 13
c5aa993b
JM
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
c906108c 18
c5aa993b 19 You should have received a copy of the GNU General Public License
a9762ec7 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
21
22
23#include "defs.h"
e17c207e 24#include "arch-utils.h"
c906108c
SS
25#include <ctype.h>
26#include <signal.h>
27#include "command.h"
28#include "gdbcmd.h"
29#include "symtab.h"
bd712aed 30#include "block.h"
c906108c
SS
31#include "gdbtypes.h"
32#include "demangle.h"
33#include "gdbcore.h"
c5aa993b 34#include "expression.h" /* For language.h */
c906108c
SS
35#include "language.h"
36#include "symfile.h"
37#include "objfiles.h"
38#include "value.h"
bd712aed 39#include "top.h"
bd712aed 40#include "maint.h"
0747795c 41#include "common/selftest.h"
c906108c 42
18a642a1 43#include "cli/cli-decode.h"
529480d0 44#include "cli/cli-utils.h"
bd712aed 45#include "cli/cli-setshow.h"
18a642a1 46
58971144 47static void maintenance_do_deprecate (const char *, int);
1c689132 48
7f86f058 49/* Access the maintenance subcommands. */
c906108c
SS
50
51static void
981a3fb3 52maintenance_command (const char *args, int from_tty)
c906108c 53{
3e43a32a
MS
54 printf_unfiltered (_("\"maintenance\" must be followed by "
55 "the name of a maintenance command.\n"));
635c7e8a 56 help_list (maintenancelist, "maintenance ", all_commands, gdb_stdout);
c906108c
SS
57}
58
59#ifndef _WIN32
c906108c 60static void
58971144 61maintenance_dump_me (const char *args, int from_tty)
c906108c 62{
9e2f0ad4 63 if (query (_("Should GDB dump core? ")))
c906108c 64 {
7be570e7
JM
65#ifdef __DJGPP__
66 /* SIGQUIT by default is ignored, so use SIGABRT instead. */
67 signal (SIGABRT, SIG_DFL);
68 kill (getpid (), SIGABRT);
69#else
c906108c
SS
70 signal (SIGQUIT, SIG_DFL);
71 kill (getpid (), SIGQUIT);
7be570e7 72#endif
c906108c
SS
73 }
74}
75#endif
76
7be570e7
JM
77/* Stimulate the internal error mechanism that GDB uses when an
78 internal problem is detected. Allows testing of the mechanism.
79 Also useful when the user wants to drop a core file but not exit
025bb325 80 GDB. */
7be570e7
JM
81
82static void
5fed81ff 83maintenance_internal_error (const char *args, int from_tty)
7be570e7 84{
dec43320
AC
85 internal_error (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
86}
87
88/* Stimulate the internal error mechanism that GDB uses when an
89 internal problem is detected. Allows testing of the mechanism.
90 Also useful when the user wants to drop a core file but not exit
025bb325 91 GDB. */
dec43320
AC
92
93static void
5fed81ff 94maintenance_internal_warning (const char *args, int from_tty)
dec43320
AC
95{
96 internal_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
7be570e7
JM
97}
98
57fcfb1b
GB
99/* Stimulate the internal error mechanism that GDB uses when an
100 demangler problem is detected. Allows testing of the mechanism. */
101
102static void
5fed81ff 103maintenance_demangler_warning (const char *args, int from_tty)
57fcfb1b
GB
104{
105 demangler_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
106}
107
439250fb
DE
108/* Old command to demangle a string. The command has been moved to "demangle".
109 It is kept for now because otherwise "mt demangle" gets interpreted as
110 "mt demangler-warning" which artificially creates an internal gdb error. */
c906108c
SS
111
112static void
58971144 113maintenance_demangle (const char *args, int from_tty)
c906108c 114{
439250fb 115 printf_filtered (_("This command has been moved to \"demangle\".\n"));
c906108c
SS
116}
117
118static void
58971144 119maintenance_time_display (const char *args, int from_tty)
c906108c 120{
c906108c 121 if (args == NULL || *args == '\0')
a3f17187 122 printf_unfiltered (_("\"maintenance time\" takes a numeric argument.\n"));
c906108c 123 else
bd712aed 124 set_per_command_time (strtol (args, NULL, 10));
c906108c
SS
125}
126
127static void
5fed81ff 128maintenance_space_display (const char *args, int from_tty)
c906108c 129{
c906108c
SS
130 if (args == NULL || *args == '\0')
131 printf_unfiltered ("\"maintenance space\" takes a numeric argument.\n");
132 else
bd712aed 133 set_per_command_space (strtol (args, NULL, 10));
c906108c
SS
134}
135
33f91161
AC
136/* The "maintenance info" command is defined as a prefix, with
137 allow_unknown 0. Therefore, its own definition is called only for
138 "maintenance info" with no args. */
c906108c 139
c906108c 140static void
981a3fb3 141maintenance_info_command (const char *arg, int from_tty)
c906108c 142{
3e43a32a
MS
143 printf_unfiltered (_("\"maintenance info\" must be followed "
144 "by the name of an info command.\n"));
635c7e8a
TT
145 help_list (maintenanceinfolist, "maintenance info ", all_commands,
146 gdb_stdout);
c906108c
SS
147}
148
27d41eac
YQ
149/* The "maintenance check" command is defined as a prefix, with
150 allow_unknown 0. Therefore, its own definition is called only for
151 "maintenance check" with no args. */
152
153static void
981a3fb3 154maintenance_check_command (const char *arg, int from_tty)
27d41eac
YQ
155{
156 printf_unfiltered (_("\"maintenance check\" must be followed "
157 "by the name of a check command.\n"));
158 help_list (maintenancechecklist, "maintenance check ", all_commands,
159 gdb_stdout);
160}
161
a532ca62
MS
162/* Mini tokenizing lexer for 'maint info sections' command. */
163
164static int
473e38f3 165match_substring (const char *string, const char *substr)
a532ca62
MS
166{
167 int substr_len = strlen(substr);
473e38f3 168 const char *tok;
a532ca62
MS
169
170 while ((tok = strstr (string, substr)) != NULL)
171 {
025bb325 172 /* Got a partial match. Is it a whole word? */
b01d807c
MS
173 if (tok == string
174 || tok[-1] == ' '
175 || tok[-1] == '\t')
a532ca62 176 {
025bb325 177 /* Token is delimited at the front... */
b01d807c
MS
178 if (tok[substr_len] == ' '
179 || tok[substr_len] == '\t'
180 || tok[substr_len] == '\0')
a532ca62
MS
181 {
182 /* Token is delimited at the rear. Got a whole-word match. */
183 return 1;
184 }
185 }
186 /* Token didn't match as a whole word. Advance and try again. */
187 string = tok + 1;
188 }
189 return 0;
190}
191
43155bc1 192static int
fc4baa5e 193match_bfd_flags (const char *string, flagword flags)
c906108c 194{
43155bc1 195 if (flags & SEC_ALLOC)
a532ca62 196 if (match_substring (string, "ALLOC"))
43155bc1
MS
197 return 1;
198 if (flags & SEC_LOAD)
a532ca62 199 if (match_substring (string, "LOAD"))
43155bc1
MS
200 return 1;
201 if (flags & SEC_RELOC)
a532ca62 202 if (match_substring (string, "RELOC"))
43155bc1
MS
203 return 1;
204 if (flags & SEC_READONLY)
a532ca62 205 if (match_substring (string, "READONLY"))
43155bc1
MS
206 return 1;
207 if (flags & SEC_CODE)
a532ca62 208 if (match_substring (string, "CODE"))
43155bc1
MS
209 return 1;
210 if (flags & SEC_DATA)
a532ca62 211 if (match_substring (string, "DATA"))
43155bc1
MS
212 return 1;
213 if (flags & SEC_ROM)
a532ca62 214 if (match_substring (string, "ROM"))
43155bc1
MS
215 return 1;
216 if (flags & SEC_CONSTRUCTOR)
a532ca62 217 if (match_substring (string, "CONSTRUCTOR"))
43155bc1
MS
218 return 1;
219 if (flags & SEC_HAS_CONTENTS)
a532ca62 220 if (match_substring (string, "HAS_CONTENTS"))
43155bc1
MS
221 return 1;
222 if (flags & SEC_NEVER_LOAD)
a532ca62 223 if (match_substring (string, "NEVER_LOAD"))
43155bc1
MS
224 return 1;
225 if (flags & SEC_COFF_SHARED_LIBRARY)
a532ca62 226 if (match_substring (string, "COFF_SHARED_LIBRARY"))
43155bc1
MS
227 return 1;
228 if (flags & SEC_IS_COMMON)
a532ca62 229 if (match_substring (string, "IS_COMMON"))
43155bc1 230 return 1;
c906108c 231
43155bc1
MS
232 return 0;
233}
c906108c 234
43155bc1
MS
235static void
236print_bfd_flags (flagword flags)
237{
c906108c
SS
238 if (flags & SEC_ALLOC)
239 printf_filtered (" ALLOC");
240 if (flags & SEC_LOAD)
241 printf_filtered (" LOAD");
242 if (flags & SEC_RELOC)
243 printf_filtered (" RELOC");
244 if (flags & SEC_READONLY)
245 printf_filtered (" READONLY");
246 if (flags & SEC_CODE)
247 printf_filtered (" CODE");
248 if (flags & SEC_DATA)
249 printf_filtered (" DATA");
250 if (flags & SEC_ROM)
251 printf_filtered (" ROM");
252 if (flags & SEC_CONSTRUCTOR)
253 printf_filtered (" CONSTRUCTOR");
254 if (flags & SEC_HAS_CONTENTS)
255 printf_filtered (" HAS_CONTENTS");
256 if (flags & SEC_NEVER_LOAD)
257 printf_filtered (" NEVER_LOAD");
258 if (flags & SEC_COFF_SHARED_LIBRARY)
259 printf_filtered (" COFF_SHARED_LIBRARY");
260 if (flags & SEC_IS_COMMON)
261 printf_filtered (" IS_COMMON");
43155bc1
MS
262}
263
264static void
67a2b77e
AC
265maint_print_section_info (const char *name, flagword flags,
266 CORE_ADDR addr, CORE_ADDR endaddr,
5af949e3 267 unsigned long filepos, int addr_size)
43155bc1 268{
5af949e3
UW
269 printf_filtered (" %s", hex_string_custom (addr, addr_size));
270 printf_filtered ("->%s", hex_string_custom (endaddr, addr_size));
3ab13650 271 printf_filtered (" at %s",
bb599908 272 hex_string_custom ((unsigned long) filepos, 8));
e3d3bfda
MS
273 printf_filtered (": %s", name);
274 print_bfd_flags (flags);
275 printf_filtered ("\n");
276}
c906108c 277
e3d3bfda
MS
278static void
279print_bfd_section_info (bfd *abfd,
280 asection *asect,
fc4baa5e 281 void *datum)
e3d3bfda
MS
282{
283 flagword flags = bfd_get_section_flags (abfd, asect);
284 const char *name = bfd_section_name (abfd, asect);
19ba03f4 285 const char *arg = (const char *) datum;
e3d3bfda 286
fc4baa5e
TT
287 if (arg == NULL || *arg == '\0'
288 || match_substring (arg, name)
289 || match_bfd_flags (arg, flags))
e3d3bfda 290 {
5af949e3
UW
291 struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
292 int addr_size = gdbarch_addr_bit (gdbarch) / 8;
e3d3bfda
MS
293 CORE_ADDR addr, endaddr;
294
295 addr = bfd_section_vma (abfd, asect);
296 endaddr = addr + bfd_section_size (abfd, asect);
8625fc1b 297 printf_filtered (" [%d] ", gdb_bfd_section_index (abfd, asect));
5af949e3
UW
298 maint_print_section_info (name, flags, addr, endaddr,
299 asect->filepos, addr_size);
e3d3bfda
MS
300 }
301}
302
303static void
304print_objfile_section_info (bfd *abfd,
305 struct obj_section *asect,
fc4baa5e 306 const char *string)
e3d3bfda
MS
307{
308 flagword flags = bfd_get_section_flags (abfd, asect->the_bfd_section);
309 const char *name = bfd_section_name (abfd, asect->the_bfd_section);
43155bc1 310
b01d807c
MS
311 if (string == NULL || *string == '\0'
312 || match_substring (string, name)
313 || match_bfd_flags (string, flags))
43155bc1 314 {
5af949e3
UW
315 struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
316 int addr_size = gdbarch_addr_bit (gdbarch) / 8;
b8d56208 317
f1f6aadf
PA
318 maint_print_section_info (name, flags,
319 obj_section_addr (asect),
320 obj_section_endaddr (asect),
5af949e3
UW
321 asect->the_bfd_section->filepos,
322 addr_size);
43155bc1 323 }
c906108c
SS
324}
325
c906108c 326static void
58971144 327maintenance_info_sections (const char *arg, int from_tty)
c906108c
SS
328{
329 if (exec_bfd)
330 {
a3f17187 331 printf_filtered (_("Exec file:\n"));
c5aa993b 332 printf_filtered (" `%s', ", bfd_get_filename (exec_bfd));
c906108c 333 wrap_here (" ");
a3f17187 334 printf_filtered (_("file type %s.\n"), bfd_get_target (exec_bfd));
a532ca62 335 if (arg && *arg && match_substring (arg, "ALLOBJ"))
e3d3bfda 336 {
e3d3bfda
MS
337 struct obj_section *osect;
338
339 /* Only this function cares about the 'ALLOBJ' argument;
340 if 'ALLOBJ' is the only argument, discard it rather than
341 passing it down to print_objfile_section_info (which
342 wouldn't know how to handle it). */
343 if (strcmp (arg, "ALLOBJ") == 0)
344 arg = NULL;
345
2030c079 346 for (objfile *ofile : current_program_space->objfiles ())
e3d3bfda 347 {
a3f17187 348 printf_filtered (_(" Object file: %s\n"),
e3d3bfda
MS
349 bfd_get_filename (ofile->obfd));
350 ALL_OBJFILE_OSECTIONS (ofile, osect)
351 {
352 print_objfile_section_info (ofile->obfd, osect, arg);
353 }
354 }
355 }
356 else
58971144 357 bfd_map_over_sections (exec_bfd, print_bfd_section_info, (void *) arg);
c906108c
SS
358 }
359
360 if (core_bfd)
361 {
a3f17187 362 printf_filtered (_("Core file:\n"));
c5aa993b 363 printf_filtered (" `%s', ", bfd_get_filename (core_bfd));
c906108c 364 wrap_here (" ");
a3f17187 365 printf_filtered (_("file type %s.\n"), bfd_get_target (core_bfd));
58971144 366 bfd_map_over_sections (core_bfd, print_bfd_section_info, (void *) arg);
c906108c
SS
367 }
368}
369
025cfdb2 370static void
58971144 371maintenance_print_statistics (const char *args, int from_tty)
c906108c
SS
372{
373 print_objfile_statistics ();
374 print_symbol_bcache_statistics ();
375}
376
b9362cc7 377static void
5fed81ff 378maintenance_print_architecture (const char *args, int from_tty)
4b9b3959 379{
e17c207e
UW
380 struct gdbarch *gdbarch = get_current_arch ();
381
4b9b3959 382 if (args == NULL)
e17c207e 383 gdbarch_dump (gdbarch, gdb_stdout);
4b9b3959
AC
384 else
385 {
d7e74731 386 stdio_file file;
b8d56208 387
d7e74731 388 if (!file.open (args, "w"))
e2e0b3e5 389 perror_with_name (_("maintenance print architecture"));
d7e74731 390 gdbarch_dump (gdbarch, &file);
4b9b3959
AC
391 }
392}
393
33f91161
AC
394/* The "maintenance print" command is defined as a prefix, with
395 allow_unknown 0. Therefore, its own definition is called only for
396 "maintenance print" with no args. */
c906108c 397
c906108c 398static void
981a3fb3 399maintenance_print_command (const char *arg, int from_tty)
c906108c 400{
3e43a32a
MS
401 printf_unfiltered (_("\"maintenance print\" must be followed "
402 "by the name of a print command.\n"));
635c7e8a
TT
403 help_list (maintenanceprintlist, "maintenance print ", all_commands,
404 gdb_stdout);
c906108c
SS
405}
406
407/* The "maintenance translate-address" command converts a section and address
408 to a symbol. This can be called in two ways:
c5aa993b 409 maintenance translate-address <secname> <addr>
025bb325 410 or maintenance translate-address <addr>. */
c906108c
SS
411
412static void
5fed81ff 413maintenance_translate_address (const char *arg, int from_tty)
c906108c
SS
414{
415 CORE_ADDR address;
714835d5 416 struct obj_section *sect;
5fed81ff 417 const char *p;
7cbd4a93 418 struct bound_minimal_symbol sym;
c906108c
SS
419
420 if (arg == NULL || *arg == 0)
8a3fe4f8 421 error (_("requires argument (address or section + address)"));
c906108c
SS
422
423 sect = NULL;
424 p = arg;
425
426 if (!isdigit (*p))
025bb325
MS
427 { /* See if we have a valid section name. */
428 while (*p && !isspace (*p)) /* Find end of section name. */
c906108c 429 p++;
025bb325 430 if (*p == '\000') /* End of command? */
65e65158 431 error (_("Need to specify section name and address"));
5fed81ff
TT
432
433 int arg_len = p - arg;
434 p = skip_spaces (p + 1);
c906108c 435
2030c079 436 for (objfile *objfile : current_program_space->objfiles ())
3b9d3ac2
TT
437 ALL_OBJFILE_OSECTIONS (objfile, sect)
438 {
439 if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0)
440 goto found;
441 }
c906108c 442
3b9d3ac2
TT
443 error (_("Unknown section %s."), arg);
444 found: ;
c906108c
SS
445 }
446
447 address = parse_and_eval_address (p);
448
449 if (sect)
450 sym = lookup_minimal_symbol_by_pc_section (address, sect);
451 else
452 sym = lookup_minimal_symbol_by_pc (address);
453
7cbd4a93 454 if (sym.minsym)
c14c28ba 455 {
efd66ac6 456 const char *symbol_name = MSYMBOL_PRINT_NAME (sym.minsym);
3e43a32a 457 const char *symbol_offset
77e371c0 458 = pulongest (address - BMSYMBOL_VALUE_ADDRESS (sym));
c14c28ba 459
efd66ac6 460 sect = MSYMBOL_OBJ_SECTION(sym.objfile, sym.minsym);
c14c28ba
PP
461 if (sect != NULL)
462 {
463 const char *section_name;
464 const char *obj_name;
465
466 gdb_assert (sect->the_bfd_section && sect->the_bfd_section->name);
467 section_name = sect->the_bfd_section->name;
468
4262abfb
JK
469 gdb_assert (sect->objfile && objfile_name (sect->objfile));
470 obj_name = objfile_name (sect->objfile);
c14c28ba
PP
471
472 if (MULTI_OBJFILE_P ())
473 printf_filtered (_("%s + %s in section %s of %s\n"),
3e43a32a
MS
474 symbol_name, symbol_offset,
475 section_name, obj_name);
c14c28ba
PP
476 else
477 printf_filtered (_("%s + %s in section %s\n"),
478 symbol_name, symbol_offset, section_name);
479 }
480 else
481 printf_filtered (_("%s + %s\n"), symbol_name, symbol_offset);
482 }
c906108c 483 else if (sect)
5af949e3
UW
484 printf_filtered (_("no symbol at %s:%s\n"),
485 sect->the_bfd_section->name, hex_string (address));
c906108c 486 else
5af949e3 487 printf_filtered (_("no symbol at %s\n"), hex_string (address));
c906108c
SS
488
489 return;
490}
491
56382845 492
c114dcd5 493/* When a command is deprecated the user will be warned the first time
33f91161 494 the command is used. If possible, a replacement will be
025bb325 495 offered. */
56382845
FN
496
497static void
58971144 498maintenance_deprecate (const char *args, int from_tty)
56382845
FN
499{
500 if (args == NULL || *args == '\0')
501 {
cce7e648
PA
502 printf_unfiltered (_("\"maintenance deprecate\" takes an argument,\n\
503the command you want to deprecate, and optionally the replacement command\n\
a3f17187 504enclosed in quotes.\n"));
56382845 505 }
33f91161 506
56382845 507 maintenance_do_deprecate (args, 1);
56382845
FN
508}
509
510
511static void
58971144 512maintenance_undeprecate (const char *args, int from_tty)
56382845
FN
513{
514 if (args == NULL || *args == '\0')
515 {
a3f17187
AC
516 printf_unfiltered (_("\"maintenance undeprecate\" takes an argument, \n\
517the command you want to undeprecate.\n"));
56382845 518 }
33f91161 519
56382845 520 maintenance_do_deprecate (args, 0);
56382845
FN
521}
522
025bb325 523/* You really shouldn't be using this. It is just for the testsuite.
33f91161
AC
524 Rather, you should use deprecate_cmd() when the command is created
525 in _initialize_blah().
526
527 This function deprecates a command and optionally assigns it a
528 replacement. */
529
8399535b 530static void
58971144 531maintenance_do_deprecate (const char *text, int deprecate)
33f91161 532{
33f91161
AC
533 struct cmd_list_element *alias = NULL;
534 struct cmd_list_element *prefix_cmd = NULL;
535 struct cmd_list_element *cmd = NULL;
536
58971144
TT
537 const char *start_ptr = NULL;
538 const char *end_ptr = NULL;
56382845 539 int len;
33f91161
AC
540 char *replacement = NULL;
541
1c689132
DB
542 if (text == NULL)
543 return;
56382845 544
33f91161
AC
545 if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
546 {
a3f17187 547 printf_filtered (_("Can't find command '%s' to deprecate.\n"), text);
33f91161
AC
548 return;
549 }
56382845 550
56382845
FN
551 if (deprecate)
552 {
025bb325 553 /* Look for a replacement command. */
80ce1ecb
AC
554 start_ptr = strchr (text, '\"');
555 if (start_ptr != NULL)
33f91161
AC
556 {
557 start_ptr++;
80ce1ecb
AC
558 end_ptr = strrchr (start_ptr, '\"');
559 if (end_ptr != NULL)
33f91161
AC
560 {
561 len = end_ptr - start_ptr;
58971144 562 replacement = savestring (start_ptr, len);
33f91161
AC
563 }
564 }
56382845 565 }
33f91161 566
56382845
FN
567 if (!start_ptr || !end_ptr)
568 replacement = NULL;
33f91161
AC
569
570
56382845 571 /* If they used an alias, we only want to deprecate the alias.
33f91161 572
56382845
FN
573 Note the MALLOCED_REPLACEMENT test. If the command's replacement
574 string was allocated at compile time we don't want to free the
025bb325 575 memory. */
56382845
FN
576 if (alias)
577 {
1f2bdf09 578 if (alias->malloced_replacement)
429e55ea 579 xfree ((char *) alias->replacement);
33f91161 580
56382845 581 if (deprecate)
1f2bdf09
TT
582 {
583 alias->deprecated_warn_user = 1;
584 alias->cmd_deprecated = 1;
585 }
56382845 586 else
1f2bdf09
TT
587 {
588 alias->deprecated_warn_user = 0;
589 alias->cmd_deprecated = 0;
590 }
33f91161 591 alias->replacement = replacement;
1f2bdf09 592 alias->malloced_replacement = 1;
56382845
FN
593 return;
594 }
595 else if (cmd)
596 {
1f2bdf09 597 if (cmd->malloced_replacement)
429e55ea 598 xfree ((char *) cmd->replacement);
56382845
FN
599
600 if (deprecate)
1f2bdf09
TT
601 {
602 cmd->deprecated_warn_user = 1;
603 cmd->cmd_deprecated = 1;
604 }
56382845 605 else
1f2bdf09
TT
606 {
607 cmd->deprecated_warn_user = 0;
608 cmd->cmd_deprecated = 0;
609 }
33f91161 610 cmd->replacement = replacement;
1f2bdf09 611 cmd->malloced_replacement = 1;
56382845
FN
612 return;
613 }
240f9570 614 xfree (replacement);
56382845
FN
615}
616
4f337972
AC
617/* Maintenance set/show framework. */
618
ae038cb0
DJ
619struct cmd_list_element *maintenance_set_cmdlist;
620struct cmd_list_element *maintenance_show_cmdlist;
4f337972
AC
621
622static void
981a3fb3 623maintenance_set_cmd (const char *args, int from_tty)
4f337972 624{
3e43a32a
MS
625 printf_unfiltered (_("\"maintenance set\" must be followed "
626 "by the name of a set command.\n"));
635c7e8a
TT
627 help_list (maintenance_set_cmdlist, "maintenance set ", all_commands,
628 gdb_stdout);
4f337972
AC
629}
630
631static void
981a3fb3 632maintenance_show_cmd (const char *args, int from_tty)
4f337972
AC
633{
634 cmd_show_list (maintenance_show_cmdlist, from_tty, "");
635}
636
4f337972
AC
637/* Profiling support. */
638
639static int maintenance_profile_p;
920d2a44
AC
640static void
641show_maintenance_profile_p (struct ui_file *file, int from_tty,
642 struct cmd_list_element *c, const char *value)
643{
644 fprintf_filtered (file, _("Internal profiling is %s.\n"), value);
645}
d9feb4e7 646
b0b1c2c0
MK
647#ifdef HAVE__ETEXT
648extern char _etext;
649#define TEXTEND &_etext
01fe12f6 650#elif defined (HAVE_ETEXT)
b0b1c2c0
MK
651extern char etext;
652#define TEXTEND &etext
653#endif
654
01fe12f6
JB
655#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP) && defined (TEXTEND)
656
d28f9cdf
DJ
657static int profiling_state;
658
56000a98
PA
659EXTERN_C void _mcleanup (void);
660
d28f9cdf
DJ
661static void
662mcleanup_wrapper (void)
663{
d28f9cdf
DJ
664 if (profiling_state)
665 _mcleanup ();
666}
4f337972 667
56000a98
PA
668EXTERN_C void monstartup (unsigned long, unsigned long);
669extern int main ();
670
4f337972 671static void
eb4c3f4a 672maintenance_set_profile_cmd (const char *args, int from_tty,
3e43a32a 673 struct cmd_list_element *c)
4f337972 674{
d28f9cdf
DJ
675 if (maintenance_profile_p == profiling_state)
676 return;
677
678 profiling_state = maintenance_profile_p;
679
680 if (maintenance_profile_p)
681 {
682 static int profiling_initialized;
683
d28f9cdf
DJ
684 if (!profiling_initialized)
685 {
686 atexit (mcleanup_wrapper);
687 profiling_initialized = 1;
688 }
689
690 /* "main" is now always the first function in the text segment, so use
691 its address for monstartup. */
b0b1c2c0 692 monstartup ((unsigned long) &main, (unsigned long) TEXTEND);
d28f9cdf
DJ
693 }
694 else
695 {
696 extern void _mcleanup (void);
b8d56208 697
d28f9cdf
DJ
698 _mcleanup ();
699 }
4f337972 700}
d9feb4e7
DJ
701#else
702static void
eb4c3f4a 703maintenance_set_profile_cmd (const char *args, int from_tty,
3e43a32a 704 struct cmd_list_element *c)
d9feb4e7 705{
8a3fe4f8 706 error (_("Profiling support is not available on this system."));
d9feb4e7
DJ
707}
708#endif
bd712aed
DE
709\f
710/* If nonzero, display time usage both at startup and for each command. */
56382845 711
bd712aed
DE
712static int per_command_time;
713
714/* If nonzero, display space usage both at startup and for each command. */
715
716static int per_command_space;
717
718/* If nonzero, display basic symtab stats for each command. */
719
720static int per_command_symtab;
721
722/* mt per-command commands. */
723
724static struct cmd_list_element *per_command_setlist;
725static struct cmd_list_element *per_command_showlist;
726
bd712aed
DE
727/* Set whether to display time statistics to NEW_VALUE
728 (non-zero means true). */
729
730void
731set_per_command_time (int new_value)
732{
733 per_command_time = new_value;
734}
735
736/* Set whether to display space statistics to NEW_VALUE
737 (non-zero means true). */
738
739void
740set_per_command_space (int new_value)
741{
742 per_command_space = new_value;
743}
744
745/* Count the number of symtabs and blocks. */
746
747static void
43f3e411 748count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr,
bd712aed
DE
749 int *nr_blocks_ptr)
750{
bd712aed 751 int nr_symtabs = 0;
43f3e411 752 int nr_compunit_symtabs = 0;
bd712aed
DE
753 int nr_blocks = 0;
754
b8b8facf
DE
755 /* When collecting statistics during startup, this is called before
756 pretty much anything in gdb has been initialized, and thus
757 current_program_space may be NULL. */
758 if (current_program_space != NULL)
bd712aed 759 {
2030c079 760 for (objfile *o : current_program_space->objfiles ())
bd712aed 761 {
b669c953 762 for (compunit_symtab *cu : o->compunits ())
d8aeb77f
TT
763 {
764 ++nr_compunit_symtabs;
765 nr_blocks += BLOCKVECTOR_NBLOCKS (COMPUNIT_BLOCKVECTOR (cu));
5accd1a0
TT
766 nr_symtabs += std::distance (compunit_filetabs (cu).begin (),
767 compunit_filetabs (cu).end ());
d8aeb77f 768 }
bd712aed
DE
769 }
770 }
771
772 *nr_symtabs_ptr = nr_symtabs;
43f3e411 773 *nr_compunit_symtabs_ptr = nr_compunit_symtabs;
bd712aed
DE
774 *nr_blocks_ptr = nr_blocks;
775}
776
1e3b796d
TT
777/* As indicated by display_time and display_space, report GDB's
778 elapsed time and space usage from the base time and space recorded
779 in this object. */
bd712aed 780
1e3b796d 781scoped_command_stats::~scoped_command_stats ()
bd712aed 782{
1e3b796d
TT
783 /* Early exit if we're not reporting any stats. It can be expensive to
784 compute the pre-command values so don't collect them at all if we're
785 not reporting stats. Alas this doesn't work in the startup case because
786 we don't know yet whether we will be reporting the stats. For the
787 startup case collect the data anyway (it should be cheap at this point),
788 and leave it to the reporter to decide whether to print them. */
789 if (m_msg_type
790 && !per_command_time
791 && !per_command_space
792 && !per_command_symtab)
793 return;
bd712aed 794
1e3b796d 795 if (m_time_enabled && per_command_time)
bd712aed 796 {
3847a7bf
TT
797 print_time (_("command finished"));
798
dcb07cfa 799 using namespace std::chrono;
bd712aed 800
dcb07cfa
PA
801 run_time_clock::duration cmd_time
802 = run_time_clock::now () - m_start_cpu_time;
bd712aed 803
dcb07cfa
PA
804 steady_clock::duration wall_time
805 = steady_clock::now () - m_start_wall_time;
bd712aed 806 /* Subtract time spend in prompt_for_continue from walltime. */
dcb07cfa 807 wall_time -= get_prompt_for_continue_wait_time ();
bd712aed 808
1e3b796d 809 printf_unfiltered (!m_msg_type
dcb07cfa
PA
810 ? _("Startup time: %.6f (cpu), %.6f (wall)\n")
811 : _("Command execution time: %.6f (cpu), %.6f (wall)\n"),
812 duration<double> (cmd_time).count (),
813 duration<double> (wall_time).count ());
bd712aed
DE
814 }
815
1e3b796d 816 if (m_space_enabled && per_command_space)
bd712aed 817 {
6242c6a6 818#ifdef HAVE_USEFUL_SBRK
bd712aed
DE
819 char *lim = (char *) sbrk (0);
820
821 long space_now = lim - lim_at_start;
1e3b796d 822 long space_diff = space_now - m_start_space;
bd712aed 823
1e3b796d 824 printf_unfiltered (!m_msg_type
bd712aed
DE
825 ? _("Space used: %ld (%s%ld during startup)\n")
826 : _("Space used: %ld (%s%ld for this command)\n"),
827 space_now,
828 (space_diff >= 0 ? "+" : ""),
829 space_diff);
830#endif
831 }
832
1e3b796d 833 if (m_symtab_enabled && per_command_symtab)
bd712aed 834 {
43f3e411 835 int nr_symtabs, nr_compunit_symtabs, nr_blocks;
bd712aed 836
43f3e411 837 count_symtabs_and_blocks (&nr_symtabs, &nr_compunit_symtabs, &nr_blocks);
bd712aed 838 printf_unfiltered (_("#symtabs: %d (+%d),"
43f3e411 839 " #compunits: %d (+%d),"
bd712aed
DE
840 " #blocks: %d (+%d)\n"),
841 nr_symtabs,
1e3b796d 842 nr_symtabs - m_start_nr_symtabs,
43f3e411
DE
843 nr_compunit_symtabs,
844 (nr_compunit_symtabs
1e3b796d 845 - m_start_nr_compunit_symtabs),
bd712aed 846 nr_blocks,
1e3b796d 847 nr_blocks - m_start_nr_blocks);
bd712aed
DE
848 }
849}
850
1e3b796d
TT
851scoped_command_stats::scoped_command_stats (bool msg_type)
852: m_msg_type (msg_type)
bd712aed 853{
1e3b796d 854 if (!m_msg_type || per_command_space)
bd712aed 855 {
6242c6a6 856#ifdef HAVE_USEFUL_SBRK
bd712aed 857 char *lim = (char *) sbrk (0);
1e3b796d
TT
858 m_start_space = lim - lim_at_start;
859 m_space_enabled = 1;
bd712aed
DE
860#endif
861 }
44d83468
PA
862 else
863 m_space_enabled = 0;
bd712aed 864
b8b8facf 865 if (msg_type == 0 || per_command_time)
bd712aed 866 {
dcb07cfa
PA
867 using namespace std::chrono;
868
869 m_start_cpu_time = run_time_clock::now ();
870 m_start_wall_time = steady_clock::now ();
1e3b796d 871 m_time_enabled = 1;
3847a7bf
TT
872
873 if (per_command_time)
874 print_time (_("command started"));
bd712aed 875 }
44d83468
PA
876 else
877 m_time_enabled = 0;
bd712aed 878
b8b8facf 879 if (msg_type == 0 || per_command_symtab)
bd712aed 880 {
43f3e411 881 int nr_symtabs, nr_compunit_symtabs, nr_blocks;
bd712aed 882
43f3e411 883 count_symtabs_and_blocks (&nr_symtabs, &nr_compunit_symtabs, &nr_blocks);
1e3b796d
TT
884 m_start_nr_symtabs = nr_symtabs;
885 m_start_nr_compunit_symtabs = nr_compunit_symtabs;
886 m_start_nr_blocks = nr_blocks;
887 m_symtab_enabled = 1;
bd712aed 888 }
44d83468
PA
889 else
890 m_symtab_enabled = 0;
bd712aed 891
26c4b26f 892 /* Initialize timer to keep track of how long we waited for the user. */
bd712aed 893 reset_prompt_for_continue_wait_time ();
bd712aed
DE
894}
895
3847a7bf
TT
896/* See maint.h. */
897
898void
899scoped_command_stats::print_time (const char *msg)
900{
901 using namespace std::chrono;
902
903 auto now = system_clock::now ();
904 auto ticks = now.time_since_epoch ().count () / (1000 * 1000);
905 auto millis = ticks % 1000;
906
907 std::time_t as_time = system_clock::to_time_t (now);
908 struct tm *tm = localtime (&as_time);
909
910 char out[100];
911 strftime (out, sizeof (out), "%F %H:%M:%S", tm);
912
913 printf_unfiltered ("%s.%03d - %s\n", out, (int) millis, msg);
914}
915
bd712aed
DE
916/* Handle unknown "mt set per-command" arguments.
917 In this case have "mt set per-command on|off" affect every setting. */
918
919static void
981a3fb3 920set_per_command_cmd (const char *args, int from_tty)
bd712aed
DE
921{
922 struct cmd_list_element *list;
bd712aed
DE
923 int val;
924
925 val = parse_cli_boolean_value (args);
926 if (val < 0)
927 error (_("Bad value for 'mt set per-command no'."));
928
929 for (list = per_command_setlist; list != NULL; list = list->next)
930 if (list->var_type == var_boolean)
931 {
932 gdb_assert (list->type == set_cmd);
933 do_set_command (args, from_tty, list);
934 }
935}
936
937/* Command "show per-command" displays summary of all the current
938 "show per-command " settings. */
939
940static void
981a3fb3 941show_per_command_cmd (const char *args, int from_tty)
bd712aed
DE
942{
943 cmd_show_list (per_command_showlist, from_tty, "");
944}
dcd1f979
TT
945\f
946
947/* The "maintenance selftest" command. */
948
949static void
58971144 950maintenance_selftest (const char *args, int from_tty)
dcd1f979 951{
1e5ded6c 952#if GDB_SELF_TEST
1526853e 953 selftests::run_tests (args);
1e5ded6c
YQ
954#else
955 printf_filtered (_("\
8ecfd7bd 956Selftests have been disabled for this build.\n"));
1e5ded6c 957#endif
1526853e
SM
958}
959
960static void
5fed81ff 961maintenance_info_selftests (const char *arg, int from_tty)
1526853e 962{
1e5ded6c 963#if GDB_SELF_TEST
1526853e
SM
964 printf_filtered ("Registered selftests:\n");
965 selftests::for_each_selftest ([] (const std::string &name) {
966 printf_filtered (" - %s\n", name.c_str ());
967 });
1e5ded6c
YQ
968#else
969 printf_filtered (_("\
8ecfd7bd 970Selftests have been disabled for this build.\n"));
1e5ded6c 971#endif
dcd1f979
TT
972}
973
bd712aed 974\f
c906108c 975void
fba45db2 976_initialize_maint_cmds (void)
c906108c 977{
439250fb
DE
978 struct cmd_list_element *cmd;
979
1bedd215
AC
980 add_prefix_cmd ("maintenance", class_maintenance, maintenance_command, _("\
981Commands for use by GDB maintainers.\n\
c906108c 982Includes commands to dump specific internal GDB structures in\n\
439250fb 983a human readable form, to cause GDB to deliberately dump core, etc."),
c906108c
SS
984 &maintenancelist, "maintenance ", 0,
985 &cmdlist);
986
987 add_com_alias ("mt", "maintenance", class_maintenance, 1);
988
1bedd215
AC
989 add_prefix_cmd ("info", class_maintenance, maintenance_info_command, _("\
990Commands for showing internal info about the program being debugged."),
c906108c
SS
991 &maintenanceinfolist, "maintenance info ", 0,
992 &maintenancelist);
90515c23 993 add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
c906108c 994
1a966eab
AC
995 add_cmd ("sections", class_maintenance, maintenance_info_sections, _("\
996List the BFD sections of the exec and core files. \n\
e3d3bfda
MS
997Arguments may be any combination of:\n\
998 [one or more section names]\n\
999 ALLOC LOAD RELOC READONLY CODE DATA ROM CONSTRUCTOR\n\
1000 HAS_CONTENTS NEVER_LOAD COFF_SHARED_LIBRARY IS_COMMON\n\
1001Sections matching any argument will be listed (no argument\n\
1002implies all sections). In addition, the special argument\n\
1003 ALLOBJ\n\
1a966eab 1004lists all sections from all object files, including shared libraries."),
c906108c
SS
1005 &maintenanceinfolist);
1006
1007 add_prefix_cmd ("print", class_maintenance, maintenance_print_command,
1bedd215 1008 _("Maintenance command for printing GDB internal state."),
c906108c
SS
1009 &maintenanceprintlist, "maintenance print ", 0,
1010 &maintenancelist);
1011
1bedd215 1012 add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, _("\
4f337972 1013Set GDB internal variables used by the GDB maintainer.\n\
1bedd215 1014Configure variables internal to GDB that aid in GDB's maintenance"),
4f337972
AC
1015 &maintenance_set_cmdlist, "maintenance set ",
1016 0/*allow-unknown*/,
1017 &maintenancelist);
1018
1bedd215 1019 add_prefix_cmd ("show", class_maintenance, maintenance_show_cmd, _("\
4f337972 1020Show GDB internal variables used by the GDB maintainer.\n\
1bedd215 1021Configure variables internal to GDB that aid in GDB's maintenance"),
4f337972
AC
1022 &maintenance_show_cmdlist, "maintenance show ",
1023 0/*allow-unknown*/,
1024 &maintenancelist);
1025
c906108c 1026#ifndef _WIN32
1a966eab
AC
1027 add_cmd ("dump-me", class_maintenance, maintenance_dump_me, _("\
1028Get fatal error; make debugger dump its core.\n\
8308e54c 1029GDB sets its handling of SIGQUIT back to SIG_DFL and then sends\n\
1a966eab 1030itself a SIGQUIT signal."),
c906108c
SS
1031 &maintenancelist);
1032#endif
1033
1a966eab
AC
1034 add_cmd ("internal-error", class_maintenance,
1035 maintenance_internal_error, _("\
1036Give GDB an internal error.\n\
1037Cause GDB to behave as if an internal error was detected."),
7be570e7
JM
1038 &maintenancelist);
1039
1a966eab
AC
1040 add_cmd ("internal-warning", class_maintenance,
1041 maintenance_internal_warning, _("\
1042Give GDB an internal warning.\n\
1043Cause GDB to behave as if an internal warning was reported."),
dec43320
AC
1044 &maintenancelist);
1045
57fcfb1b
GB
1046 add_cmd ("demangler-warning", class_maintenance,
1047 maintenance_demangler_warning, _("\
1048Give GDB a demangler warning.\n\
1049Cause GDB to behave as if a demangler warning was reported."),
1050 &maintenancelist);
1051
439250fb
DE
1052 cmd = add_cmd ("demangle", class_maintenance, maintenance_demangle, _("\
1053This command has been moved to \"demangle\"."),
1054 &maintenancelist);
1055 deprecate_cmd (cmd, "demangle");
c906108c 1056
bd712aed
DE
1057 add_prefix_cmd ("per-command", class_maintenance, set_per_command_cmd, _("\
1058Per-command statistics settings."),
387cd15b 1059 &per_command_setlist, "maintenance set per-command ",
bd712aed
DE
1060 1/*allow-unknown*/, &maintenance_set_cmdlist);
1061
1062 add_prefix_cmd ("per-command", class_maintenance, show_per_command_cmd, _("\
1063Show per-command statistics settings."),
387cd15b 1064 &per_command_showlist, "maintenance show per-command ",
bd712aed
DE
1065 0/*allow-unknown*/, &maintenance_show_cmdlist);
1066
1067 add_setshow_boolean_cmd ("time", class_maintenance,
1068 &per_command_time, _("\
1069Set whether to display per-command execution time."), _("\
1070Show whether to display per-command execution time."),
1071 _("\
1072If enabled, the execution time for each command will be\n\
1073displayed following the command's output."),
1074 NULL, NULL,
1075 &per_command_setlist, &per_command_showlist);
1076
1077 add_setshow_boolean_cmd ("space", class_maintenance,
1078 &per_command_space, _("\
1079Set whether to display per-command space usage."), _("\
1080Show whether to display per-command space usage."),
1081 _("\
1082If enabled, the space usage for each command will be\n\
1083displayed following the command's output."),
1084 NULL, NULL,
1085 &per_command_setlist, &per_command_showlist);
1086
1087 add_setshow_boolean_cmd ("symtab", class_maintenance,
1088 &per_command_symtab, _("\
1089Set whether to display per-command symtab statistics."), _("\
1090Show whether to display per-command symtab statistics."),
1091 _("\
1092If enabled, the basic symtab statistics for each command will be\n\
1093displayed following the command's output."),
1094 NULL, NULL,
1095 &per_command_setlist, &per_command_showlist);
1096
1097 /* This is equivalent to "mt set per-command time on".
1098 Kept because some people are used to typing "mt time 1". */
1a966eab
AC
1099 add_cmd ("time", class_maintenance, maintenance_time_display, _("\
1100Set the display of time usage.\n\
c906108c 1101If nonzero, will cause the execution time for each command to be\n\
1a966eab 1102displayed, following the command's output."),
c906108c
SS
1103 &maintenancelist);
1104
bd712aed
DE
1105 /* This is equivalent to "mt set per-command space on".
1106 Kept because some people are used to typing "mt space 1". */
1a966eab
AC
1107 add_cmd ("space", class_maintenance, maintenance_space_display, _("\
1108Set the display of space usage.\n\
c906108c 1109If nonzero, will cause the execution space for each command to be\n\
1a966eab 1110displayed, following the command's output."),
c906108c
SS
1111 &maintenancelist);
1112
1a966eab
AC
1113 add_cmd ("type", class_maintenance, maintenance_print_type, _("\
1114Print a type chain for a given symbol.\n\
c906108c 1115For each node in a type chain, print the raw data for each member of\n\
1a966eab 1116the type structure, and the interpretation of the data."),
c906108c
SS
1117 &maintenanceprintlist);
1118
c906108c 1119 add_cmd ("statistics", class_maintenance, maintenance_print_statistics,
1a966eab 1120 _("Print statistics about internal gdb state."),
c906108c
SS
1121 &maintenanceprintlist);
1122
1a966eab
AC
1123 add_cmd ("architecture", class_maintenance,
1124 maintenance_print_architecture, _("\
1125Print the internal architecture configuration.\n\
1126Takes an optional file parameter."),
4b9b3959
AC
1127 &maintenanceprintlist);
1128
27d41eac
YQ
1129 add_prefix_cmd ("check", class_maintenance, maintenance_check_command, _("\
1130Commands for checking internal gdb state."),
1131 &maintenancechecklist, "maintenance check ", 0,
1132 &maintenancelist);
1133
3e43a32a
MS
1134 add_cmd ("translate-address", class_maintenance,
1135 maintenance_translate_address,
1a966eab 1136 _("Translate a section name and address to a symbol."),
c906108c
SS
1137 &maintenancelist);
1138
1a966eab
AC
1139 add_cmd ("deprecate", class_maintenance, maintenance_deprecate, _("\
1140Deprecate a command. Note that this is just in here so the \n\
ef4cb050 1141testsuite can check the command deprecator. You probably shouldn't use this,\n\
56382845 1142rather you should use the C function deprecate_cmd(). If you decide you \n\
6f122dc9 1143want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\
1a966eab 1144replacement is optional."), &maintenancelist);
56382845 1145
1a966eab
AC
1146 add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate, _("\
1147Undeprecate a command. Note that this is just in here so the \n\
ef4cb050 1148testsuite can check the command deprecator. You probably shouldn't use this,\n\
1a966eab 1149If you decide you want to use it: maintenance undeprecate 'commandname'"),
33f91161 1150 &maintenancelist);
56382845 1151
dcd1f979
TT
1152 add_cmd ("selftest", class_maintenance, maintenance_selftest, _("\
1153Run gdb's unit tests.\n\
1526853e 1154Usage: maintenance selftest [filter]\n\
dcd1f979 1155This will run any unit tests that were built in to gdb.\n\
1526853e 1156If a filter is given, only the tests with that value in their name will ran."),
dcd1f979
TT
1157 &maintenancelist);
1158
1526853e
SM
1159 add_cmd ("selftests", class_maintenance, maintenance_info_selftests,
1160 _("List the registered selftests."), &maintenanceinfolist);
1161
d28f9cdf 1162 add_setshow_boolean_cmd ("profile", class_maintenance,
7915a72c
AC
1163 &maintenance_profile_p, _("\
1164Set internal profiling."), _("\
1165Show internal profiling."), _("\
1166When enabled GDB is profiled."),
2c5b56ce 1167 maintenance_set_profile_cmd,
920d2a44 1168 show_maintenance_profile_p,
d28f9cdf
DJ
1169 &maintenance_set_cmdlist,
1170 &maintenance_show_cmdlist);
c906108c 1171}