/* Do various things to symbol tables (other than lookup), for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 1998
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991-1996, 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Prototypes for local functions */
-static void dump_symtab PARAMS ((struct objfile *, struct symtab *,
- GDB_FILE *));
+static void dump_symtab (struct objfile *, struct symtab *,
+ struct ui_file *);
-static void dump_psymtab PARAMS ((struct objfile *, struct partial_symtab *,
- GDB_FILE *));
+static void dump_psymtab (struct objfile *, struct partial_symtab *,
+ struct ui_file *);
-static void dump_msymbols PARAMS ((struct objfile *, GDB_FILE *));
+static void dump_msymbols (struct objfile *, struct ui_file *);
-static void dump_objfile PARAMS ((struct objfile *));
+static void dump_objfile (struct objfile *);
-static int block_depth PARAMS ((struct block *));
+static int block_depth (struct block *);
-static void print_partial_symbols PARAMS ((struct partial_symbol **, int,
- char *, GDB_FILE *));
+static void print_partial_symbols (struct partial_symbol **, int,
+ char *, struct ui_file *);
-static void free_symtab_block PARAMS ((struct objfile *, struct block *));
+static void free_symtab_block (struct objfile *, struct block *);
-void _initialize_symmisc PARAMS ((void));
+void _initialize_symmisc (void);
struct print_symbol_args
{
struct symbol *symbol;
int depth;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
};
-static int print_symbol PARAMS ((PTR));
+static int print_symbol (PTR);
-static void
-free_symtab_block PARAMS ((struct objfile *, struct block *));
+static void free_symtab_block (struct objfile *, struct block *);
\f
/* Free a struct block <- B and all the symbols defined in that block. */
static void
-free_symtab_block (objfile, b)
- struct objfile *objfile;
- struct block *b;
+free_symtab_block (struct objfile *objfile, struct block *b)
{
register int i, n;
n = BLOCK_NSYMS (b);
It is s->free_code that says which alternative to use. */
void
-free_symtab (s)
- register struct symtab *s;
+free_symtab (register struct symtab *s)
{
register int i, n;
register struct blockvector *bv;
}
void
-print_symbol_bcache_statistics ()
+print_symbol_bcache_statistics (void)
{
struct objfile *objfile;
}
void
-print_objfile_statistics ()
+print_objfile_statistics (void)
{
struct objfile *objfile;
}
static void
-dump_objfile (objfile)
- struct objfile *objfile;
+dump_objfile (struct objfile *objfile)
{
struct symtab *symtab;
struct partial_symtab *psymtab;
printf_filtered ("\nObject file %s: ", objfile->name);
printf_filtered ("Objfile at ");
- gdb_print_address (objfile, gdb_stdout);
+ gdb_print_host_address (objfile, gdb_stdout);
printf_filtered (", bfd at ");
- gdb_print_address (objfile->obfd, gdb_stdout);
+ gdb_print_host_address (objfile->obfd, gdb_stdout);
printf_filtered (", %d minsyms\n\n",
objfile->minimal_symbol_count);
{
printf_filtered ("%s at ",
psymtab->filename);
- gdb_print_address (psymtab, gdb_stdout);
+ gdb_print_host_address (psymtab, gdb_stdout);
printf_filtered (", ");
if (psymtab->objfile != objfile)
{
symtab = symtab->next)
{
printf_filtered ("%s at ", symtab->filename);
- gdb_print_address (symtab, gdb_stdout);
+ gdb_print_host_address (symtab, gdb_stdout);
printf_filtered (", ");
if (symtab->objfile != objfile)
{
/* Print minimal symbols from this objfile. */
static void
-dump_msymbols (objfile, outfile)
- struct objfile *objfile;
- GDB_FILE *outfile;
+dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
{
struct minimal_symbol *msymbol;
int index;
}
static void
-dump_psymtab (objfile, psymtab, outfile)
- struct objfile *objfile;
- struct partial_symtab *psymtab;
- GDB_FILE *outfile;
+dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
+ struct ui_file *outfile)
{
int i;
fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
psymtab->filename);
fprintf_filtered (outfile, "(object ");
- gdb_print_address (psymtab, outfile);
+ gdb_print_host_address (psymtab, outfile);
fprintf_filtered (outfile, ")\n\n");
fprintf_unfiltered (outfile, " Read from object file %s (",
objfile->name);
- gdb_print_address (objfile, outfile);
+ gdb_print_host_address (objfile, outfile);
fprintf_unfiltered (outfile, ")\n");
if (psymtab->readin)
{
fprintf_filtered (outfile,
" Full symtab was read (at ");
- gdb_print_address (psymtab->symtab, outfile);
+ gdb_print_host_address (psymtab->symtab, outfile);
fprintf_filtered (outfile, " by function at ");
- gdb_print_address ((PTR) psymtab->read_symtab, outfile);
+ gdb_print_host_address ((PTR) psymtab->read_symtab, outfile);
fprintf_filtered (outfile, ")\n");
}
for (i = 0; i < psymtab->number_of_dependencies; i++)
{
fprintf_filtered (outfile, " %d ", i);
- gdb_print_address (psymtab->dependencies[i], outfile);
+ gdb_print_host_address (psymtab->dependencies[i], outfile);
fprintf_filtered (outfile, " %s\n",
psymtab->dependencies[i]->filename);
}
}
static void
-dump_symtab (objfile, symtab, outfile)
- struct objfile *objfile;
- struct symtab *symtab;
- GDB_FILE *outfile;
+dump_symtab (struct objfile *objfile, struct symtab *symtab,
+ struct ui_file *outfile)
{
register int i, j;
int len, blen;
fprintf_filtered (outfile, "Compilation directory is %s\n",
symtab->dirname);
fprintf_filtered (outfile, "Read from object file %s (", objfile->name);
- gdb_print_address (objfile, outfile);
+ gdb_print_host_address (objfile, outfile);
fprintf_filtered (outfile, ")\n");
fprintf_filtered (outfile, "Language: %s\n", language_str (symtab->language));
depth = block_depth (b) * 2;
print_spaces (depth, outfile);
fprintf_filtered (outfile, "block #%03d, object at ", i);
- gdb_print_address (b, outfile);
+ gdb_print_host_address (b, outfile);
if (BLOCK_SUPERBLOCK (b))
{
fprintf_filtered (outfile, " under ");
- gdb_print_address (BLOCK_SUPERBLOCK (b), outfile);
+ gdb_print_host_address (BLOCK_SUPERBLOCK (b), outfile);
}
blen = BLOCK_NSYMS (b);
fprintf_filtered (outfile, ", %d syms in ", blen);
}
void
-maintenance_print_symbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_symbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, (char *) &outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_SYMTABS (objfile, s)
1 for success. */
static int
-print_symbol (args)
- PTR args;
+print_symbol (PTR args)
{
struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
int depth = ((struct print_symbol_args *) args)->depth;
- GDB_FILE *outfile = ((struct print_symbol_args *) args)->outfile;
+ struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
print_spaces (depth, outfile);
if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
case LOC_BLOCK:
fprintf_filtered (outfile, "block object ");
- gdb_print_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
+ gdb_print_host_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
fprintf_filtered (outfile, ", ");
print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)),
1,
}
void
-maintenance_print_psymbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_psymbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, &outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_PSYMTABS (objfile, ps)
}
static void
-print_partial_symbols (p, count, what, outfile)
- struct partial_symbol **p;
- int count;
- char *what;
- GDB_FILE *outfile;
+print_partial_symbols (struct partial_symbol **p, int count, char *what,
+ struct ui_file *outfile)
{
fprintf_filtered (outfile, " %s partial symbols:\n", what);
while (count-- > 0)
}
void
-maintenance_print_msymbols (args, from_tty)
- char *args;
- int from_tty;
+maintenance_print_msymbols (char *args, int from_tty)
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *filename = DEV_TTY;
char *symname = NULL;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup ((make_cleanup_func) gdb_fclose, &outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_OBJFILES (objfile)
}
void
-maintenance_print_objfiles (ignore, from_tty)
- char *ignore;
- int from_tty;
+maintenance_print_objfiles (char *ignore, int from_tty)
{
struct objfile *objfile;
/* Check consistency of psymtabs and symtabs. */
void
-maintenance_check_symtabs (ignore, from_tty)
- char *ignore;
- int from_tty;
+maintenance_check_symtabs (char *ignore, int from_tty)
{
register struct symbol *sym;
register struct partial_symbol **psym;
/* Return the nexting depth of a block within other blocks in its symtab. */
static int
-block_depth (block)
- struct block *block;
+block_depth (struct block *block)
{
register int i = 0;
while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
be freed in free_objfile(). */
void
-extend_psymbol_list (listp, objfile)
- register struct psymbol_allocation_list *listp;
- struct objfile *objfile;
+extend_psymbol_list (register struct psymbol_allocation_list *listp,
+ struct objfile *objfile)
{
int new_size;
if (listp->size == 0)
/* Do early runtime initializations. */
void
-_initialize_symmisc ()
+_initialize_symmisc (void)
{
std_in = stdin;
std_out = stdout;