GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/maint.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include <ctype.h>`
`#include <signal.h>`
`#include "command.h"`
`#include "gdbcmd.h"`
`#include "symtab.h"`
`#include "block.h"`
`#include "gdbtypes.h"`
`#include "demangle.h"`
`#include "gdbcore.h"`
`#include "expression.h"`
`#include "language.h"`
`#include "symfile.h"`
`#include "objfiles.h"`
`#include "value.h"`
`#include "top.h"`
`#include "maint.h"`
`#include "selftest.h"`
`#include "cli/cli-decode.h"`
`#include "cli/cli-utils.h"`
`#include "cli/cli-setshow.h"`

Go to the source code of this file.

## Macros
#define | TEXTEND &_etext

## Functions
static void | maintenance_do_deprecate (const char *, int)
static void | show_watchdog (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | maintenance_command (const char *args, int from_tty)
static void | maintenance_dump_me (const char *args, int from_tty)
static void | maintenance_internal_error (const char *args, int from_tty)
static void | maintenance_internal_warning (const char *args, int from_tty)
static void | maintenance_demangler_warning (const char *args, int from_tty)
static void | maintenance_demangle (const char *args, int from_tty)
static void | maintenance_time_display (const char *args, int from_tty)
static void | maintenance_space_display (const char *args, int from_tty)
static void | maintenance_info_command (const char *arg, int from_tty)
static void | maintenance_check_command (const char *arg, int from_tty)
static int | match_substring (const char *string, const char *substr)
static int | match_bfd_flags (const char *string, flagword flags)
static void | print_bfd_flags (flagword flags)
static void | maint_print_section_info (const char *name, flagword flags, CORE_ADDR addr, CORE_ADDR endaddr, unsigned long filepos, int addr_size)
static void | print_bfd_section_info (bfd *abfd, asection *asect, void *datum)
static void | print_objfile_section_info (bfd *abfd, struct obj_section *asect, const char *string)
static void | maintenance_info_sections (const char *arg, int from_tty)
static void | maintenance_print_statistics (const char *args, int from_tty)
static void | maintenance_print_architecture (const char *args, int from_tty)
static void | maintenance_print_command (const char *arg, int from_tty)
static void | maintenance_translate_address (const char *arg, int from_tty)
static void | maintenance_deprecate (const char *args, int from_tty)
static void | maintenance_undeprecate (const char *args, int from_tty)
static void | maintenance_set_cmd (const char *args, int from_tty)
static void | maintenance_show_cmd (const char *args, int from_tty)
static void | show_maintenance_profile_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
EXTERN_C void | _mcleanup (void)
static void | mcleanup_wrapper (void)
EXTERN_C void | monstartup (unsigned long, unsigned long)
int | main ()
static void | maintenance_set_profile_cmd (const char *args, int from_tty, struct cmd_list_element *c)
void | set_per_command_time (int new_value)
void | set_per_command_space (int new_value)
static void | count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr, int *nr_blocks_ptr)
static void | set_per_command_cmd (const char *args, int from_tty)
static void | show_per_command_cmd (const char *args, int from_tty)
static void | maintenance_selftest (const char *args, int from_tty)
static void | maintenance_info_selftests (const char *arg, int from_tty)
void | _initialize_maint_cmds (void)

## Variables
int | watchdog = 0
struct cmd_list_element * | maintenance_set_cmdlist
struct cmd_list_element * | maintenance_show_cmdlist
static int | maintenance_profile_p
char | _etext
static int | profiling_state
static int | per_command_time
static int | per_command_space
static int | per_command_symtab
static struct cmd_list_element * | per_command_setlist
static struct cmd_list_element * | per_command_showlist

## Macro Definition Documentation

## ◆ TEXTEND

#define TEXTEND &_etext

Definition at line 664 of file maint.c.

Referenced by maintenance_set_profile_cmd().

## Function Documentation

## ◆ _initialize_maint_cmds()

void _initialize_maint_cmds | ( | void |  | ) |

Definition at line 966 of file maint.c.

References _, add_alias_cmd(), add_cmd(), add_com_alias(), add_prefix_cmd(), add_setshow_boolean_cmd(), add_setshow_zinteger_cmd(), class_maintenance, cmdlist, deprecate_cmd(), maintenance_check_command(), maintenance_command(), maintenance_demangle(), maintenance_demangler_warning(), maintenance_deprecate(), maintenance_dump_me(), maintenance_info_command(), maintenance_info_sections(), maintenance_info_selftests(), maintenance_internal_error(), maintenance_internal_warning(), maintenance_print_architecture(), maintenance_print_command(), maintenance_print_statistics(), maintenance_print_type(), maintenance_profile_p, maintenance_selftest(), maintenance_set_cmd(), maintenance_set_cmdlist, maintenance_set_profile_cmd(), maintenance_show_cmd(), maintenance_show_cmdlist, maintenance_space_display(), maintenance_time_display(), maintenance_translate_address(), maintenance_undeprecate(), maintenancechecklist, maintenanceinfolist, maintenancelist, maintenanceprintlist, per_command_setlist, per_command_showlist, per_command_space, per_command_symtab, per_command_time, set_per_command_cmd(), setlist, show_maintenance_profile_p(), show_per_command_cmd(), show_watchdog(), showlist, and watchdog.

## ◆ _mcleanup()

EXTERN_C void _mcleanup | ( | void |  | ) |

Referenced by maintenance_set_profile_cmd(), and mcleanup_wrapper().

## ◆ count_symtabs_and_blocks()

static void count_symtabs_and_blocks | ( | int * | nr_symtabs_ptr,
|  | int * | nr_compunit_symtabs_ptr,
|  | int * | nr_blocks_ptr
| ) |  |
| static

Definition at line 763 of file maint.c.

References ALL_COMPUNIT_FILETABS, ALL_COMPUNITS, BLOCKVECTOR_NBLOCKS, COMPUNIT_BLOCKVECTOR, and current_program_space.

Referenced by scoped_command_stats::scoped_command_stats(), and scoped_command_stats::~scoped_command_stats().

## ◆ main()

int main | ( |  | ) |

    The main subprogram.

Definition at line 156 of file exsummary.py.

References copyright::get_update_list(), exsummary::help_and_exit(), exsummary::main(), and exsummary::mark_functions().

Referenced by main(), and maintenance_set_profile_cmd().

## ◆ maint_print_section_info()

static void maint_print_section_info | ( | const char * | name,
|  | flagword | flags,
|  | CORE_ADDR | addr,
|  | CORE_ADDR | endaddr,
|  | unsigned long | filepos,
|  | int | addr_size
| ) |  |
| static

Definition at line 279 of file maint.c.

References flags, hex_string_custom(), name, print_bfd_flags(), and printf_filtered().

Referenced by print_bfd_section_info(), and print_objfile_section_info().

## ◆ maintenance_check_command()

static void maintenance_check_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 168 of file maint.c.

References _, all_commands, gdb_stdout, help_list(), maintenancechecklist, and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_command()

static void maintenance_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 66 of file maint.c.

References _, all_commands, gdb_stdout, help_list(), maintenancelist, and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_demangle()

static void maintenance_demangle | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 127 of file maint.c.

References _, and printf_filtered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_demangler_warning()

static void maintenance_demangler_warning | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 117 of file maint.c.

References demangler_warning().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_deprecate()

static void maintenance_deprecate | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 513 of file maint.c.

References _, maintenance_do_deprecate(), and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_do_deprecate()

static void maintenance_do_deprecate | ( | const char * | text,
|  | int | deprecate
| ) |  |
| static

Definition at line 546 of file maint.c.

References _, alias, cmd_list_element::cmd_deprecated, cmd_list_element::deprecated_warn_user, lookup_cmd_composition(), cmd_list_element::malloced_replacement, printf_filtered(), cmd_list_element::replacement, savestring(), and xfree().

Referenced by maintenance_deprecate(), and maintenance_undeprecate().

## ◆ maintenance_dump_me()

static void maintenance_dump_me | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 75 of file maint.c.

References _, and query().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_info_command()

static void maintenance_info_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 155 of file maint.c.

References _, all_commands, gdb_stdout, help_list(), maintenanceinfolist, and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_info_sections()

static void maintenance_info_sections | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 341 of file maint.c.

References _, ALL_OBJFILE_OSECTIONS, ALL_OBJFILES, core_bfd, exec_bfd, match_substring(), objfile::obfd, print_bfd_section_info(), print_objfile_section_info(), printf_filtered(), and wrap_here().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_info_selftests()

static void maintenance_info_selftests | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 951 of file maint.c.

References _, selftests::for_each_selftest(), name, printf_filtered(), and string.

Referenced by _initialize_maint_cmds().

## ◆ maintenance_internal_error()

static void maintenance_internal_error | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 97 of file maint.c.

References internal_error().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_internal_warning()

static void maintenance_internal_warning | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 108 of file maint.c.

References internal_warning().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_print_architecture()

static void maintenance_print_architecture | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 393 of file maint.c.

References _, gdb_stdout, gdbarch_dump(), get_current_arch(), stdio_file::open(), and perror_with_name().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_print_command()

static void maintenance_print_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 414 of file maint.c.

References _, all_commands, gdb_stdout, help_list(), maintenanceprintlist, and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_print_statistics()

static void maintenance_print_statistics | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 386 of file maint.c.

References print_objfile_statistics(), and print_symbol_bcache_statistics().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_selftest()

static void maintenance_selftest | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 940 of file maint.c.

References _, printf_filtered(), and selftests::run_tests().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_set_cmd()

static void maintenance_set_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 638 of file maint.c.

References _, all_commands, gdb_stdout, help_list(), maintenance_set_cmdlist, and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_set_profile_cmd()

static void maintenance_set_profile_cmd | ( | const char * | args,
|  | int | from_tty,
|  | struct cmd_list_element * | c
| ) |  |
| static

Definition at line 687 of file maint.c.

References _mcleanup(), main(), maintenance_profile_p, mcleanup_wrapper(), monstartup(), profiling_state, and TEXTEND.

Referenced by _initialize_maint_cmds().

## ◆ maintenance_show_cmd()

static void maintenance_show_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 647 of file maint.c.

References cmd_show_list(), and maintenance_show_cmdlist.

Referenced by _initialize_maint_cmds().

## ◆ maintenance_space_display()

static void maintenance_space_display | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 142 of file maint.c.

References printf_unfiltered(), and set_per_command_space().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_time_display()

static void maintenance_time_display | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 133 of file maint.c.

References _, printf_unfiltered(), and set_per_command_time().

Referenced by _initialize_maint_cmds().

## ◆ maintenance_translate_address()

static void maintenance_translate_address | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 428 of file maint.c.

References _, ALL_OBJSECTIONS, BMSYMBOL_VALUE_ADDRESS, error(), gdb_assert, hex_string(), lookup_minimal_symbol_by_pc(), lookup_minimal_symbol_by_pc_section(), bound_minimal_symbol::minsym, MSYMBOL_OBJ_SECTION, MSYMBOL_PRINT_NAME, MULTI_OBJFILE_P, bound_minimal_symbol::objfile, obj_section::objfile, objfile::objfile(), objfile_name(), parse_and_eval_address(), printf_filtered(), pulongest(), skip_spaces(), and obj_section::the_bfd_section.

Referenced by _initialize_maint_cmds().

## ◆ maintenance_undeprecate()

static void maintenance_undeprecate | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 527 of file maint.c.

References _, maintenance_do_deprecate(), and printf_unfiltered().

Referenced by _initialize_maint_cmds().

## ◆ match_bfd_flags()

static int match_bfd_flags | ( | const char * | string,
|  | flagword | flags
| ) |  |
| static

Definition at line 207 of file maint.c.

References flags, and match_substring().

Referenced by print_bfd_section_info(), and print_objfile_section_info().

## ◆ match_substring()

static int match_substring | ( | const char * | string,
|  | const char * | substr
| ) |  |
| static

Definition at line 179 of file maint.c.

Referenced by maintenance_info_sections(), match_bfd_flags(), print_bfd_section_info(), and print_objfile_section_info().

## ◆ mcleanup_wrapper()

static void mcleanup_wrapper | ( | void |  | ) |
| static

Definition at line 677 of file maint.c.

References _mcleanup(), and profiling_state.

Referenced by maintenance_set_profile_cmd().

## ◆ monstartup()

EXTERN_C void monstartup | ( | unsigned | long,
|  | unsigned | long
| ) |  |

Referenced by maintenance_set_profile_cmd().

## ◆ print_bfd_flags()

static void print_bfd_flags | ( | flagword | flags | ) |
| static

Definition at line 250 of file maint.c.

References flags, and printf_filtered().

Referenced by maint_print_section_info().

## ◆ print_bfd_section_info()

static void print_bfd_section_info | ( | bfd * | abfd,
|  | asection * | asect,
|  | void * | datum
| ) |  |
| static

Definition at line 293 of file maint.c.

References flags, gdb_bfd_section_index(), gdbarch_addr_bit(), gdbarch_from_bfd(), maint_print_section_info(), match_bfd_flags(), match_substring(), name, and printf_filtered().

Referenced by maintenance_info_sections().

## ◆ print_objfile_section_info()

static void print_objfile_section_info | ( | bfd * | abfd,
|  | struct obj_section * | asect,
|  | const char * | string
| ) |  |
| static

Definition at line 318 of file maint.c.

References flags, gdbarch_addr_bit(), gdbarch_from_bfd(), maint_print_section_info(), match_bfd_flags(), match_substring(), name, obj_section_addr, obj_section_endaddr, and obj_section::the_bfd_section.

Referenced by maintenance_info_sections().

## ◆ set_per_command_cmd()

static void set_per_command_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 910 of file maint.c.

References _, do_set_command(), error(), gdb_assert, cmd_list_element::next, parse_cli_boolean_value(), per_command_setlist, set_cmd, cmd_list_element::type, var_boolean, and cmd_list_element::var_type.

Referenced by _initialize_maint_cmds().

## ◆ set_per_command_space()

void set_per_command_space | ( | int | new_value | ) |

Definition at line 755 of file maint.c.

References per_command_space.

Referenced by captured_main_1(), and maintenance_space_display().

## ◆ set_per_command_time()

void set_per_command_time | ( | int | new_value | ) |

Definition at line 746 of file maint.c.

References per_command_time.

Referenced by captured_main_1(), and maintenance_time_display().

## ◆ show_maintenance_profile_p()

static void show_maintenance_profile_p | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 656 of file maint.c.

References _, and fprintf_filtered().

Referenced by _initialize_maint_cmds().

## ◆ show_per_command_cmd()

static void show_per_command_cmd | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 931 of file maint.c.

References cmd_show_list(), and per_command_showlist.

Referenced by _initialize_maint_cmds().

## ◆ show_watchdog()

static void show_watchdog | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 57 of file maint.c.

References _, and fprintf_filtered().

Referenced by _initialize_maint_cmds().

## Variable Documentation

## ◆ _etext

char _etext

## ◆ maintenance_profile_p

int maintenance_profile_p
| static

Definition at line 654 of file maint.c.

Referenced by _initialize_maint_cmds(), and maintenance_set_profile_cmd().

## ◆ maintenance_set_cmdlist

struct cmd_list_element* maintenance_set_cmdlist

Definition at line 634 of file maint.c.

Referenced by _initialize_ada_language(), _initialize_btrace(), _initialize_cp_support(), _initialize_dwarf2_read(), _initialize_gdb_bfd(), _initialize_maint_cmds(), _initialize_mips_linux_nat(), _initialize_s390_nat(), _initialize_symtab(), _initialize_windows_tdep(), add_internal_problem_command(), add_show_debug_regs_command(), initialize_targets(), and maintenance_set_cmd().

## ◆ maintenance_show_cmdlist

struct cmd_list_element* maintenance_show_cmdlist

Definition at line 635 of file maint.c.

Referenced by _initialize_ada_language(), _initialize_btrace(), _initialize_cp_support(), _initialize_dwarf2_read(), _initialize_gdb_bfd(), _initialize_maint_cmds(), _initialize_mips_linux_nat(), _initialize_s390_nat(), _initialize_symtab(), _initialize_windows_tdep(), add_internal_problem_command(), add_show_debug_regs_command(), initialize_targets(), and maintenance_show_cmd().

## ◆ per_command_setlist

struct cmd_list_element* per_command_setlist
| static

Definition at line 739 of file maint.c.

Referenced by _initialize_maint_cmds(), and set_per_command_cmd().

## ◆ per_command_showlist

struct cmd_list_element* per_command_showlist
| static

Definition at line 740 of file maint.c.

Referenced by _initialize_maint_cmds(), and show_per_command_cmd().

## ◆ per_command_space

int per_command_space
| static

Definition at line 731 of file maint.c.

Referenced by _initialize_maint_cmds(), scoped_command_stats::scoped_command_stats(), set_per_command_space(), and scoped_command_stats::~scoped_command_stats().

## ◆ per_command_symtab

int per_command_symtab
| static

Definition at line 735 of file maint.c.

Referenced by _initialize_maint_cmds(), scoped_command_stats::scoped_command_stats(), and scoped_command_stats::~scoped_command_stats().

## ◆ per_command_time

int per_command_time
| static

Definition at line 727 of file maint.c.

Referenced by _initialize_maint_cmds(), scoped_command_stats::scoped_command_stats(), set_per_command_time(), and scoped_command_stats::~scoped_command_stats().

## ◆ profiling_state

int profiling_state
| static

Definition at line 672 of file maint.c.

Referenced by maintenance_set_profile_cmd(), and mcleanup_wrapper().

## ◆ watchdog

int watchdog = 0

Definition at line 55 of file maint.c.

Referenced by _initialize_maint_cmds(), and getpkt_or_notif_sane_1().