24 #include "filenames.h" 39 #include "readline/readline.h" 74 "partial symbol cache");
76 "preprocessor macro cache");
89 int i, linetables, blockvectors;
113 i = linetables = blockvectors = 0;
133 ->objfile_obstack)));
265 warning (
_(
"internal error: minimal symbol count %d != %d"),
303 for (i = 0; i < len; i++)
317 for (i = 0; i < len; i++)
360 "Error printing symbol:\n");
369 const char *compunit_filename
373 "\nBlockvector same as owning compunit: %s\n\n",
404 char *address_arg = NULL, *source_arg = NULL, *objfile_arg = NULL;
411 for (i = 0;
argv != NULL &&
argv[i] != NULL; ++i)
413 if (strcmp (
argv[i],
"-pc") == 0)
415 if (
argv[i + 1] == NULL)
416 error (
_(
"Missing pc value"));
417 address_arg =
argv[++i];
419 else if (strcmp (
argv[i],
"-source") == 0)
421 if (
argv[i + 1] == NULL)
422 error (
_(
"Missing source file"));
423 source_arg =
argv[++i];
425 else if (strcmp (
argv[i],
"-objfile") == 0)
427 if (
argv[i + 1] == NULL)
428 error (
_(
"Missing objfile name"));
429 objfile_arg =
argv[++i];
431 else if (strcmp (
argv[i],
"--") == 0)
437 else if (
argv[i][0] ==
'-')
447 if (address_arg != NULL && source_arg != NULL)
448 error (
_(
"Must specify at most one of -pc and -source"));
452 if (
argv != NULL &&
argv[outfile_idx] != NULL)
454 if (
argv[outfile_idx + 1] != NULL)
455 error (
_(
"Junk at end of command"));
457 (tilde_expand (
argv[outfile_idx]));
458 if (!arg_outfile.
open (outfile_name.get (), FOPEN_WT))
460 outfile = &arg_outfile;
463 if (address_arg != NULL)
469 error (
_(
"No symtab for address: %s"), address_arg);
481 int print_for_objfile = 1;
483 if (objfile_arg != NULL)
487 if (!print_for_objfile)
492 int print_for_source = 0;
495 if (source_arg != NULL)
502 if (source_arg == NULL
508 if (source_arg != NULL && !found)
509 error (
_(
"No symtab for source file: %s"), source_arg);
554 ?
"struct" :
"union")),
693 char *objfile_arg = NULL;
701 for (i = 0;
argv != NULL &&
argv[i] != NULL; ++i)
703 if (strcmp (
argv[i],
"-objfile") == 0)
705 if (
argv[i + 1] == NULL)
706 error (
_(
"Missing objfile name"));
707 objfile_arg =
argv[++i];
709 else if (strcmp (
argv[i],
"--") == 0)
715 else if (
argv[i][0] ==
'-')
727 if (
argv != NULL &&
argv[outfile_idx] != NULL)
729 if (
argv[outfile_idx + 1] != NULL)
730 error (
_(
"Junk at end of command"));
732 (tilde_expand (
argv[outfile_idx]));
733 if (!arg_outfile.
open (outfile_name.get (), FOPEN_WT))
735 outfile = &arg_outfile;
741 if (objfile_arg == NULL
789 int printed_objfile_start = 0;
793 int printed_compunit_symtab_start = 0;
802 if (! printed_objfile_start)
808 printed_objfile_start = 1;
810 if (! printed_compunit_symtab_start)
825 " ((struct blockvector *) %s)\n",
828 printed_compunit_symtab_start = 1;
841 "linetable ((struct linetable *) %s)\n",
847 if (printed_compunit_symtab_start)
851 if (printed_objfile_start)
877 int printed_objfile_start = 0;
881 int found_something = 0;
892 if (! printed_objfile_start)
898 printed_objfile_start = 1;
908 if (printed_objfile_start)
932 error (
_(
"Extra arguments after regexp."));
946 [&] (
const char *filename,
bool basenames)
950 && (regexp == NULL || re_exec (filename)));
953 [] (
const char *symname)
1013 _(
"INDEX"),
_(
"LINE"),
_(
"ADDRESS"));
1073 Print dump of current symbol definitions.\n\ 1074 Usage: mt print symbols [-pc address] [--] [outfile]\n\ 1075 mt print symbols [-objfile objfile] [-source source] [--] [outfile]\n\ 1076 Entries in the full symbol table are dumped to file OUTFILE,\n\ 1077 or the terminal if OUTFILE is unspecified.\n\ 1078 If ADDRESS is provided, dump only the file for that address.\n\ 1079 If SOURCE is provided, dump only that file's symbols.\n\ 1080 If OBJFILE is provided, dump only that file's minimal symbols."),
1084 Print dump of current minimal symbol definitions.\n\ 1085 Usage: mt print msymbols [-objfile objfile] [--] [outfile]\n\ 1086 Entries in the minimal symbol table are dumped to file OUTFILE,\n\ 1087 or the terminal if OUTFILE is unspecified.\n\ 1088 If OBJFILE is provided, dump only that file's minimal symbols."),
1092 _(
"Print dump of current object file definitions.\n\ 1093 With an argument REGEXP, list the object files with matching names."),
1097 List the full symbol tables for all object files.\n\ 1098 This does not include information about individual symbols, blocks, or\n\ 1099 linetables --- just the symbol table structures themselves.\n\ 1100 With an argument REGEXP, list the symbol tables with matching names."),
1104 List the contents of all line tables, from all symbol tables.\n\ 1105 With an argument REGEXP, list just the line tables for the symbol\n\ 1106 tables with matching names."),
1111 Check consistency of currently expanded symtabs."),
1115 _(
"Expand symbol tables.\n\ 1116 With an argument REGEXP, only expand the symbol tables with matching names."),
void(* expand_symtabs_matching)(struct objfile *objfile, gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, enum search_domain kind)
static void maintenance_info_line_tables(const char *regexp, int from_tty)
char * hex_string(LONGEST num)
const char * symtab_to_filename_for_display(struct symtab *symtab)
#define SYMTAB_COMPUNIT(symtab)
#define SYMTAB_DIRNAME(symtab)
#define ALL_OBJFILE_FILETABS(objfile, cu, s)
#define COMPUNIT_DEBUGFORMAT(cust)
#define SYMBOL_PRINT_NAME(symbol)
void print_objfile_statistics(void)
#define MSYMBOL_LINKAGE_NAME(symbol)
struct linetable_entry item[1]
struct bcache * psymbol_bcache_get_bcache(struct psymbol_bcache *bcache)
struct bfd_section * the_bfd_section
void warning(const char *fmt,...)
void _initialize_symmisc(void)
struct program_space * pspace
enum language set_language(enum language lang)
char * plongest(LONGEST l)
struct cmd_list_element * maintenanceinfolist
int compare_filenames_for_search(const char *filename, const char *search_name)
const struct type_print_options type_print_raw_options
#define SYMBOL_CLASS(symbol)
void print_spaces(int n, struct ui_file *file)
void(* print_stats)(struct objfile *objfile)
#define ALL_DICT_SYMBOLS(dict, iter, sym)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
#define BLOCKVECTOR_BLOCK(blocklist, n)
#define MSYMBOL_DEMANGLED_NAME(symbol)
#define COMPUNIT_DIRNAME(cust)
static void maintenance_expand_symtabs(const char *args, int from_tty)
struct objfile_per_bfd_storage * per_bfd
struct linetable * linetable
struct objfile * symbol_objfile(const struct symbol *symbol)
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
#define host_address_to_string(ADDR)
#define SYMBOL_OBJ_SECTION(objfile, symbol)
#define BLOCK_FUNCTION(bl)
const char * symtab_to_fullname(struct symtab *s)
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
static void dump_msymbols(struct objfile *objfile, struct ui_file *outfile)
#define SYMTAB_BLOCKVECTOR(symtab)
static void maintenance_check_symtabs(const char *ignore, int from_tty)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
#define CATCH(EXCEPTION, MASK)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
#define SYMBOL_DOMAIN(symbol)
objfile(bfd *, const char *, objfile_flags)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
#define SYMBOL_DEMANGLED_NAME(symbol)
#define SYMTAB_OBJFILE(symtab)
static const lookup_name_info & match_any()
struct symtab * compunit_primary_filetab(const struct compunit_symtab *cust)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
static void maintenance_print_symbols(const char *args, int from_tty)
const struct sym_fns * sf
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
char * pulongest(ULONGEST u)
struct obj_section * sections
const char * language_str(enum language lang)
void print_bcache_statistics(struct bcache *c, const char *type)
#define BLOCK_SUPERBLOCK(bl)
void(* dump)(struct objfile *objfile)
#define COMPUNIT_PRODUCER(cust)
int bcache_memory_used(struct bcache *bcache)
#define SYMBOL_LINKAGE_NAME(symbol)
void exception_fprintf(struct ui_file *file, struct gdb_exception e, const char *prefix,...)
struct compunit_symtab * compunit_symtabs
const char * objfile_name(const struct objfile *objfile)
#define gdb_print_host_address(ADDR, STREAM)
struct cmd_list_element * maintenanceprintlist
#define SYMBOL_VALUE(symbol)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
void wrap_here(const char *indent)
static int maintenance_print_one_line_table(struct symtab *symtab, void *data)
#define SYMBOL_OBJFILE_OWNED(symbol)
#define LA_PRINT_TYPE(type, varstring, stream, show, level, flags)
#define COMPUNIT_BLOCKVECTOR(cust)
#define MSYMBOL_TYPE(msymbol)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
#define ALL_PSPACES(pspace)
#define SYMBOL_BLOCK_VALUE(symbol)
CORE_ADDR parse_and_eval_address(const char *exp)
#define TYPE_CODE(thistype)
bool open(const char *name, const char *mode)
static void dump_objfile(struct objfile *objfile)
#define OBJSTAT(objfile, expr)
static void maintenance_print_objfiles(const char *regexp, int from_tty)
#define COMPUNIT_FILETABS(cust)
static void maintenance_info_symtabs(const char *regexp, int from_tty)
struct compunit_symtab * compunit_symtab
#define BLOCKVECTOR_NBLOCKS(blocklist)
#define TYPE_TAG_NAME(type)
static void dump_symtab(struct symtab *symtab, struct ui_file *outfile)
#define ALL_OBJFILE_MSYMBOLS(objfile, m)
EXTERN_C char * re_comp(const char *)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void print_symbol(struct gdbarch *gdbarch, struct symbol *symbol, int depth, ui_file *outfile)
#define SYMBOL_TYPE(symbol)
const char * core_addr_to_string(const CORE_ADDR addr)
int dict_size(const struct dictionary *dict)
struct cmd_list_element * maintenancelist
void print_symbol_bcache_statistics(void)
#define ALL_COMPUNIT_FILETABS(cu, s)
#define TYPE_LENGTH(thistype)
auto_obstack storage_obstack
static int block_depth(struct block *)
#define SYMBOL_VALUE_BYTES(symbol)
#define ALL_OBJFILES(obj)
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
const struct quick_symbol_functions * qf
#define ALL_PSPACE_OBJFILES(ss, obj)
#define SYMTAB_LINETABLE(symtab)
struct psymbol_bcache * psymbol_cache
void error(const char *fmt,...)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)
#define SYMBOL_IS_ARGUMENT(symbol)
static void dump_symtab_1(struct symtab *symtab, struct ui_file *outfile)
static void maintenance_print_msymbols(const char *args, int from_tty)