1999-04-16 09:35:26 +08:00
|
|
|
|
/* Do various things to symbol tables (other than lookup), for GDB.
|
2002-07-12 23:23:10 +08:00
|
|
|
|
|
|
|
|
|
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* objfiles.h (struct objfile): Add objfile_obstack field.
Remove type_obstack field.
* dwarf2read.c (dwarf2_add_field,dwarf2_add_member_fn,
read_structure_scope read_enumeration, new_symbol): Replace
type_obstack with objfile_obstack.
* dwarfread.c (struct_type, enum_type): Ditto.
* gdbtypes.c (alloc_type, alloc_type_instance, init_type)
(lookup_fundamental_type): Ditto.
* gdbtypes.h (TYPE_ALLOC): Ditto.
* hpread.c (hpread_read_enum_type, hpread_read_function_type)
(hpread_read_doc_function_type, hpread_read_struct_type)
(fix_static_member_physnames, hpread_read_array_type)
(hpread_read_subrange_type, hpread_type_lookup): Ditto.
* jv-lang.c (java_lookup_class, type_from_class, type_from_class)
(java_link_class_type): Ditto.
* mdebugread.c (parse_type): Ditto.
* objfiles.c (allocate_objfile, free_objfile): Ditto.
* solib-sunos.c (solib_add_common_symbols): Ditto.
* stabsread.c (define_symbol, read_type, read_member_functions,
read_cpp_abbrev, read_one_struct_field): Ditto.
* symfile.c (reread_symbols): Ditto.
* symmisc.c (print_objfile_statistics): Ditto.
2004-02-08 00:57:55 +08:00
|
|
|
|
1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software
|
2003-02-20 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
expand comment.
* ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
* ada-typeprint.c (ada_typedef_print): Ditto.
* ax-gdb.c (gen_var_ref): Ditto.
* breakpoint.c (print_one_breakpoint): Ditto.
* buildsym.c (finish_block): Ditto.
* c-valprint.c (c_val_print): Ditto.
* expprint.c (print_subexp): Ditto.
* findvar.c (locate_var_value): Ditto.
* infcmd.c (jump_command): Ditto.
* linespec.c (decode_line_2, decode_compound): Ditto.
* maint.c (maintenance_translate_address): Ditto.
* objc-lang.c (compare_selectors, compare_classes): Ditto.
* printcmd.c (build_address_symbolic, sym_info, print_frame_args):
Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* stabsread.c (define_symbol): Ditto.
* stack.c (print_frame, frame_info, print_block_frame_locals)
(print_frame_arg_vars, return_command): Ditto.
* symfile.c (compare_symbols, compare_psymbols): Ditto.
* symmisc.c (print_symbol): Ditto.
* symtab.c (lookup_partial_symbol, lookup_block_symbol)
(compare_search_syms, print_symbol_info, print_msymbol_info)
(rbreak_command): Ditto.
* tracepoint.c (tracepoints_info): Ditto.
* typeprint.c (typedef_print): Ditto.
* valops.c (value_of_variable, hand_function_call): Ditto.
* cli/cli-cmds.c (edit_command, list_command): Ditto.
* ada-typeprint.c: Update Copyright.
* infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto.
* tracepoint.c, cli/cli-cmds.c: Ditto.
2003-02-21 01:17:25 +08:00
|
|
|
|
Foundation, Inc.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
This file is part of GDB.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
#include "symtab.h"
|
|
|
|
|
#include "gdbtypes.h"
|
|
|
|
|
#include "bfd.h"
|
|
|
|
|
#include "symfile.h"
|
|
|
|
|
#include "objfiles.h"
|
|
|
|
|
#include "breakpoint.h"
|
|
|
|
|
#include "command.h"
|
2002-07-29 Andrew Cagney <ac131313@redhat.com>
* gdb_obstack.h: New file.
* symtab.h: Include "gdb_obstack.h" instead of "obstack.h".
(obstack_chunk_alloc, obstack_chunk_free): Delete macros.
* objfiles.h: Include "gdb_obstack.h".
* Makefile.in (gdb_obstack_h): Define.
(symtab_h): Add $(gdb_obstack_h).
(objfiles_h): Add $(gdb_obstack_h).
* objfiles.c: Include "gdb_obstack.h" instead of "obstack.h".
* macrotab.c, cp-valprint.c, dbxread.c: Ditto.
* ch-typeprint.c, ch-valprint.c, dstread.c: Ditto.
* macroexp.c, p-typeprint.c, stabsread.c: Ditto.
* symtab.c, f-typeprint.c, mdebugread.c: Ditto.
* p-valprint.c, symmisc.c, typeprint.c: Ditto.
* symfile.c, coffread.c, c-typeprint.c: Ditto.
* buildsym.c, bcache.c, ada-typeprint.c: Ditto.
* Makefile.in (bcache.o): Update dependencies.
(buildsym.o, c-typeprint.o, ch-typeprint.o): Ditto.
(ch-valprint.o, coffread.o, cp-valprint.o): Ditto.
(dbxread.o, dstread.o, f-typeprint.o): Ditto.
(objfiles.o, p-typeprint.o, p-valprint.o): Ditto.
(stabsread.o, symfile.o, symmisc.o): Ditto.
(symtab.o, typeprint.o, macroexp.o): Ditto.
(macrotab.o, mdebugread.o): Ditto.
(f_lang_h, coff_sym_h, coff_symconst_h): Define.
(coff_ecoff_h, aout_aout64_h): Define.
(aout_stabs_gnu_h, libaout_h): Define.
2002-07-30 06:55:26 +08:00
|
|
|
|
#include "gdb_obstack.h"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
#include "language.h"
|
|
|
|
|
#include "bcache.h"
|
2003-02-19 David Carlton <carlton@math.stanford.edu>
* Makefile.in (SFILES): Add block.c.
(block_h): New.
(COMMON_OBS): Add block.o.
(block.o): New.
(x86-64-tdep.o): Add $(block_h).
(values.o, valops.o, tracepoint.o, symtab.o, symmisc.o, symfile.o)
(stack.o, printcmd.o, p-exp.tab.o, parse.o, objfiles.o)
(objc-exp.tab.o, objc-lang.o, nlmread.o, mips-tdep.o, mdebugread.o)
(m2-exp.tab.o, linespec.o, jv-lang.o, jv-exp.tab.o, infcmd.o)
(f-valprint.o, findvar.o, f-exp.tab.o, expprint.o, coffread.o)
(c-exp.tab.o, buildsym.o, breakpoint.o, blockframe.o, ax-gdb.o)
(alpha-tdep.o, ada-lang.o, ada-exp.tab.o, mi-cmd-stack.o): Ditto.
* value.h: Add opaque declaration for struct block.
* parser-defs.h, objc-lang.h, buildsym.h, breakpoint.h: Ditto.
* ada-lang.h: Ditto.
* x86-64-tdep.c: #include "block.h"
* values.c, valops.c, tracepoint.c, symtab.c, symmisc.c: Ditto.
* symfile.c, stack.c, printcmd.c, p-exp.y, parse.c: Ditto.
* objfiles.c, objc-exp.y, objc-lang.c, nlmread.c: Ditto.
* mips-tdep.c, mdebugread.c, m2-exp.y, linespec.c: Ditto.
* jv-lang.c, jv-exp.y, infcmd.c, f-valprint.c: Ditto.
* findvar.c, f-exp.y, expprint.c, coffread.c, c-exp.y: Ditto.
* buildsym.c, breakpoint.c, blockframe.c, ax-gdb.c: Ditto.
* alpha-tdep.c, ada-lang.c, ada-exp.y: Ditto.
* blockframe.c (blockvector_for_pc_sect): Move to "block.c".
(blockvector_for_pc, block_for_pc_sect, block_for_pc): Ditto.
* symtab.c (block_function): Ditto.
(contained_in): Ditto.
* frame.h: Move block_for_pc and block_for_pc_sect declarations to
block.h. Add opaque declaration for struct block.
* symtab.h: Move block_function and contained_in declarations to
block.h. Add opaque declarations for struct block, struct
blockvector.
(struct block): Move to block.h.
(struct blockvector): Ditto.
(BLOCK_START, BLOCK_END, BLOCK_FUNCTION, BLOCK_SUPERBLOCK)
(BLOCK_GCC_COMPILED, BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM)
(BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE)
(ALL_BLOCK_SYMBOLS, BLOCK_SHOULD_SORT, BLOCKVECTOR_NBLOCKS)
(BLOCKVECTOR_BLOCK, GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK):
Ditto.
* block.c: New file.
* block.h: New file.
2003-02-19 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: #include "block.h"
2003-02-20 08:01:07 +08:00
|
|
|
|
#include "block.h"
|
2003-04-15 02:42:28 +08:00
|
|
|
|
#include "gdb_regex.h"
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
#include "dictionary.h"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#include "gdb_string.h"
|
2004-02-28 Andrew Cagney <cagney@redhat.com>
* utils.c: Use "", instead of <>, to include readline.
tui/tui-win.c, tui/tui.c, tui/tui-hooks.c: Ditto.
* tracepoint.c, top.c, symmisc.c, symfile.c: Ditto.
* source.c, solib.c, exec.c, event-top.c: Ditto.
* corelow.c, completer.c, cli/cli-setshow.c: Ditto.
* cli/cli-dump.c, cli/cli-cmds.c: Ditto.
* Makefile.in: Update all dependencies.
(readline_tilde_h, readline_history_h): Define.
(readline_headers): Delete.
2004-02-29 02:04:37 +08:00
|
|
|
|
#include "readline/readline.h"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#ifndef DEV_TTY
|
|
|
|
|
#define DEV_TTY "/dev/tty"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Unfortunately for debugging, stderr is usually a macro. This is painful
|
|
|
|
|
when calling functions that take FILE *'s from the debugger.
|
|
|
|
|
So we make a variable which has the same value and which is accessible when
|
|
|
|
|
debugging GDB with itself. Because stdin et al need not be constants,
|
|
|
|
|
we initialize them in the _initialize_symmisc function at the bottom
|
|
|
|
|
of the file. */
|
|
|
|
|
FILE *std_in;
|
|
|
|
|
FILE *std_out;
|
|
|
|
|
FILE *std_err;
|
|
|
|
|
|
|
|
|
|
/* Prototypes for local functions */
|
|
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
|
static void dump_symtab (struct objfile *, struct symtab *,
|
|
|
|
|
struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
|
static void dump_psymtab (struct objfile *, struct partial_symtab *,
|
|
|
|
|
struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
|
static void dump_msymbols (struct objfile *, struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void dump_objfile (struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static int block_depth (struct block *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
|
static void print_partial_symbols (struct partial_symbol **, int,
|
|
|
|
|
char *, struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void free_symtab_block (struct objfile *, struct block *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
void _initialize_symmisc (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
struct print_symbol_args
|
|
|
|
|
{
|
|
|
|
|
struct symbol *symbol;
|
|
|
|
|
int depth;
|
2000-02-02 08:21:19 +08:00
|
|
|
|
struct ui_file *outfile;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2003-01-18 Andrew Cagney <ac131313@redhat.com>
* ada-valprint.c: Eliminate PTR.
* breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto.
* defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto.
* exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto.
* objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto.
* remote-mips.c, remote-sds.c, remote-vx.c: Ditto.
* solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto.
* symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto.
2003-01-18 23:55:53 +08:00
|
|
|
|
static int print_symbol (void *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void free_symtab_block (struct objfile *, struct block *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Free a struct block <- B and all the symbols defined in that block. */
|
|
|
|
|
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
/* FIXME: carlton/2003-04-28: I don't believe this is currently ever
|
|
|
|
|
used. */
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
free_symtab_block (struct objfile *objfile, struct block *b)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
struct dict_iterator iter;
|
|
|
|
|
struct symbol *sym;
|
2002-07-12 04:46:19 +08:00
|
|
|
|
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (DEPRECATED_SYMBOL_NAME (sym));
|
|
|
|
|
xfree (sym);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
|
|
|
|
|
dict_free (BLOCK_DICT (b));
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (b);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Free all the storage associated with the struct symtab <- S.
|
|
|
|
|
Note that some symtabs have contents malloc'ed structure by structure,
|
|
|
|
|
while some have contents that all live inside one big block of memory,
|
|
|
|
|
and some share the contents of another symbol table and so you should
|
|
|
|
|
not free the contents on their behalf (except sometimes the linetable,
|
|
|
|
|
which maybe per symtab even when the rest is not).
|
|
|
|
|
It is s->free_code that says which alternative to use. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-09-16 Andrew Cagney <cagney@redhat.com>
* buildsym.c: Remove more occurances of "register".
* coffread.c, dbxread.c, dcache.c, dwarf2read.c: Ditto.
* environ.c, eval.c, f-valprint.c, findvar.c: Ditto.
* gdbtypes.c, gnu-v2-abi.c, h8300-tdep.c, hppa-tdep.c: Ditto.
* infcmd.c, mdebugread.c, minsyms.c, mips-tdep.c: Ditto.
* printcmd.c, remote-vx.c, sh-stub.c, sh-tdep.c: Ditto.
* sh64-tdep.c, source.c, stabsread.c, stack.c: Ditto.
* standalone.c, symfile.c, symmisc.c, symtab.c: Ditto.
* utils.c, valops.c, values.c, xcoffread.c: Ditto.
2003-09-17 02:56:35 +08:00
|
|
|
|
free_symtab (struct symtab *s)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-09-14 Andrew Cagney <cagney@redhat.com>
* alpha-nat.c: Remove some occurances of "register".
* alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
* buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
* corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
* dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
* environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
* f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
* h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
* hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
* infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
* jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
* mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
* mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
* ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
* p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
* remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
* rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
* solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
* stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
* symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
* typeprint.c, utils.c, valarith.c, valops.c: Ditto.
* values.c, vax-tdep.c, xcoffread.c: Ditto.
2003-09-15 00:32:14 +08:00
|
|
|
|
int i, n;
|
|
|
|
|
struct blockvector *bv;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
switch (s->free_code)
|
|
|
|
|
{
|
|
|
|
|
case free_nothing:
|
|
|
|
|
/* All the contents are part of a big block of memory (an obstack),
|
1999-07-08 04:19:36 +08:00
|
|
|
|
and some other symtab is in charge of freeing that block.
|
|
|
|
|
Therefore, do nothing. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case free_contents:
|
|
|
|
|
/* Here all the contents were malloc'ed structure by structure
|
1999-07-08 04:19:36 +08:00
|
|
|
|
and must be freed that way. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* First free the blocks (and their symbols. */
|
|
|
|
|
bv = BLOCKVECTOR (s);
|
|
|
|
|
n = BLOCKVECTOR_NBLOCKS (bv);
|
|
|
|
|
for (i = 0; i < n; i++)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Free the blockvector itself. */
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (bv);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Also free the linetable. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
case free_linetable:
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
/* Everything will be freed either by our `free_func'
|
1999-07-08 04:19:36 +08:00
|
|
|
|
or by some other symtab, except for our linetable.
|
|
|
|
|
Free that now. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (LINETABLE (s))
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (LINETABLE (s));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If there is a single block of memory to free, free it. */
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
if (s->free_func != NULL)
|
|
|
|
|
s->free_func (s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Free source-related stuff */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (s->line_charpos != NULL)
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (s->line_charpos);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (s->fullname != NULL)
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (s->fullname);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (s->debugformat != NULL)
|
2004-08-11 05:52:05 +08:00
|
|
|
|
xfree (s->debugformat);
|
|
|
|
|
xfree (s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
print_symbol_bcache_statistics (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_OBJFILES (objfile)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Byte cache statistics for '%s':\n", objfile->name);
|
2002-07-12 23:23:10 +08:00
|
|
|
|
print_bcache_statistics (objfile->psymbol_cache, "partial symbol cache");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
immediate_quit--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
print_objfile_statistics (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct objfile *objfile;
|
2003-02-14 09:13:45 +08:00
|
|
|
|
struct symtab *s;
|
|
|
|
|
struct partial_symtab *ps;
|
|
|
|
|
int i, linetables, blockvectors;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_OBJFILES (objfile)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Statistics for '%s':\n", objfile->name);
|
|
|
|
|
if (OBJSTAT (objfile, n_stabs) > 0)
|
|
|
|
|
printf_filtered (" Number of \"stab\" symbols read: %d\n",
|
|
|
|
|
OBJSTAT (objfile, n_stabs));
|
|
|
|
|
if (OBJSTAT (objfile, n_minsyms) > 0)
|
|
|
|
|
printf_filtered (" Number of \"minimal\" symbols read: %d\n",
|
|
|
|
|
OBJSTAT (objfile, n_minsyms));
|
|
|
|
|
if (OBJSTAT (objfile, n_psyms) > 0)
|
|
|
|
|
printf_filtered (" Number of \"partial\" symbols read: %d\n",
|
|
|
|
|
OBJSTAT (objfile, n_psyms));
|
|
|
|
|
if (OBJSTAT (objfile, n_syms) > 0)
|
|
|
|
|
printf_filtered (" Number of \"full\" symbols read: %d\n",
|
|
|
|
|
OBJSTAT (objfile, n_syms));
|
|
|
|
|
if (OBJSTAT (objfile, n_types) > 0)
|
|
|
|
|
printf_filtered (" Number of \"types\" defined: %d\n",
|
|
|
|
|
OBJSTAT (objfile, n_types));
|
2003-02-14 09:13:45 +08:00
|
|
|
|
i = 0;
|
|
|
|
|
ALL_OBJFILE_PSYMTABS (objfile, ps)
|
|
|
|
|
{
|
|
|
|
|
if (ps->readin == 0)
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
printf_filtered (" Number of psym tables (not yet expanded): %d\n", i);
|
|
|
|
|
i = linetables = blockvectors = 0;
|
|
|
|
|
ALL_OBJFILE_SYMTABS (objfile, s)
|
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
if (s->linetable != NULL)
|
|
|
|
|
linetables++;
|
|
|
|
|
if (s->primary == 1)
|
|
|
|
|
blockvectors++;
|
|
|
|
|
}
|
|
|
|
|
printf_filtered (" Number of symbol tables: %d\n", i);
|
|
|
|
|
printf_filtered (" Number of symbol tables with line tables: %d\n",
|
|
|
|
|
linetables);
|
|
|
|
|
printf_filtered (" Number of symbol tables with blockvectors: %d\n",
|
|
|
|
|
blockvectors);
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (OBJSTAT (objfile, sz_strtab) > 0)
|
|
|
|
|
printf_filtered (" Space used by a.out string tables: %d\n",
|
|
|
|
|
OBJSTAT (objfile, sz_strtab));
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* buildsym.c (free_pending_blocks, finish_block)
(record_pending_block, make_blockvector, end_symtab): Replace
symbol_obstack with objfile_obstack.
* coffread.c (process_coff_symbol, coff_read_struct_type)
(coff_read_enum_type): Ditto.
* cp-namespace.c (initialize_namespace_symtab)
(check_one_possible_namespace_symbol): Ditto.
* dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
(dwarf2_symbol_mark_computed): Ditto.
* dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
* elfread.c (elf_symtab_read): Ditto.
* hpread.c (hpread_symfile_init, hpread_symfile_init)
(hpread_read_enum_type, hpread_read_function_type)
(hpread_read_doc_function_type, hpread_process_one_debug_symbol):
Ditto.
* jv-lang.c (get_java_class_symtab, add_class_symbol)
(java_link_class_type): Ditto.
* mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
(new_symbol): Ditto.
* minsyms.c (install_minimal_symbols): Ditto.
* objfiles.c (allocate_objfile): Remove init of symbol_obstack.
(terminate_minimal_symbol_table): Replace symbol_obstack with
objfile_obstack.
(free_objfile): Remove freeing of symbol_obstack.
* objfiles.h: Remove symbol_obstack field.
* pa64solib.c (add_to_solist): Replace symbol_obstack with
objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
symbol_obstack.
(solib_add_common_symbols): Replace symbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add): Ditto.
* stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
(common_block_start, common_block_end): Ditto.
* symfile.c (reread_symbols): Remove freeing and init of
symbol_obstack.
(allocate_symtab): Rename symbol_obstack to objfile_obstack.
* symfile.h: Update comment.
* symmisc.c (print_objfile_statistics): Remove symbol_obstack
stats printing.
* symtab.c (symbol_set_names): Replace symbol_obstack with
objfile_obstack.
* symtab.h (struct general_symbol_info, struct minimal_symbol):
Update comments.
* xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC)
(init_stringtab, xcoff_initial_scan): Replace symbol_obstack with
objfile_obstack.
2004-02-08 07:13:47 +08:00
|
|
|
|
printf_filtered (" Total memory used for objfile obstack: %d\n",
|
|
|
|
|
obstack_memory_used (&objfile->objfile_obstack));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
printf_filtered (" Total memory used for psymbol cache: %d\n",
|
2002-07-12 23:23:10 +08:00
|
|
|
|
bcache_memory_used (objfile->psymbol_cache));
|
2002-05-16 05:19:21 +08:00
|
|
|
|
printf_filtered (" Total memory used for macro cache: %d\n",
|
2002-07-12 23:23:10 +08:00
|
|
|
|
bcache_memory_used (objfile->macro_cache));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
immediate_quit--;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
dump_objfile (struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct symtab *symtab;
|
|
|
|
|
struct partial_symtab *psymtab;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
printf_filtered ("\nObject file %s: ", objfile->name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
printf_filtered ("Objfile at ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (objfile, gdb_stdout);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
printf_filtered (", bfd at ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (objfile->obfd, gdb_stdout);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
printf_filtered (", %d minsyms\n\n",
|
|
|
|
|
objfile->minimal_symbol_count);
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (objfile->psymtabs)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Psymtabs:\n");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
for (psymtab = objfile->psymtabs;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
psymtab != NULL;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab = psymtab->next)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("%s at ",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab->filename);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (psymtab, gdb_stdout);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
printf_filtered (", ");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (psymtab->objfile != objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("NOT ON CHAIN! ");
|
|
|
|
|
}
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
}
|
|
|
|
|
printf_filtered ("\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (objfile->symtabs)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Symtabs:\n");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
for (symtab = objfile->symtabs;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
symtab != NULL;
|
|
|
|
|
symtab = symtab->next)
|
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
printf_filtered ("%s at ", symtab->filename);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (symtab, gdb_stdout);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
printf_filtered (", ");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (symtab->objfile != objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
printf_filtered ("NOT ON CHAIN! ");
|
|
|
|
|
}
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
}
|
|
|
|
|
printf_filtered ("\n\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print minimal symbols from this objfile. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct minimal_symbol *msymbol;
|
|
|
|
|
int index;
|
|
|
|
|
char ms_type;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
|
|
|
|
fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile->name);
|
|
|
|
|
if (objfile->minimal_symbol_count == 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, "No minimal symbols found.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
for (index = 0, msymbol = objfile->msymbols;
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
DEPRECATED_SYMBOL_NAME (msymbol) != NULL; msymbol++, index++)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
switch (msymbol->type)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
case mst_unknown:
|
|
|
|
|
ms_type = 'u';
|
|
|
|
|
break;
|
|
|
|
|
case mst_text:
|
|
|
|
|
ms_type = 'T';
|
|
|
|
|
break;
|
|
|
|
|
case mst_solib_trampoline:
|
|
|
|
|
ms_type = 'S';
|
|
|
|
|
break;
|
|
|
|
|
case mst_data:
|
|
|
|
|
ms_type = 'D';
|
|
|
|
|
break;
|
|
|
|
|
case mst_bss:
|
|
|
|
|
ms_type = 'B';
|
|
|
|
|
break;
|
|
|
|
|
case mst_abs:
|
|
|
|
|
ms_type = 'A';
|
|
|
|
|
break;
|
|
|
|
|
case mst_file_text:
|
|
|
|
|
ms_type = 't';
|
|
|
|
|
break;
|
|
|
|
|
case mst_file_data:
|
|
|
|
|
ms_type = 'd';
|
|
|
|
|
break;
|
|
|
|
|
case mst_file_bss:
|
|
|
|
|
ms_type = 'b';
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ms_type = '?';
|
|
|
|
|
break;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
|
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (msymbol), 1, outfile);
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
fprintf_filtered (outfile, " %s", DEPRECATED_SYMBOL_NAME (msymbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (SYMBOL_BFD_SECTION (msymbol))
|
|
|
|
|
fprintf_filtered (outfile, " section %s",
|
|
|
|
|
bfd_section_name (objfile->obfd,
|
|
|
|
|
SYMBOL_BFD_SECTION (msymbol)));
|
|
|
|
|
if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL)
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " %s", SYMBOL_DEMANGLED_NAME (msymbol));
|
|
|
|
|
}
|
|
|
|
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
|
|
|
|
if (msymbol->filename)
|
|
|
|
|
fprintf_filtered (outfile, " %s", msymbol->filename);
|
|
|
|
|
#endif
|
|
|
|
|
fputs_filtered ("\n", outfile);
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (objfile->minimal_symbol_count != index)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
warning ("internal error: minimal symbol count %d != %d",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
objfile->minimal_symbol_count, index);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
|
|
|
|
|
struct ui_file *outfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab->filename);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, "(object ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (psymtab, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, ")\n\n");
|
|
|
|
|
fprintf_unfiltered (outfile, " Read from object file %s (",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
objfile->name);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (objfile, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_unfiltered (outfile, ")\n");
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (psymtab->readin)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
" Full symtab was read (at ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (psymtab->symtab, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, " by function at ");
|
2003-01-18 Andrew Cagney <ac131313@redhat.com>
* ada-valprint.c: Eliminate PTR.
* breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto.
* defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto.
* exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto.
* objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto.
* remote-mips.c, remote-sds.c, remote-vx.c: Ditto.
* solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto.
* symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto.
2003-01-18 23:55:53 +08:00
|
|
|
|
gdb_print_host_address (psymtab->read_symtab, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, ")\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fprintf_filtered (outfile, " Relocate symbols by ");
|
|
|
|
|
for (i = 0; i < psymtab->objfile->num_sections; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (i != 0)
|
|
|
|
|
fprintf_filtered (outfile, ", ");
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
print_address_numeric (ANOFFSET (psymtab->section_offsets, i),
|
|
|
|
|
1,
|
|
|
|
|
outfile);
|
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
|
|
|
|
|
fprintf_filtered (outfile, " Symbols cover text addresses ");
|
|
|
|
|
print_address_numeric (psymtab->textlow, 1, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "-");
|
|
|
|
|
print_address_numeric (psymtab->texthigh, 1, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
fprintf_filtered (outfile, " Depends on %d other partial symtabs.\n",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab->number_of_dependencies);
|
|
|
|
|
for (i = 0; i < psymtab->number_of_dependencies; i++)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " %d ", i);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (psymtab->dependencies[i], outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, " %s\n",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab->dependencies[i]->filename);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (psymtab->n_global_syms > 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
print_partial_symbols (objfile->global_psymbols.list
|
|
|
|
|
+ psymtab->globals_offset,
|
|
|
|
|
psymtab->n_global_syms, "Global", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (psymtab->n_static_syms > 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
print_partial_symbols (objfile->static_psymbols.list
|
|
|
|
|
+ psymtab->statics_offset,
|
|
|
|
|
psymtab->n_static_syms, "Static", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
dump_symtab (struct objfile *objfile, struct symtab *symtab,
|
|
|
|
|
struct ui_file *outfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
int i;
|
|
|
|
|
struct dict_iterator iter;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int len, blen;
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
struct linetable *l;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct blockvector *bv;
|
2001-10-13 07:51:30 +08:00
|
|
|
|
struct symbol *sym;
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
struct block *b;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int depth;
|
|
|
|
|
|
|
|
|
|
fprintf_filtered (outfile, "\nSymtab for file %s\n", symtab->filename);
|
|
|
|
|
if (symtab->dirname)
|
|
|
|
|
fprintf_filtered (outfile, "Compilation directory is %s\n",
|
|
|
|
|
symtab->dirname);
|
|
|
|
|
fprintf_filtered (outfile, "Read from object file %s (", objfile->name);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (objfile, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, ")\n");
|
|
|
|
|
fprintf_filtered (outfile, "Language: %s\n", language_str (symtab->language));
|
|
|
|
|
|
|
|
|
|
/* First print the line table. */
|
|
|
|
|
l = LINETABLE (symtab);
|
|
|
|
|
if (l)
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, "\nLine table:\n\n");
|
|
|
|
|
len = l->nitems;
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " line %d at ", l->item[i].line);
|
|
|
|
|
print_address_numeric (l->item[i].pc, 1, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Now print the block info, but only for primary symtabs since we will
|
|
|
|
|
print lots of duplicate info otherwise. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (symtab->primary)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, "\nBlockvector:\n\n");
|
|
|
|
|
bv = BLOCKVECTOR (symtab);
|
|
|
|
|
len = BLOCKVECTOR_NBLOCKS (bv);
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (bv, i);
|
|
|
|
|
depth = block_depth (b) * 2;
|
|
|
|
|
print_spaces (depth, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "block #%03d, object at ", i);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (b, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (BLOCK_SUPERBLOCK (b))
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " under ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (BLOCK_SUPERBLOCK (b), outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
2002-07-12 04:46:19 +08:00
|
|
|
|
/* drow/2002-07-10: We could save the total symbols count
|
|
|
|
|
even if we're using a hashtable, but nothing else but this message
|
|
|
|
|
wants it. */
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
fprintf_filtered (outfile, ", %d syms/buckets in ",
|
|
|
|
|
dict_size (BLOCK_DICT (b)));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
print_address_numeric (BLOCK_START (b), 1, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "..");
|
|
|
|
|
print_address_numeric (BLOCK_END (b), 1, outfile);
|
|
|
|
|
if (BLOCK_FUNCTION (b))
|
|
|
|
|
{
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
fprintf_filtered (outfile, ", function %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b)));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL)
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, ", %s",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (BLOCK_GCC_COMPILED (b))
|
|
|
|
|
fprintf_filtered (outfile, ", compiled with gcc%d", BLOCK_GCC_COMPILED (b));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, "\n");
|
2002-07-12 04:46:19 +08:00
|
|
|
|
/* Now print each symbol in this block (in no particular order, if
|
|
|
|
|
we're using a hashtable). */
|
2003-06-11 David Carlton <carlton@bactrian.org>
* dictionary.h: New.
* dictionary.c: New.
* block.h: Add opaque declaration for struct dictionary.
(struct block): Add 'dict' member; delete 'hashtable', 'nsyms',
'sym' members.
(BLOCK_DICT): New macro.
Delete macros BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM,
BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE,
BLOCK_SHOULD_SORT.
(ALL_BLOCK_SYMBOLS): Update definition.
* Makefile.in (SFILES): Add dictionary.c.
(dictionary_h): New.
(COMMON_OBS): Add dictionary.o.
(dictionary.o): New.
(ada-lang.o): Depend on dictionary_h.
(buildsym.o, coffread.o, jv-lang.o, mdebugread.o, objfiles.o)
(stack.o, symmisc.o, symtab.o, tracepoint.o, valops.o)
(mi-cmd-stack.o): Ditto.
(gdbtk-cmds.o): Update dependencies.
(gdbtk-stack.o): Ditto.
* ada-lang.c: Include dictionary.h.
(symtab_for_sym): Update uses of ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Ditto.
(ada_add_block_symbols): Update uses of ALL_BLOCK_SYMBOLS; replace
explicit iteration by use of ALL_BLOCK_SYMBOLS. Delete variable
'is_sorted'.
* mdebugread.c: Include dictionary.h.
(struct parse_stack): Delete 'maxsyms' member.
(parse_symbol): Update calls to new_block. Delete calls to
shrink_block. Use dictionary methods.
(psymtab_to_symtab_1): Delete calls to sort_symtab_syms.
Update calls to new_symtab. Don't maintain maxsyms data.
(mylookup_symbol): Update use of ALL_BLOCK_SYMBOLS.
(add_symbol): Just call dict_add_symbol.
(new_symtab): Delete 'maxsyms' argument.
(new_symtab): Update calls to new_block.
(new_block): Delete 'maxsyms' argument; add 'function' argument.
(shrink_block): Delete function.
(fixup_sigtramp): Update call to new_block. Add symbol via
dict_add_symbol.
* jv-lang.c: Include dictionary.h.
(get_java_class_symtab): Set the BLOCK_DICT of the blocks
appropriately. Set class_symtab->free_func. Make sure the
blockvector is big enough to hold two blocks.
(add_class_symtab_symbol): Use dictionary methods.
(free_class_block): New function.
(type_from_class): Replace explicit iteration by
ALL_BLOCK_SYMBOLS.
* symtab.h (struct symtab): Replace 'free_ptr' method by
'free_func'.
* dwarf2read.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* dwarfread.c (psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* coffread.c (coff_symfile_read): Delete call to sort_symtab_syms.
Include dictionary.h.
(patch_opaque_types): Update use of ALL_BLOCK_SYMBOLS.
* dbxread.c (dbx_psymtab_to_symtab_1): Delete call to
sort_symtab_syms.
* objfiles.c: Include dictionary.h.
(objfile_relocate): Update use of ALL_BLOCK_SYMBOLS.
* buildsym.c: Include dictionary.h.
(finish_block): Use dictionary methods.
(end_symtab): Set free_func to NULL, not free_ptr.
* tracepoint.c: Include dictionary.h.
(add_local_symbols): Update use of ALL_BLOCK_SYMBOLS.
(scope_info): Ditto.
* stack.c: Include dictionary.h.
(print_block_frame_locals): Update use of ALL_BLOCK_SYMBOLS.
(print_block_frame_labels, print_frame_arg_vars)
(print_frame_args): Ditto.
* symmisc.c (free_symtab_block): Use dictionary methods.
(dump_symtab): Ditto.
(free_symtab): Replace use of 'free_ptr' by 'free_func'.
Include dictionary.h.
* symfile.h: Delete declarations of sort_block_syms,
sort_symtab_syms.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Delete.
* symtab.c: Include dictionary.h.
(lookup_block_symbol): Use dictionary iterators.
(find_pc_sect_symtab): Update use of ALL_BLOCK_SYMBOLS.
(search_symbols, make_symbol_completion_list): Ditto.
(make_symbol_overload_list): Ditto.
* valops.c (value_of_local): Use dict_empty.
Include dictionary.h.
2003-06-11 David Carlton <carlton@bactrian.org>
* generic/gdbtk-stack.c: Include dictionary.h.
(gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
(gdb_get_blocks, gdb_get_vars_command): Ditto.
* generic/gdbtk-cmds.c: Include dictionary.h.
(gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
2003-06-11 David Carlton <carlton@bactrian.org>
* mi-cmd-stack.c: Include dictionary.h.
(list_args_or_locals): Update use of ALL_BLOCK_SYMBOLS.
2003-06-12 07:29:49 +08:00
|
|
|
|
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct print_symbol_args s;
|
2001-10-13 07:51:30 +08:00
|
|
|
|
s.symbol = sym;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
s.depth = depth + 1;
|
|
|
|
|
s.outfile = outfile;
|
|
|
|
|
catch_errors (print_symbol, &s, "Error printing symbol:\n",
|
|
|
|
|
RETURN_MASK_ALL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, "\nBlockvector same as previous symtab\n\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
maintenance_print_symbols (char *args, int from_tty)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
char **argv;
|
2000-02-02 08:21:19 +08:00
|
|
|
|
struct ui_file *outfile;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct cleanup *cleanups;
|
|
|
|
|
char *symname = NULL;
|
|
|
|
|
char *filename = DEV_TTY;
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
struct symtab *s;
|
|
|
|
|
|
|
|
|
|
dont_repeat ();
|
|
|
|
|
|
|
|
|
|
if (args == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("\
|
|
|
|
|
Arguments missing: an output file name and an optional symbol file name");
|
|
|
|
|
}
|
|
|
|
|
else if ((argv = buildargv (args)) == NULL)
|
|
|
|
|
{
|
|
|
|
|
nomem (0);
|
|
|
|
|
}
|
1999-04-27 02:34:20 +08:00
|
|
|
|
cleanups = make_cleanup_freeargv (argv);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (argv[0] != NULL)
|
|
|
|
|
{
|
|
|
|
|
filename = argv[0];
|
|
|
|
|
/* If a second arg is supplied, it is a source file name to match on */
|
|
|
|
|
if (argv[1] != NULL)
|
|
|
|
|
{
|
|
|
|
|
symname = argv[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filename = tilde_expand (filename);
|
2000-12-15 09:01:51 +08:00
|
|
|
|
make_cleanup (xfree, filename);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
outfile = gdb_fopen (filename, FOPEN_WT);
|
|
|
|
|
if (outfile == 0)
|
|
|
|
|
perror_with_name (filename);
|
2000-02-02 08:21:19 +08:00
|
|
|
|
make_cleanup_ui_file_delete (outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_SYMTABS (objfile, s)
|
2003-11-08 08:13:03 +08:00
|
|
|
|
if (symname == NULL || strcmp (symname, s->filename) == 0)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
dump_symtab (objfile, s, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
immediate_quit--;
|
|
|
|
|
do_cleanups (cleanups);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Print symbol ARGS->SYMBOL on ARGS->OUTFILE. ARGS->DEPTH says how
|
|
|
|
|
far to indent. ARGS is really a struct print_symbol_args *, but is
|
|
|
|
|
declared as char * to get it past catch_errors. Returns 0 for error,
|
|
|
|
|
1 for success. */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-01-18 Andrew Cagney <ac131313@redhat.com>
* ada-valprint.c: Eliminate PTR.
* breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto.
* defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto.
* exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto.
* objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto.
* remote-mips.c, remote-sds.c, remote-vx.c: Ditto.
* solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto.
* symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto.
2003-01-18 23:55:53 +08:00
|
|
|
|
print_symbol (void *args)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
|
|
|
|
|
int depth = ((struct print_symbol_args *) args)->depth;
|
2000-02-02 08:21:19 +08:00
|
|
|
|
struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
print_spaces (depth, outfile);
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
if (SYMBOL_DOMAIN (symbol) == LABEL_DOMAIN)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-02-20 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
expand comment.
* ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
* ada-typeprint.c (ada_typedef_print): Ditto.
* ax-gdb.c (gen_var_ref): Ditto.
* breakpoint.c (print_one_breakpoint): Ditto.
* buildsym.c (finish_block): Ditto.
* c-valprint.c (c_val_print): Ditto.
* expprint.c (print_subexp): Ditto.
* findvar.c (locate_var_value): Ditto.
* infcmd.c (jump_command): Ditto.
* linespec.c (decode_line_2, decode_compound): Ditto.
* maint.c (maintenance_translate_address): Ditto.
* objc-lang.c (compare_selectors, compare_classes): Ditto.
* printcmd.c (build_address_symbolic, sym_info, print_frame_args):
Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* stabsread.c (define_symbol): Ditto.
* stack.c (print_frame, frame_info, print_block_frame_locals)
(print_frame_arg_vars, return_command): Ditto.
* symfile.c (compare_symbols, compare_psymbols): Ditto.
* symmisc.c (print_symbol): Ditto.
* symtab.c (lookup_partial_symbol, lookup_block_symbol)
(compare_search_syms, print_symbol_info, print_msymbol_info)
(rbreak_command): Ditto.
* tracepoint.c (tracepoints_info): Ditto.
* typeprint.c (typedef_print): Ditto.
* valops.c (value_of_variable, hand_function_call): Ditto.
* cli/cli-cmds.c (edit_command, list_command): Ditto.
* ada-typeprint.c: Update Copyright.
* infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto.
* tracepoint.c, cli/cli-cmds.c: Ditto.
2003-02-21 01:17:25 +08:00
|
|
|
|
fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
|
|
|
|
|
if (SYMBOL_BFD_SECTION (symbol))
|
|
|
|
|
fprintf_filtered (outfile, " section %s\n",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
bfd_section_name (SYMBOL_BFD_SECTION (symbol)->owner,
|
|
|
|
|
SYMBOL_BFD_SECTION (symbol)));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
if (SYMBOL_DOMAIN (symbol) == STRUCT_DOMAIN)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
if (TYPE_TAG_NAME (SYMBOL_TYPE (symbol)))
|
|
|
|
|
{
|
|
|
|
|
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, "%s %s = ",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
|
|
|
|
|
? "enum"
|
|
|
|
|
: (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
|
|
|
|
|
? "struct" : "union")),
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
DEPRECATED_SYMBOL_NAME (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
|
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, ";\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
|
|
|
|
|
fprintf_filtered (outfile, "typedef ");
|
|
|
|
|
if (SYMBOL_TYPE (symbol))
|
|
|
|
|
{
|
|
|
|
|
/* Print details of types, except for enums where it's clutter. */
|
2003-02-20 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
expand comment.
* ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
* ada-typeprint.c (ada_typedef_print): Ditto.
* ax-gdb.c (gen_var_ref): Ditto.
* breakpoint.c (print_one_breakpoint): Ditto.
* buildsym.c (finish_block): Ditto.
* c-valprint.c (c_val_print): Ditto.
* expprint.c (print_subexp): Ditto.
* findvar.c (locate_var_value): Ditto.
* infcmd.c (jump_command): Ditto.
* linespec.c (decode_line_2, decode_compound): Ditto.
* maint.c (maintenance_translate_address): Ditto.
* objc-lang.c (compare_selectors, compare_classes): Ditto.
* printcmd.c (build_address_symbolic, sym_info, print_frame_args):
Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* stabsread.c (define_symbol): Ditto.
* stack.c (print_frame, frame_info, print_block_frame_locals)
(print_frame_arg_vars, return_command): Ditto.
* symfile.c (compare_symbols, compare_psymbols): Ditto.
* symmisc.c (print_symbol): Ditto.
* symtab.c (lookup_partial_symbol, lookup_block_symbol)
(compare_search_syms, print_symbol_info, print_msymbol_info)
(rbreak_command): Ditto.
* tracepoint.c (tracepoints_info): Ditto.
* typeprint.c (typedef_print): Ditto.
* valops.c (value_of_variable, hand_function_call): Ditto.
* cli/cli-cmds.c (edit_command, list_command): Ditto.
* ada-typeprint.c: Update Copyright.
* infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto.
* tracepoint.c, cli/cli-cmds.c: Ditto.
2003-02-21 01:17:25 +08:00
|
|
|
|
LA_PRINT_TYPE (SYMBOL_TYPE (symbol), SYMBOL_PRINT_NAME (symbol),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
outfile,
|
|
|
|
|
TYPE_CODE (SYMBOL_TYPE (symbol)) != TYPE_CODE_ENUM,
|
|
|
|
|
depth);
|
|
|
|
|
fprintf_filtered (outfile, "; ");
|
|
|
|
|
}
|
|
|
|
|
else
|
2003-02-20 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
expand comment.
* ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
* ada-typeprint.c (ada_typedef_print): Ditto.
* ax-gdb.c (gen_var_ref): Ditto.
* breakpoint.c (print_one_breakpoint): Ditto.
* buildsym.c (finish_block): Ditto.
* c-valprint.c (c_val_print): Ditto.
* expprint.c (print_subexp): Ditto.
* findvar.c (locate_var_value): Ditto.
* infcmd.c (jump_command): Ditto.
* linespec.c (decode_line_2, decode_compound): Ditto.
* maint.c (maintenance_translate_address): Ditto.
* objc-lang.c (compare_selectors, compare_classes): Ditto.
* printcmd.c (build_address_symbolic, sym_info, print_frame_args):
Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* stabsread.c (define_symbol): Ditto.
* stack.c (print_frame, frame_info, print_block_frame_locals)
(print_frame_arg_vars, return_command): Ditto.
* symfile.c (compare_symbols, compare_psymbols): Ditto.
* symmisc.c (print_symbol): Ditto.
* symtab.c (lookup_partial_symbol, lookup_block_symbol)
(compare_search_syms, print_symbol_info, print_msymbol_info)
(rbreak_command): Ditto.
* tracepoint.c (tracepoints_info): Ditto.
* typeprint.c (typedef_print): Ditto.
* valops.c (value_of_variable, hand_function_call): Ditto.
* cli/cli-cmds.c (edit_command, list_command): Ditto.
* ada-typeprint.c: Update Copyright.
* infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto.
* tracepoint.c, cli/cli-cmds.c: Ditto.
2003-02-21 01:17:25 +08:00
|
|
|
|
fprintf_filtered (outfile, "%s ", SYMBOL_PRINT_NAME (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
switch (SYMBOL_CLASS (symbol))
|
|
|
|
|
{
|
|
|
|
|
case LOC_CONST:
|
|
|
|
|
fprintf_filtered (outfile, "const %ld (0x%lx)",
|
|
|
|
|
SYMBOL_VALUE (symbol),
|
|
|
|
|
SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_CONST_BYTES:
|
|
|
|
|
{
|
|
|
|
|
unsigned i;
|
|
|
|
|
struct type *type = check_typedef (SYMBOL_TYPE (symbol));
|
|
|
|
|
fprintf_filtered (outfile, "const %u hex bytes:",
|
|
|
|
|
TYPE_LENGTH (type));
|
|
|
|
|
for (i = 0; i < TYPE_LENGTH (type); i++)
|
|
|
|
|
fprintf_filtered (outfile, " %02x",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_STATIC:
|
|
|
|
|
fprintf_filtered (outfile, "static at ");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (SYMBOL_BFD_SECTION (symbol))
|
|
|
|
|
fprintf_filtered (outfile, " section %s",
|
|
|
|
|
bfd_section_name
|
|
|
|
|
(SYMBOL_BFD_SECTION (symbol)->owner,
|
|
|
|
|
SYMBOL_BFD_SECTION (symbol)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_INDIRECT:
|
|
|
|
|
fprintf_filtered (outfile, "extern global at *(");
|
1999-07-08 04:19:36 +08:00
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, "),");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_REGISTER:
|
|
|
|
|
fprintf_filtered (outfile, "register %ld", SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_ARG:
|
|
|
|
|
fprintf_filtered (outfile, "arg at offset 0x%lx",
|
|
|
|
|
SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_LOCAL_ARG:
|
|
|
|
|
fprintf_filtered (outfile, "arg at offset 0x%lx from fp",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
SYMBOL_VALUE (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_REF_ARG:
|
|
|
|
|
fprintf_filtered (outfile, "reference arg at 0x%lx", SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_REGPARM:
|
|
|
|
|
fprintf_filtered (outfile, "parameter register %ld", SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_REGPARM_ADDR:
|
|
|
|
|
fprintf_filtered (outfile, "address parameter register %ld", SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_LOCAL:
|
|
|
|
|
fprintf_filtered (outfile, "local at offset 0x%lx",
|
|
|
|
|
SYMBOL_VALUE (symbol));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_BASEREG:
|
|
|
|
|
fprintf_filtered (outfile, "local at 0x%lx from register %d",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_BASEREG_ARG:
|
|
|
|
|
fprintf_filtered (outfile, "arg at 0x%lx from register %d",
|
1999-07-08 04:19:36 +08:00
|
|
|
|
SYMBOL_VALUE (symbol), SYMBOL_BASEREG (symbol));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_TYPEDEF:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_LABEL:
|
|
|
|
|
fprintf_filtered (outfile, "label at ");
|
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
|
|
|
|
|
if (SYMBOL_BFD_SECTION (symbol))
|
|
|
|
|
fprintf_filtered (outfile, " section %s",
|
|
|
|
|
bfd_section_name
|
|
|
|
|
(SYMBOL_BFD_SECTION (symbol)->owner,
|
|
|
|
|
SYMBOL_BFD_SECTION (symbol)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_BLOCK:
|
|
|
|
|
fprintf_filtered (outfile, "block object ");
|
1999-09-09 08:02:17 +08:00
|
|
|
|
gdb_print_host_address (SYMBOL_BLOCK_VALUE (symbol), outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, ", ");
|
|
|
|
|
print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)),
|
|
|
|
|
1,
|
|
|
|
|
outfile);
|
|
|
|
|
fprintf_filtered (outfile, "..");
|
|
|
|
|
print_address_numeric (BLOCK_END (SYMBOL_BLOCK_VALUE (symbol)),
|
|
|
|
|
1,
|
|
|
|
|
outfile);
|
|
|
|
|
if (SYMBOL_BFD_SECTION (symbol))
|
|
|
|
|
fprintf_filtered (outfile, " section %s",
|
|
|
|
|
bfd_section_name
|
|
|
|
|
(SYMBOL_BFD_SECTION (symbol)->owner,
|
|
|
|
|
SYMBOL_BFD_SECTION (symbol)));
|
|
|
|
|
break;
|
|
|
|
|
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 23:24:18 +08:00
|
|
|
|
case LOC_COMPUTED:
|
|
|
|
|
case LOC_COMPUTED_ARG:
|
|
|
|
|
fprintf_filtered (outfile, "computed at runtime");
|
|
|
|
|
break;
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
case LOC_UNRESOLVED:
|
|
|
|
|
fprintf_filtered (outfile, "unresolved");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LOC_OPTIMIZED_OUT:
|
|
|
|
|
fprintf_filtered (outfile, "optimized out");
|
|
|
|
|
break;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
default:
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fprintf_filtered (outfile, "botched symbol class %x",
|
|
|
|
|
SYMBOL_CLASS (symbol));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
maintenance_print_psymbols (char *args, int from_tty)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
char **argv;
|
2000-02-02 08:21:19 +08:00
|
|
|
|
struct ui_file *outfile;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct cleanup *cleanups;
|
|
|
|
|
char *symname = NULL;
|
|
|
|
|
char *filename = DEV_TTY;
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
struct partial_symtab *ps;
|
|
|
|
|
|
|
|
|
|
dont_repeat ();
|
|
|
|
|
|
|
|
|
|
if (args == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("print-psymbols takes an output file name and optional symbol file name");
|
|
|
|
|
}
|
|
|
|
|
else if ((argv = buildargv (args)) == NULL)
|
|
|
|
|
{
|
|
|
|
|
nomem (0);
|
|
|
|
|
}
|
1999-04-27 02:34:20 +08:00
|
|
|
|
cleanups = make_cleanup_freeargv (argv);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (argv[0] != NULL)
|
|
|
|
|
{
|
|
|
|
|
filename = argv[0];
|
|
|
|
|
/* If a second arg is supplied, it is a source file name to match on */
|
|
|
|
|
if (argv[1] != NULL)
|
|
|
|
|
{
|
|
|
|
|
symname = argv[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filename = tilde_expand (filename);
|
2000-12-15 09:01:51 +08:00
|
|
|
|
make_cleanup (xfree, filename);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
outfile = gdb_fopen (filename, FOPEN_WT);
|
|
|
|
|
if (outfile == 0)
|
|
|
|
|
perror_with_name (filename);
|
2000-02-02 08:21:19 +08:00
|
|
|
|
make_cleanup_ui_file_delete (outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_PSYMTABS (objfile, ps)
|
2003-11-08 08:13:03 +08:00
|
|
|
|
if (symname == NULL || strcmp (symname, ps->filename) == 0)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
dump_psymtab (objfile, ps, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
immediate_quit--;
|
|
|
|
|
do_cleanups (cleanups);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
print_partial_symbols (struct partial_symbol **p, int count, char *what,
|
|
|
|
|
struct ui_file *outfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " %s partial symbols:\n", what);
|
|
|
|
|
while (count-- > 0)
|
|
|
|
|
{
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
fprintf_filtered (outfile, " `%s'", DEPRECATED_SYMBOL_NAME (*p));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (SYMBOL_DEMANGLED_NAME (*p) != NULL)
|
|
|
|
|
{
|
|
|
|
|
fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p));
|
|
|
|
|
}
|
|
|
|
|
fputs_filtered (", ", outfile);
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
switch (SYMBOL_DOMAIN (*p))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
case UNDEF_DOMAIN:
|
|
|
|
|
fputs_filtered ("undefined domain, ", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
case VAR_DOMAIN:
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* This is the usual thing -- don't print it */
|
|
|
|
|
break;
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
case STRUCT_DOMAIN:
|
|
|
|
|
fputs_filtered ("struct domain, ", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
case LABEL_DOMAIN:
|
|
|
|
|
fputs_filtered ("label domain, ", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
fputs_filtered ("<invalid domain>, ", outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
switch (SYMBOL_CLASS (*p))
|
|
|
|
|
{
|
|
|
|
|
case LOC_UNDEF:
|
|
|
|
|
fputs_filtered ("undefined", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_CONST:
|
|
|
|
|
fputs_filtered ("constant int", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_STATIC:
|
|
|
|
|
fputs_filtered ("static", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_INDIRECT:
|
|
|
|
|
fputs_filtered ("extern global", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_REGISTER:
|
|
|
|
|
fputs_filtered ("register", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_ARG:
|
|
|
|
|
fputs_filtered ("pass by value", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_REF_ARG:
|
|
|
|
|
fputs_filtered ("pass by reference", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_REGPARM:
|
|
|
|
|
fputs_filtered ("register parameter", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_REGPARM_ADDR:
|
|
|
|
|
fputs_filtered ("register address parameter", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_LOCAL:
|
|
|
|
|
fputs_filtered ("stack parameter", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_TYPEDEF:
|
|
|
|
|
fputs_filtered ("type", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_LABEL:
|
|
|
|
|
fputs_filtered ("label", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_BLOCK:
|
|
|
|
|
fputs_filtered ("function", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_CONST_BYTES:
|
|
|
|
|
fputs_filtered ("constant bytes", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_LOCAL_ARG:
|
|
|
|
|
fputs_filtered ("shuffled arg", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_UNRESOLVED:
|
|
|
|
|
fputs_filtered ("unresolved", outfile);
|
|
|
|
|
break;
|
|
|
|
|
case LOC_OPTIMIZED_OUT:
|
|
|
|
|
fputs_filtered ("optimized out", outfile);
|
|
|
|
|
break;
|
Based on a patch from Daniel Berlin (dberlin@dberlin.org).
* symtab.h: Add opaque declarations of struct axs_value and
struct agent_expr.
(enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG.
(struct location_funcs): New type.
(struct symbol): Add "loc" to aux_value.
(SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros.
* dwarf2read.c: Include "dwarf2expr.h".
(dwarf2_symbol_mark_computed): New function.
(read_func_scope): Use it.
(var_decode_location): New function.
(new_symbol): Use it.
* dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files.
* Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c.
(dwarf2expr_h, dwarf2loc_h): New variables.
(COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o.
(dwarf2expr.o, dwarf2loc.o): New rules.
(dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h).
* buildsym.c (finish_block): Handle LOC_COMPUTED and
LOC_COMPUTED_ARG.
* findvar.c (symbol_read_needs_frame, read_var_value): Likewise.
* m2-exp.y (yylex): Likewise.
* printcmd.c (address_info, print_frame_args): Likewise.
* stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise.
* symmisc.c (print_symbol, print_partial_symbols): Likewise.
* ada-lang.c (ada_resolve_subexp, symtab_for_sym)
(ada_add_block_symbols, fill_in_ada_prototype): Likewise.
* symtab.c (lookup_block_symbol): Likewise.
2003-02-21 23:24:18 +08:00
|
|
|
|
case LOC_COMPUTED:
|
|
|
|
|
case LOC_COMPUTED_ARG:
|
|
|
|
|
fputs_filtered ("computed at runtime", outfile);
|
|
|
|
|
break;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
default:
|
|
|
|
|
fputs_filtered ("<invalid location>", outfile);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
fputs_filtered (", ", outfile);
|
|
|
|
|
print_address_numeric (SYMBOL_VALUE_ADDRESS (*p), 1, outfile);
|
|
|
|
|
fprintf_filtered (outfile, "\n");
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
maintenance_print_msymbols (char *args, int from_tty)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
char **argv;
|
2000-02-02 08:21:19 +08:00
|
|
|
|
struct ui_file *outfile;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct cleanup *cleanups;
|
|
|
|
|
char *filename = DEV_TTY;
|
|
|
|
|
char *symname = NULL;
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
|
|
dont_repeat ();
|
|
|
|
|
|
|
|
|
|
if (args == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("print-msymbols takes an output file name and optional symbol file name");
|
|
|
|
|
}
|
|
|
|
|
else if ((argv = buildargv (args)) == NULL)
|
|
|
|
|
{
|
|
|
|
|
nomem (0);
|
|
|
|
|
}
|
1999-04-27 02:34:20 +08:00
|
|
|
|
cleanups = make_cleanup_freeargv (argv);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (argv[0] != NULL)
|
|
|
|
|
{
|
|
|
|
|
filename = argv[0];
|
|
|
|
|
/* If a second arg is supplied, it is a source file name to match on */
|
|
|
|
|
if (argv[1] != NULL)
|
|
|
|
|
{
|
|
|
|
|
symname = argv[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filename = tilde_expand (filename);
|
2000-12-15 09:01:51 +08:00
|
|
|
|
make_cleanup (xfree, filename);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
outfile = gdb_fopen (filename, FOPEN_WT);
|
|
|
|
|
if (outfile == 0)
|
|
|
|
|
perror_with_name (filename);
|
2000-02-02 08:21:19 +08:00
|
|
|
|
make_cleanup_ui_file_delete (outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_OBJFILES (objfile)
|
2003-11-08 08:13:03 +08:00
|
|
|
|
if (symname == NULL || strcmp (symname, objfile->name) == 0)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
dump_msymbols (objfile, outfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
immediate_quit--;
|
|
|
|
|
fprintf_filtered (outfile, "\n\n");
|
|
|
|
|
do_cleanups (cleanups);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
maintenance_print_objfiles (char *ignore, int from_tty)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
|
|
dont_repeat ();
|
|
|
|
|
|
|
|
|
|
immediate_quit++;
|
|
|
|
|
ALL_OBJFILES (objfile)
|
|
|
|
|
dump_objfile (objfile);
|
|
|
|
|
immediate_quit--;
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-15 02:42:28 +08:00
|
|
|
|
|
2003-05-08 05:42:48 +08:00
|
|
|
|
/* List all the symbol tables whose names match REGEXP (optional). */
|
2003-04-15 02:42:28 +08:00
|
|
|
|
void
|
2003-05-08 05:42:48 +08:00
|
|
|
|
maintenance_info_symtabs (char *regexp, int from_tty)
|
2003-04-15 02:42:28 +08:00
|
|
|
|
{
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
|
|
if (regexp)
|
|
|
|
|
re_comp (regexp);
|
|
|
|
|
|
|
|
|
|
ALL_OBJFILES (objfile)
|
|
|
|
|
{
|
|
|
|
|
struct symtab *symtab;
|
|
|
|
|
|
|
|
|
|
/* We don't want to print anything for this objfile until we
|
|
|
|
|
actually find a symtab whose name matches. */
|
|
|
|
|
int printed_objfile_start = 0;
|
|
|
|
|
|
|
|
|
|
ALL_OBJFILE_SYMTABS (objfile, symtab)
|
|
|
|
|
if (! regexp
|
|
|
|
|
|| re_exec (symtab->filename))
|
|
|
|
|
{
|
|
|
|
|
if (! printed_objfile_start)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("{ objfile %s ", objfile->name);
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
printf_filtered ("((struct objfile *) %p)\n", objfile);
|
|
|
|
|
printed_objfile_start = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf_filtered (" { symtab %s ", symtab->filename);
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
printf_filtered ("((struct symtab *) %p)\n", symtab);
|
|
|
|
|
printf_filtered (" dirname %s\n",
|
|
|
|
|
symtab->dirname ? symtab->dirname : "(null)");
|
|
|
|
|
printf_filtered (" fullname %s\n",
|
|
|
|
|
symtab->fullname ? symtab->fullname : "(null)");
|
|
|
|
|
printf_filtered (" blockvector ((struct blockvector *) %p)%s\n",
|
|
|
|
|
symtab->blockvector,
|
|
|
|
|
symtab->primary ? " (primary)" : "");
|
|
|
|
|
printf_filtered (" debugformat %s\n", symtab->debugformat);
|
|
|
|
|
printf_filtered (" }\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (printed_objfile_start)
|
|
|
|
|
printf_filtered ("}\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-08 05:42:48 +08:00
|
|
|
|
/* List all the partial symbol tables whose names match REGEXP (optional). */
|
2003-04-15 02:42:28 +08:00
|
|
|
|
void
|
2003-05-08 05:42:48 +08:00
|
|
|
|
maintenance_info_psymtabs (char *regexp, int from_tty)
|
2003-04-15 02:42:28 +08:00
|
|
|
|
{
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
|
|
if (regexp)
|
|
|
|
|
re_comp (regexp);
|
|
|
|
|
|
|
|
|
|
ALL_OBJFILES (objfile)
|
|
|
|
|
{
|
|
|
|
|
struct partial_symtab *psymtab;
|
|
|
|
|
|
|
|
|
|
/* We don't want to print anything for this objfile until we
|
|
|
|
|
actually find a symtab whose name matches. */
|
|
|
|
|
int printed_objfile_start = 0;
|
|
|
|
|
|
|
|
|
|
ALL_OBJFILE_PSYMTABS (objfile, psymtab)
|
|
|
|
|
if (! regexp
|
|
|
|
|
|| re_exec (psymtab->filename))
|
|
|
|
|
{
|
|
|
|
|
if (! printed_objfile_start)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("{ objfile %s ", objfile->name);
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
printf_filtered ("((struct objfile *) %p)\n", objfile);
|
|
|
|
|
printed_objfile_start = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf_filtered (" { psymtab %s ", psymtab->filename);
|
|
|
|
|
wrap_here (" ");
|
|
|
|
|
printf_filtered ("((struct partial_symtab *) %p)\n", psymtab);
|
|
|
|
|
printf_filtered (" readin %s\n",
|
|
|
|
|
psymtab->readin ? "yes" : "no");
|
|
|
|
|
printf_filtered (" fullname %s\n",
|
|
|
|
|
psymtab->fullname ? psymtab->fullname : "(null)");
|
|
|
|
|
printf_filtered (" text addresses ");
|
|
|
|
|
print_address_numeric (psymtab->textlow, 1, gdb_stdout);
|
|
|
|
|
printf_filtered (" -- ");
|
|
|
|
|
print_address_numeric (psymtab->texthigh, 1, gdb_stdout);
|
|
|
|
|
printf_filtered ("\n");
|
|
|
|
|
printf_filtered (" globals ");
|
|
|
|
|
if (psymtab->n_global_syms)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
|
|
|
|
|
(psymtab->objfile->global_psymbols.list
|
|
|
|
|
+ psymtab->globals_offset),
|
|
|
|
|
psymtab->n_global_syms);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf_filtered ("(none)\n");
|
|
|
|
|
printf_filtered (" statics ");
|
|
|
|
|
if (psymtab->n_static_syms)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
|
|
|
|
|
(psymtab->objfile->static_psymbols.list
|
|
|
|
|
+ psymtab->statics_offset),
|
|
|
|
|
psymtab->n_static_syms);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf_filtered ("(none)\n");
|
|
|
|
|
printf_filtered (" dependencies ");
|
|
|
|
|
if (psymtab->number_of_dependencies)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
printf_filtered ("{\n");
|
|
|
|
|
for (i = 0; i < psymtab->number_of_dependencies; i++)
|
|
|
|
|
{
|
|
|
|
|
struct partial_symtab *dep = psymtab->dependencies[i];
|
|
|
|
|
|
|
|
|
|
/* Note the string concatenation there --- no comma. */
|
|
|
|
|
printf_filtered (" psymtab %s "
|
|
|
|
|
"((struct partial_symtab *) %p)\n",
|
|
|
|
|
dep->filename, dep);
|
|
|
|
|
}
|
|
|
|
|
printf_filtered (" }\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf_filtered ("(none)\n");
|
|
|
|
|
printf_filtered (" }\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (printed_objfile_start)
|
|
|
|
|
printf_filtered ("}\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Check consistency of psymtabs and symtabs. */
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
maintenance_check_symtabs (char *ignore, int from_tty)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-09-14 Andrew Cagney <cagney@redhat.com>
* alpha-nat.c: Remove some occurances of "register".
* alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
* buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
* corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
* dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
* environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
* f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
* h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
* hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
* infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
* jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
* mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
* mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
* ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
* p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
* remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
* rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
* solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
* stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
* symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
* typeprint.c, utils.c, valarith.c, valops.c: Ditto.
* values.c, vax-tdep.c, xcoffread.c: Ditto.
2003-09-15 00:32:14 +08:00
|
|
|
|
struct symbol *sym;
|
|
|
|
|
struct partial_symbol **psym;
|
|
|
|
|
struct symtab *s = NULL;
|
|
|
|
|
struct partial_symtab *ps;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct blockvector *bv;
|
2003-09-14 Andrew Cagney <cagney@redhat.com>
* alpha-nat.c: Remove some occurances of "register".
* alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
* buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
* corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
* dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
* environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
* f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
* h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
* hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
* infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
* jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
* mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
* mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
* ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
* p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
* remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
* rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
* solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
* stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
* symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
* typeprint.c, utils.c, valarith.c, valops.c: Ditto.
* values.c, vax-tdep.c, xcoffread.c: Ditto.
2003-09-15 00:32:14 +08:00
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
struct block *b;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int length;
|
|
|
|
|
|
|
|
|
|
ALL_PSYMTABS (objfile, ps)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
s = PSYMTAB_TO_SYMTAB (ps);
|
|
|
|
|
if (s == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
bv = BLOCKVECTOR (s);
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
|
|
|
|
|
psym = ps->objfile->static_psymbols.list + ps->statics_offset;
|
|
|
|
|
length = ps->n_static_syms;
|
|
|
|
|
while (length--)
|
|
|
|
|
{
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
NULL, SYMBOL_DOMAIN (*psym));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (!sym)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Static symbol `");
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
puts_filtered (DEPRECATED_SYMBOL_NAME (*psym));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
printf_filtered ("' only found in ");
|
|
|
|
|
puts_filtered (ps->filename);
|
|
|
|
|
printf_filtered (" psymtab\n");
|
|
|
|
|
}
|
|
|
|
|
psym++;
|
|
|
|
|
}
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
|
|
|
|
psym = ps->objfile->global_psymbols.list + ps->globals_offset;
|
|
|
|
|
length = ps->n_global_syms;
|
|
|
|
|
while (length--)
|
|
|
|
|
{
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym),
|
2003-05-14 Elena Zannoni <ezannoni@redhat.com>
* symtab.h (enum domain_enum): Rename from namespace_enum.
(UNDEF_DOMAIN, VAR_DOMAIN, STRUCT_DOMAIN, LABEL_DOMAIN,
VARIABLES_DOMAIN, FUNCTIONS_DOMAIN, TYPES_DOMAIN, METHODS_DOMAIN):
Rename from UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE,
LABEL_NAMESPACE, VARIABLES_NAMESPACE, FUNCTIONS_NAMESPACE,
TYPES_NAMESPACE, METHODS_NAMESPACE.
(SYMBOL_NAMESPACE): Rename to SYMBOL_DOMAIN.
(struct symbol, struct partial_symbol): Rename field
'namespace_enum namespace' to 'domain_enum domain'.
(PSYMBOL_NAMESPACE): Rename to PSYMBOL_DOMAIN.
Delete old define kludge for namespace.
* ada-exp.y, ada-lang.c, ada-lang.h, alpha-tdep.c, arm-tdep.c,
blockframe.c, c-exp.y, c-valprint.c, coffread.c, dbxread.c,
dwarf2read.c, dwarfread.c, f-exp.y, gdbtypes.c, gdbtypes.h,
gnu-v3-abi.c, hppa-tdep.c, hpread.c, jv-exp.y, jv-lang.c,
language.c, linespec.c, m2-exp.y, m3-nat.c, mdebugread.c,
mips-tdep.c, nlmread.c, objc-exp.y, objc-lang.c, objfiles.c,
p-exp.y, p-valprint.c, parse.c, printcmd.c, scm-lang.c, source.c,
stabsread.c, stack.c, symfile.c, symfile.h, symmisc.c, symtab.c,
valops.c, values.c, xcoffread.c, xstormy16-tdep.c: Replace all
occurrences of the above.
2003-05-12 Elena Zannoni <ezannoni@redhat.com>
* mi-mi-cmd-stack.c (list_args_or_locals): Rename VAR_NAMESPACE to
VAR_DOMAIN.
2003-05-15 01:43:20 +08:00
|
|
|
|
NULL, SYMBOL_DOMAIN (*psym));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (!sym)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Global symbol `");
|
2003-02-25 David Carlton <carlton@math.stanford.edu>
* symtab.h (SYMBOL_NATURAL_NAME): New macro.
(SYMBOL_LINKAGE_NAME): Ditto.
(SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and
SYMBOL_LINKAGE_NAME.
(struct general_symbol_info): Expand comment.
(DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME.
(SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME.
(SYMBOL_MATCHES_REGEXP): Ditto.
* symtab.c (symbol_natural_name): New function.
* objfiles.h: Replace all uses of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto.
* symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto.
* somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto.
* printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto.
* minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto.
* i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto.
* gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto.
* dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto.
* cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto.
* blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto.
* ada-exp.y: Ditto.
* ada-exp.y: Update copyright.
* sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto.
* cp-valprint.c: Ditto.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
DEPRECATED_SYMBOL_NAME.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
* generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
2003-02-25 David Carlton <carlton@math.stanford.edu>
* mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with
DEPRECATED_SYMBOL_NAME. Update copyright.
2003-02-26 05:36:23 +08:00
|
|
|
|
puts_filtered (DEPRECATED_SYMBOL_NAME (*psym));
|
1999-07-08 04:19:36 +08:00
|
|
|
|
printf_filtered ("' only found in ");
|
|
|
|
|
puts_filtered (ps->filename);
|
|
|
|
|
printf_filtered (" psymtab\n");
|
|
|
|
|
}
|
|
|
|
|
psym++;
|
|
|
|
|
}
|
|
|
|
|
if (ps->texthigh < ps->textlow)
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Psymtab ");
|
|
|
|
|
puts_filtered (ps->filename);
|
|
|
|
|
printf_filtered (" covers bad range ");
|
|
|
|
|
print_address_numeric (ps->textlow, 1, gdb_stdout);
|
|
|
|
|
printf_filtered (" - ");
|
|
|
|
|
print_address_numeric (ps->texthigh, 1, gdb_stdout);
|
|
|
|
|
printf_filtered ("\n");
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
|
|
|
|
if (ps->texthigh == 0)
|
|
|
|
|
continue;
|
|
|
|
|
if (ps->textlow < BLOCK_START (b) || ps->texthigh > BLOCK_END (b))
|
|
|
|
|
{
|
|
|
|
|
printf_filtered ("Psymtab ");
|
|
|
|
|
puts_filtered (ps->filename);
|
|
|
|
|
printf_filtered (" covers ");
|
|
|
|
|
print_address_numeric (ps->textlow, 1, gdb_stdout);
|
|
|
|
|
printf_filtered (" - ");
|
|
|
|
|
print_address_numeric (ps->texthigh, 1, gdb_stdout);
|
|
|
|
|
printf_filtered (" but symtab covers only ");
|
|
|
|
|
print_address_numeric (BLOCK_START (b), 1, gdb_stdout);
|
|
|
|
|
printf_filtered (" - ");
|
|
|
|
|
print_address_numeric (BLOCK_END (b), 1, gdb_stdout);
|
|
|
|
|
printf_filtered ("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Return the nexting depth of a block within other blocks in its symtab. */
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-30 09:48:28 +08:00
|
|
|
|
block_depth (struct block *block)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-09-14 Andrew Cagney <cagney@redhat.com>
* alpha-nat.c: Remove some occurances of "register".
* alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
* buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
* corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
* dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
* environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
* f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
* h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
* hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
* infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
* jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
* mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
* mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
* ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
* p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
* remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
* rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
* solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
* stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
* symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
* typeprint.c, utils.c, valarith.c, valops.c: Ditto.
* values.c, vax-tdep.c, xcoffread.c: Ditto.
2003-09-15 00:32:14 +08:00
|
|
|
|
int i = 0;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Increase the space allocated for LISTP, which is probably
|
|
|
|
|
global_psymbols or static_psymbols. This space will eventually
|
|
|
|
|
be freed in free_objfile(). */
|
|
|
|
|
|
|
|
|
|
void
|
2003-09-16 Andrew Cagney <cagney@redhat.com>
* buildsym.c: Remove more occurances of "register".
* coffread.c, dbxread.c, dcache.c, dwarf2read.c: Ditto.
* environ.c, eval.c, f-valprint.c, findvar.c: Ditto.
* gdbtypes.c, gnu-v2-abi.c, h8300-tdep.c, hppa-tdep.c: Ditto.
* infcmd.c, mdebugread.c, minsyms.c, mips-tdep.c: Ditto.
* printcmd.c, remote-vx.c, sh-stub.c, sh-tdep.c: Ditto.
* sh64-tdep.c, source.c, stabsread.c, stack.c: Ditto.
* standalone.c, symfile.c, symmisc.c, symtab.c: Ditto.
* utils.c, valops.c, values.c, xcoffread.c: Ditto.
2003-09-17 02:56:35 +08:00
|
|
|
|
extend_psymbol_list (struct psymbol_allocation_list *listp,
|
2000-07-30 09:48:28 +08:00
|
|
|
|
struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
int new_size;
|
|
|
|
|
if (listp->size == 0)
|
|
|
|
|
{
|
|
|
|
|
new_size = 255;
|
|
|
|
|
listp->list = (struct partial_symbol **)
|
2004-08-11 03:37:47 +08:00
|
|
|
|
xmalloc (new_size * sizeof (struct partial_symbol *));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
new_size = listp->size * 2;
|
|
|
|
|
listp->list = (struct partial_symbol **)
|
2004-08-11 04:03:32 +08:00
|
|
|
|
xrealloc ((char *) listp->list,
|
|
|
|
|
new_size * sizeof (struct partial_symbol *));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
/* Next assumes we only went one over. Should be good if
|
|
|
|
|
program works correctly */
|
|
|
|
|
listp->next = listp->list + listp->size;
|
|
|
|
|
listp->size = new_size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Do early runtime initializations. */
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
_initialize_symmisc (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
std_in = stdin;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
std_out = stdout;
|
|
|
|
|
std_err = stderr;
|
|
|
|
|
}
|