24 #include "filenames.h"
39 #include "readline/readline.h"
44 #define DEV_TTY "/dev/tty"
87 "partial symbol cache");
89 "preprocessor macro cache");
102 int i, linetables, blockvectors;
109 if (
OBJSTAT (objfile, n_stabs) > 0)
115 if (
OBJSTAT (objfile, n_psyms) > 0)
118 if (
OBJSTAT (objfile, n_syms) > 0)
121 if (
OBJSTAT (objfile, n_types) > 0)
126 i = linetables = blockvectors = 0;
141 if (
OBJSTAT (objfile, sz_strtab) > 0)
146 ->objfile_obstack)));
261 bfd_section_name (objfile->
obfd,
265 (
long) (section - objfile->
sections));
278 warning (
_(
"internal error: minimal symbol count %d != %d"),
316 for (i = 0; i <
len; i++)
330 for (i = 0; i <
len; i++)
413 char *symname = NULL;
423 error (
_(
"Arguments missing: an output file name "
424 "and an optional symbol file name"));
439 filename = tilde_expand (filename);
442 outfile =
gdb_fopen (filename, FOPEN_WT);
503 ?
"struct" :
"union")),
646 char *symname = NULL;
650 struct stat sym_st, obj_st;
656 error (
_(
"print-msymbols takes an output file "
657 "name and optional symbol file name"));
670 if (symname && stat (symname, &sym_st))
675 filename = tilde_expand (filename);
678 outfile =
gdb_fopen (filename, FOPEN_WT);
687 if (symname == NULL || (!stat (
objfile_name (objfile), &obj_st)
688 && sym_st.st_dev == obj_st.st_dev
689 && sym_st.st_ino == obj_st.st_ino))
738 int printed_objfile_start = 0;
742 int printed_compunit_symtab_start = 0;
751 if (! printed_objfile_start)
757 printed_objfile_start = 1;
759 if (! printed_compunit_symtab_start)
774 " ((struct blockvector *) %s)\n",
777 printed_compunit_symtab_start = 1;
790 "linetable ((struct linetable *) %s)\n",
796 if (printed_compunit_symtab_start)
800 if (printed_objfile_start)
826 int printed_objfile_start = 0;
830 int found_something = 0;
841 if (! printed_objfile_start)
847 printed_objfile_start = 1;
857 if (printed_objfile_start)
879 const char *regexp = data;
887 if (regexp == NULL || re_exec (filename))
915 error (
_(
"Extra arguments after regexp."));
962 Print dump of current symbol definitions.\n\
963 Entries in the full symbol table are dumped to file OUTFILE.\n\
964 If a SOURCE file is specified, dump only that file's symbols."),
968 Print dump of current minimal symbol definitions.\n\
969 Entries in the minimal symbol table are dumped to file OUTFILE.\n\
970 If a SOURCE file is specified, dump only that file's minimal symbols."),
974 _(
"Print dump of current object file definitions.\n\
975 With an argument REGEXP, list the object files with matching names."),
979 List the full symbol tables for all object files.\n\
980 This does not include information about individual symbols, blocks, or\n\
981 linetables --- just the symbol table structures themselves.\n\
982 With an argument REGEXP, list the symbol tables with matching names."),
987 Check consistency of currently expanded symtabs."),
991 _(
"Expand symbol tables.\n\
992 With an argument REGEXP, only expand the symbol tables with matching names."),
struct cleanup * make_cleanup_freeargv(char **arg)
static void dump_symtab(struct objfile *objfile, struct symtab *symtab, struct ui_file *outfile)
char * hex_string(LONGEST num)
const char * symtab_to_filename_for_display(struct symtab *symtab)
#define SYMTAB_COMPUNIT(symtab)
#define SYMTAB_DIRNAME(symtab)
char * gdb_realpath(const char *filename)
#define ALL_OBJFILE_FILETABS(objfile, cu, s)
#define COMPUNIT_DEBUGFORMAT(cust)
#define SYMBOL_PRINT_NAME(symbol)
void print_objfile_statistics(void)
struct obstack storage_obstack
#define MSYMBOL_LINKAGE_NAME(symbol)
void(* expand_symtabs_matching)(struct objfile *objfile, expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
struct linetable_entry item[1]
struct bcache * psymbol_bcache_get_bcache(struct psymbol_bcache *bcache)
static int maintenance_expand_name_matcher(const char *symname, void *data)
struct bfd_section * the_bfd_section
void warning(const char *fmt,...)
void _initialize_symmisc(void)
enum language set_language(enum language lang)
char * plongest(LONGEST l)
struct cmd_list_element * maintenanceinfolist
struct ui_file * gdb_stdout
const struct type_print_options type_print_raw_options
struct ui_file * gdb_fopen(const char *name, const char *mode)
#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)
int catch_errors(catch_errors_ftype *func, void *func_args, char *errstring, return_mask mask)
static int print_symbol(void *)
#define BLOCKVECTOR_BLOCK(blocklist, n)
#define MSYMBOL_DEMANGLED_NAME(symbol)
#define COMPUNIT_DIRNAME(cust)
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 SYMBOL_OBJ_SECTION(objfile, symbol)
#define BLOCK_FUNCTION(bl)
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
static void dump_msymbols(struct objfile *objfile, struct ui_file *outfile)
#define SYMTAB_BLOCKVECTOR(symtab)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
#define SYMBOL_DOMAIN(symbol)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
#define SYMBOL_DEMANGLED_NAME(symbol)
#define SYMTAB_OBJFILE(symtab)
struct symtab * compunit_primary_filetab(const struct compunit_symtab *cust)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
const struct sym_fns * sf
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
char * pulongest(ULONGEST u)
struct obj_section * sections
const char * language_str(enum language lang)
#define BLOCK_SUPERBLOCK(bl)
static void maintenance_check_symtabs(char *ignore, int from_tty)
void(* dump)(struct objfile *objfile)
#define COMPUNIT_PRODUCER(cust)
int bcache_memory_used(struct bcache *bcache)
#define SYMBOL_LINKAGE_NAME(symbol)
struct compunit_symtab * compunit_symtabs
static void maintenance_print_symbols(char *args, int from_tty)
void wrap_here(char *indent)
const char * objfile_name(const struct objfile *objfile)
#define ALL_FILETABS(objfile, ps, s)
struct cmd_list_element * maintenanceprintlist
#define SYMBOL_VALUE(symbol)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
struct bcache * macro_cache
static int maintenance_expand_file_matcher(const char *filename, void *data, int basenames)
struct bcache * filename_cache
#define SYMBOL_OBJFILE_OWNED(symbol)
#define LA_PRINT_TYPE(type, varstring, stream, show, level, flags)
static void maintenance_print_msymbols(char *args, int from_tty)
#define COMPUNIT_BLOCKVECTOR(cust)
static void dump_symtab_1(struct objfile *objfile, struct symtab *symtab, struct ui_file *outfile)
#define MSYMBOL_TYPE(msymbol)
void gdb_print_host_address(const void *addr, struct ui_file *stream)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
#define ALL_PSPACES(pspace)
void print_bcache_statistics(struct bcache *c, char *type)
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
#define SYMBOL_BLOCK_VALUE(symbol)
#define TYPE_CODE(thistype)
const char * host_address_to_string(const void *addr)
static void dump_objfile(struct objfile *objfile)
#define OBJSTAT(objfile, expr)
char ** gdb_buildargv(const char *s)
#define COMPUNIT_FILETABS(cust)
#define BLOCKVECTOR_NBLOCKS(blocklist)
#define TYPE_TAG_NAME(type)
#define ALL_OBJFILE_MSYMBOLS(objfile, m)
EXTERN_C char * re_comp(const char *)
static void maintenance_info_symtabs(char *regexp, int from_tty)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
#define SYMBOL_TYPE(symbol)
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)
static void maintenance_expand_symtabs(char *args, int from_tty)
static int block_depth(struct block *)
#define SYMBOL_VALUE_BYTES(symbol)
const struct quick_symbol_functions * qf
static void maintenance_print_objfiles(char *regexp, int from_tty)
#define ALL_PSPACE_OBJFILES(ss, obj)
#define SYMTAB_LINETABLE(symtab)
struct psymbol_bcache * psymbol_cache
void error(const char *fmt,...)
void do_cleanups(struct cleanup *old_chain)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)
#define SYMBOL_IS_ARGUMENT(symbol)
const ULONGEST const LONGEST len