1999-04-16 09:35:26 +08:00
|
|
|
|
/* Read a symbol table in ECOFF format (Third-Eye).
|
2004-01-18 09:22:57 +08:00
|
|
|
|
|
2014-01-01 11:54:24 +08:00
|
|
|
|
Copyright (C) 1986-2014 Free Software Foundation, Inc.
|
2004-01-18 09:22:57 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
|
|
|
|
|
CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor
|
|
|
|
|
at Cygnus Support.
|
|
|
|
|
|
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
|
2007-08-24 02:08:50 +08:00
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(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
|
2007-08-24 02:08:50 +08:00
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* This module provides the function mdebug_build_psymtabs. It reads
|
|
|
|
|
ECOFF debugging information into partial symbol tables. The
|
|
|
|
|
debugging information is read from two structures. A struct
|
|
|
|
|
ecoff_debug_swap includes the sizes of each ECOFF structure and
|
|
|
|
|
swapping routines; these are fixed for a particular target. A
|
|
|
|
|
struct ecoff_debug_info points to the debugging information for a
|
|
|
|
|
particular object file.
|
|
|
|
|
|
|
|
|
|
ECOFF symbol tables are mostly written in the byte order of the
|
|
|
|
|
target machine. However, one section of the table (the auxiliary
|
|
|
|
|
symbol information) is written in the host byte order. There is a
|
|
|
|
|
bit in the other symbol info which describes which host byte order
|
|
|
|
|
was used. ECOFF thereby takes the trophy from Intel `b.out' for
|
|
|
|
|
the most brain-dead adaptation of a file format to byte order.
|
|
|
|
|
|
|
|
|
|
This module can read all four of the known byte-order combinations,
|
|
|
|
|
on any type of host. */
|
|
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
#include "symtab.h"
|
|
|
|
|
#include "gdbtypes.h"
|
|
|
|
|
#include "gdbcore.h"
|
2011-03-24 02:23:56 +08:00
|
|
|
|
#include "filenames.h"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
#include "objfiles.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 "buildsym.h"
|
|
|
|
|
#include "stabsread.h"
|
|
|
|
|
#include "complaints.h"
|
|
|
|
|
#include "demangle.h"
|
2011-11-11 04:21:29 +08:00
|
|
|
|
#include "gdb-demangle.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-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"
|
2004-10-31 11:42:52 +08:00
|
|
|
|
#include "mdebugread.h"
|
remove gdb_stat.h
This patch is purely mechanical. It removes gdb_stat.h and changes
the code to use sys/stat.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_stat.h: Remove.
* ada-lang.c: Use sys/stat.h, not gdb_stat.h.
* common/filestuff.c: Use sys/stat.h, not gdb_stat.h.
* common/linux-osdata.c: Use sys/stat.h, not gdb_stat.h.
* corefile.c: Use sys/stat.h, not gdb_stat.h.
* ctf.c: Use sys/stat.h, not gdb_stat.h.
* darwin-nat.c: Use sys/stat.h, not gdb_stat.h.
* dbxread.c: Use sys/stat.h, not gdb_stat.h.
* dwarf2read.c: Use sys/stat.h, not gdb_stat.h.
* exec.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/linux-low.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/remote-utils.c: Use sys/stat.h, not gdb_stat.h.
* inf-child.c: Use sys/stat.h, not gdb_stat.h.
* jit.c: Use sys/stat.h, not gdb_stat.h.
* linux-nat.c: Use sys/stat.h, not gdb_stat.h.
* m68klinux-nat.c: Use sys/stat.h, not gdb_stat.h.
* main.c: Use sys/stat.h, not gdb_stat.h.
* mdebugread.c: Use sys/stat.h, not gdb_stat.h.
* mi/mi-cmd-env.c: Use sys/stat.h, not gdb_stat.h.
* nto-tdep.c: Use sys/stat.h, not gdb_stat.h.
* objfiles.c: Use sys/stat.h, not gdb_stat.h.
* procfs.c: Use sys/stat.h, not gdb_stat.h.
* remote-fileio.c: Use sys/stat.h, not gdb_stat.h.
* remote-mips.c: Use sys/stat.h, not gdb_stat.h.
* remote.c: Use sys/stat.h, not gdb_stat.h.
* rs6000-nat.c: Use sys/stat.h, not gdb_stat.h.
* sol-thread.c: Use sys/stat.h, not gdb_stat.h.
* solib-spu.c: Use sys/stat.h, not gdb_stat.h.
* source.c: Use sys/stat.h, not gdb_stat.h.
* symfile.c: Use sys/stat.h, not gdb_stat.h.
* symmisc.c: Use sys/stat.h, not gdb_stat.h.
* symtab.c: Use sys/stat.h, not gdb_stat.h.
* top.c: Use sys/stat.h, not gdb_stat.h.
* xcoffread.c: Use sys/stat.h, not gdb_stat.h.
2013-11-06 22:55:51 +08:00
|
|
|
|
#include <sys/stat.h>
|
gdb
* xcoffread.c: Include psymtab.h.
(xcoff_sym_fns): Update.
* symtab.h (struct partial_symbol): Remove.
(PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove.
(struct partial_symtab): Remove.
(PSYMTAB_TO_SYMTAB): Remove.
(lookup_partial_symbol, lookup_partial_symtab, find_pc_psymtab)
(find_pc_sect_psymtab): Remove.
(find_pc_sect_symtab_via_partial): Declare.
(find_pc_psymtab, find_pc_sect_psymbol, psymtab_to_symtab)
(find_main_psymtab): Remove.
(find_main_filename): Declare.
(fixup_psymbol_section): Remove.
(fixup_section): Declare.
* symtab.c: Include psymtab.h.
(lookup_symtab): Use lookup_symtab method.
(lookup_partial_symtab): Remove.
(find_pc_sect_psymtab_closer): Remove.
(find_pc_sect_psymtab): Remove.
(find_pc_sect_symtab_via_partial): New function.
(find_pc_psymtab, find_pc_sect_psymbol, find_pc_psymbol): Remove.
(fixup_section): No longer static.
(fixup_psymbol_section): Remove.
(lookup_symbol_aux): Use lookup_symbol_aux_quick.
(lookup_global_symbol_from_objfile): Likewise.
(lookup_symbol_aux_psymtabs): Remove.
(lookup_symbol_aux_quick): New function.
(lookup_symbol_global): Use lookup_symbol_aux_quick.
(lookup_partial_symbol): Remove.
(basic_lookup_transparent_type_quick): New function.
(basic_lookup_transparent_type): Use it.
(find_main_psymtab): Remove.
(find_main_filename): New function.
(find_pc_sect_symtab): Use find_pc_sect_symtab method.
(find_line_symtab): Use expand_symtabs_with_filename method.
(output_partial_symbol_filename): New function.
(sources_info): Use map_partial_symbol_filenames.
(struct search_symbols_data): New type.
(search_symbols_file_matches): New function.
(search_symbols_name_matches): Likewise.
(search_symbols): Use expand_symtabs_matching method.
(struct add_name_data): Rename from add_macro_name_data.
(add_macro_name): Update.
(add_partial_symbol_name): New function.
(default_make_symbol_completion_list): Use
map_partial_symbol_names.
(struct add_partial_symbol_name): New type.
(maybe_add_partial_symtab_filename): New function.
(make_source_files_completion_list): Use
map_partial_symbol_filenames.
(expand_line_sal): Use expand_symtabs_with_filename method.
* symmisc.c: Include psymtab.h.
(print_objfile_statistics): Use print_stats method.
(dump_objfile): Use dump method.
(dump_psymtab, maintenance_print_psymbols)
(maintenance_info_psymtabs, maintenance_check_symtabs)
(extend_psymbol_list): Remove.
* symfile.h (struct quick_symbol_functions): New struct.
(struct sym_fns) <qf>: New field.
(sort_pst_symbols): Remove.
(increment_reading_symtab): Declare.
* symfile.c: Include psymtab.h.
(compare_psymbols, sort_pst_symbols): Remove.
(psymtab_to_symtab): Remove.
(increment_reading_symtab): New function.
(symbol_file_add_with_addrs_or_offsets): Use expand_all_symtabs
method.
(set_initial_language): Use find_main_filename.
(allocate_psymtab, discard_psymtab, cashier_psymtab): Remove.
(free_named_symtabs): Remove unused code.
(start_psymtab_common, add_psymbol_to_bcache)
(append_psymbol_to_list, add_psymbol_to_list, init_psymbol_list):
Remove.
* stack.c: Include psymtab.h, symfile.h.
(backtrace_command_1): Use find_pc_sect_symtab_via_partial.
* source.h (psymtab_to_fullname): Don't declare.
* source.c: Include psymtab.h.
(select_source_symtab): Use find_last_source_symtab method.
(forget_cached_source_info): Use forget_cached_source_info
method.
(find_and_open_source): No longer static.
(psymtab_to_fullname): Remove.
* somread.c: Include psymtab.h.
(som_sym_fns): Update.
* psympriv.h: New file.
* psymtab.h: New file.
* psymtab.c: New file.
* objfiles.h: (ALL_OBJFILE_PSYMTABS): Remove.
(ALL_PSYMTABS, ALL_PSPACE_PSYMTABS): Likewise.
* objfiles.c: Include psymtab.h.
(objfile_relocate1): Use relocate method.
(objfile_has_partial_symbols): Use has_symbols method.
* mipsread.c: Include psymtab.h.
(ecoff_sym_fns): Update.
* mi/mi-cmd-file.c: Include psymtab.h.
(print_partial_file_name): New function.
(mi_cmd_file_list_exec_source_files): Use
map_partial_symbol_filenames.
* mdebugread.c: Include psympriv.h.
* machoread.c: Include psympriv.h.
(macho_sym_fns): Update.
* m2-exp.y (yylex): Use lookup_symtab.
* elfread.c: Include psympriv.h.
(elf_sym_fns): Update.
* dwarf2read.c: Include psympriv.h.
* dbxread.c: Include psympriv.h.
(aout_sym_fns): Update.
* cp-support.c: Include psymtab.h.
(read_in_psymtabs): Remove.
(make_symbol_overload_list_qualified): Use
expand_symtabs_for_function method.
* coffread.c: Include psympriv.h.
(coff_sym_fns): Update.
* blockframe.c: Include psymtab.h.
(find_pc_partial_function): Use find_pc_sect_symtab method.
* ada-lang.h (ada_update_initial_language): Update.
* ada-lang.c: Include psymtab.h.
(ada_update_initial_language): Remove 'main_pst' argument.
(ada_lookup_partial_symbol): Remove.
(struct ada_psym_data): New type.
(ada_add_psyms): New function.
(ada_add_non_local_symbols): Use map_ada_symtabs method.
(struct add_partial_datum): New type.
(ada_add_partial_symbol_completions): New function.
(ada_make_symbol_completion_list): Use map_partial_symbol_names.
(ada_exception_support_info_sniffer): Update.
* Makefile.in (SFILES): Add psymtab.c.
(COMMON_OBS): Add psymtab.o.
(HFILES_NO_SRCDIR): Add psymtab.h, psympriv.h.
gdb/doc
* gdbint.texinfo (Symbol Handling): Update.
2010-03-11 02:20:08 +08:00
|
|
|
|
#include "psympriv.h"
|
gdb/
* ada-lang.c (user_select_syms): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* breakpoint.c (print_breakpoint_location, resolve_sal_pc): Likewise.
(clear_command): New variable sal_fullname, initialize it. Replace
compare_filenames_for_search by filename_cmp with sal_fullname.
(say_where, update_static_tracepoint): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* cli/cli-cmds.c (edit_command, list_command, ambiguous_line_spec):
Likewise.
* dwarf2read.c: Include source.h.
(fixup_go_packaging): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* linespec.c (add_sal_to_sals): Rename variable filename to fullname.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(create_sals_line_offset, convert_linespec_to_sals): New variable
fullname, initialize it, replace symtab->filename reference by the
variable.
* linux-fork.c: Include source.h.
(info_checkpoints_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* macroscope.c (sal_macro_scope): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* mdebugread.c: Include source.h.
(psymtab_to_symtab_1): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(mi_cmd_file_list_exec_source_files): Likewise.
* printcmd.c: Include source.h.
(build_address_symbolic): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* psymtab.c (partial_map_symtabs_matching_filename)
(read_psymtabs_with_fullname): Call compare_filenames_for_search also
with psymtab_to_fullname.
* python/py-symtab.c (stpy_str): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(stpy_get_filename): New variable filename, initialize it, use instead
of symtab->filename refererences.
(salpy_str): Make variable filename const char *. Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
* skip.c: Include source.h and filenames.h.
(skip_file_command): Remove const from the symtab variable. Replace
symtab->filename refererences by symtab_to_fullname call.
(function_name_is_marked_for_skip): New variables searched_for_fullname
and fullname. Use them to search also with symtab's fullname.
* source.c (find_source_lines): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(print_source_lines_base): New variable filename, use it instead of
symtab->filename. Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(line_info, forward_search_command): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
(reverse_search_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls. New variable filename for it.
* stack.c (frame_info): Likewise.
* symmisc.c: Include source.h.
(dump_objfile, dump_symtab_1, maintenance_print_symbols)
(maintenance_info_symtabs): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* symtab.c (iterate_over_some_symtabs): Call
compare_filenames_for_search also with symtab_to_fullname.
(lookup_symbol_aux_quick, basic_lookup_transparent_type_quick): Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
(find_line_symtab): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(file_matches): Replace filename_cmp by compare_filenames_for_search.
(print_symbol_info): Make the last parameter const char *. New
variable s_filename. Use it in the function.
(symtab_symbol_info): Make the last_filename variable const char *.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(rbreak_command): New variable fullname. Use it. Replace
symtab->filename refererence by symtab_to_filename_for_display call.
* tracepoint.c (set_traceframe_context, trace_find_line_command)
(print_one_static_tracepoint_marker): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* tui/tui-source.c (tui_set_source_content): New variables filename and
s_filename. Replace symtab->filename refererences by this variable.
Replace other symtab->filename refererences by
symtab_to_filename_for_display calls.
2013-02-04 00:13:31 +08:00
|
|
|
|
#include "source.h"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#include "bfd.h"
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
#include "coff/ecoff.h" /* COFF-like aspects of ecoff files. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#include "libaout.h" /* Private BFD a.out information. */
|
|
|
|
|
#include "aout/aout64.h"
|
2011-01-09 11:20:33 +08:00
|
|
|
|
#include "aout/stab_gnu.h" /* STABS information. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#include "expression.h"
|
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
extern void _initialize_mdebugread (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
We use this define in order to know whether we should override a
|
|
|
|
|
symbol's ECOFF section with its ELF section. This is necessary in
|
|
|
|
|
case the symbol's ELF section could not be represented in ECOFF. */
|
|
|
|
|
#define ECOFF_IN_ELF(bfd) (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
|
|
|
|
|
&& bfd_get_section_by_name (bfd, ".mdebug") != NULL)
|
2011-06-15 00:49:41 +08:00
|
|
|
|
|
|
|
|
|
/* The objfile we are currently reading. */
|
|
|
|
|
|
2011-06-15 02:53:14 +08:00
|
|
|
|
static struct objfile *mdebugread_objfile;
|
2011-06-15 00:49:41 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* We put a pointer to this structure in the read_symtab_private field
|
|
|
|
|
of the psymtab. */
|
|
|
|
|
|
|
|
|
|
struct symloc
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
/* Index of the FDR that this psymtab represents. */
|
|
|
|
|
int fdr_idx;
|
|
|
|
|
/* The BFD that the psymtab was created from. */
|
|
|
|
|
bfd *cur_bfd;
|
|
|
|
|
const struct ecoff_debug_swap *debug_swap;
|
|
|
|
|
struct ecoff_debug_info *debug_info;
|
|
|
|
|
struct mdebug_pending **pending_list;
|
|
|
|
|
/* Pointer to external symbols for this file. */
|
|
|
|
|
EXTR *extern_tab;
|
|
|
|
|
/* Size of extern_tab. */
|
|
|
|
|
int extern_count;
|
|
|
|
|
enum language pst_language;
|
|
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#define PST_PRIVATE(p) ((struct symloc *)(p)->read_symtab_private)
|
|
|
|
|
#define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx)
|
|
|
|
|
#define CUR_BFD(p) (PST_PRIVATE(p)->cur_bfd)
|
|
|
|
|
#define DEBUG_SWAP(p) (PST_PRIVATE(p)->debug_swap)
|
|
|
|
|
#define DEBUG_INFO(p) (PST_PRIVATE(p)->debug_info)
|
|
|
|
|
#define PENDING_LIST(p) (PST_PRIVATE(p)->pending_list)
|
|
|
|
|
|
|
|
|
|
#define SC_IS_TEXT(sc) ((sc) == scText \
|
|
|
|
|
|| (sc) == scRConst \
|
|
|
|
|
|| (sc) == scInit \
|
|
|
|
|
|| (sc) == scFini)
|
|
|
|
|
#define SC_IS_DATA(sc) ((sc) == scData \
|
|
|
|
|
|| (sc) == scSData \
|
|
|
|
|
|| (sc) == scRData \
|
|
|
|
|
|| (sc) == scPData \
|
|
|
|
|
|| (sc) == scXData)
|
|
|
|
|
#define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon)
|
2002-04-22 18:19:35 +08:00
|
|
|
|
#define SC_IS_BSS(sc) ((sc) == scBss)
|
|
|
|
|
#define SC_IS_SBSS(sc) ((sc) == scSBss)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Various complaints about symbol reading that don't abort the process. */
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
index_complaint (const char *arg1)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("bad aux index at symbol %s"), arg1);
|
2002-12-17 08:39:08 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
unknown_ext_complaint (const char *arg1)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("unknown external symbol %s"), arg1);
|
2002-12-17 08:39:08 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
basic_type_complaint (int arg1, const char *arg2)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("cannot map ECOFF basic type 0x%x for %s"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
arg1, arg2);
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
bad_tag_guess_complaint (const char *arg1)
|
|
|
|
|
{
|
2011-01-06 06:22:53 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
|
|
|
|
_("guessed tag type of %s incorrectly"), arg1);
|
2002-12-17 08:39:08 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
bad_rfd_entry_complaint (const char *arg1, int arg2, int arg3)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("bad rfd entry for %s: file %d, index %d"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
arg1, arg2, arg3);
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
unexpected_type_code_complaint (const char *arg1)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("unexpected type code for %s"), arg1);
|
2002-12-17 08:39:08 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Macros and extra defs. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Puns: hard to find whether -g was used and how. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#define MIN_GLEVEL GLEVEL_0
|
|
|
|
|
#define compare_glevel(a,b) \
|
|
|
|
|
(((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
|
|
|
|
|
((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Things that really are local to this module. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Remember what we deduced to be the source language of this psymtab. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static enum language psymtab_language = language_unknown;
|
|
|
|
|
|
|
|
|
|
/* Current BFD. */
|
|
|
|
|
|
|
|
|
|
static bfd *cur_bfd;
|
|
|
|
|
|
|
|
|
|
/* How to parse debugging information for CUR_BFD. */
|
|
|
|
|
|
|
|
|
|
static const struct ecoff_debug_swap *debug_swap;
|
|
|
|
|
|
|
|
|
|
/* Pointers to debugging information for CUR_BFD. */
|
|
|
|
|
|
|
|
|
|
static struct ecoff_debug_info *debug_info;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pointer to current file decriptor record, and its index. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static FDR *cur_fdr;
|
|
|
|
|
static int cur_fd;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Index of current symbol. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int cur_sdx;
|
|
|
|
|
|
|
|
|
|
/* Note how much "debuggable" this image is. We would like
|
2011-01-09 11:20:33 +08:00
|
|
|
|
to see at least one FDR with full symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int max_gdbinfo;
|
|
|
|
|
static int max_glevel;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* When examining .o files, report on undefined symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int n_undef_symbols, n_undef_labels, n_undef_vars, n_undef_procs;
|
|
|
|
|
|
|
|
|
|
/* Pseudo symbol to use when putting stabs into the symbol table. */
|
|
|
|
|
|
|
|
|
|
static char stabs_symbol[] = STABS_SYMBOL;
|
|
|
|
|
|
|
|
|
|
/* Nonzero if we have seen ecoff debugging info for a file. */
|
|
|
|
|
|
|
|
|
|
static int found_ecoff_debugging_info;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Forward declarations. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-03-20 03:00:04 +08:00
|
|
|
|
static int upgrade_type (int, struct type **, int, union aux_ext *,
|
|
|
|
|
int, char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void parse_partial_symbols (struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static int has_opaque_xref (FDR *, SYMR *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-03-20 03:00:04 +08:00
|
|
|
|
static int cross_ref (int, union aux_ext *, struct type **, enum type_code,
|
|
|
|
|
char **, int, char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct symbol *new_symbol (char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct type *new_type (char *);
|
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
|
|
|
|
enum block_type { FUNCTION_BLOCK, NON_FUNCTION_BLOCK };
|
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
|
|
|
|
static struct block *new_block (enum block_type);
|
|
|
|
|
|
2010-10-02 04:26:11 +08:00
|
|
|
|
static struct symtab *new_symtab (const char *, int, struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct linetable *new_linetable (int);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct blockvector *new_bvect (int);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
|
|
|
|
|
int, char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
constify struct block in some places
This makes some spots in gdb, particularly general_symbol_info, use a
"const struct block", then fixes the fallout.
The justification is that, ordinarily, blocks ought to be readonly.
Note though that we can't add "const" in the blockvector due to block
relocation. This can be done once blocks are made independent of the
program space.
2014-06-18 Tom Tromey <tromey@redhat.com>
* varobj.c (varobj_create): Update.
* valops.c (value_of_this): Update.
* tracepoint.c (add_local_symbols, scope_info): Update.
* symtab.h (struct general_symbol_info) <block>: Now const.
* symtab.c (skip_prologue_sal)
(default_make_symbol_completion_list_break_on)
(skip_prologue_using_sal): Update.
* stack.h (iterate_over_block_locals)
(iterate_over_block_local_vars): Update.
* stack.c (print_frame_args): Update.
(iterate_over_block_locals, iterate_over_block_local_vars): Make
parameter const.
(get_selected_block): Make return type const.
* python/py-frame.c (frapy_block): Update.
* python/py-block.c (gdbpy_block_for_pc): Update.
* p-exp.y (%union) <bval>: Now const.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (mylookup_symbol, parse_procedure): Update.
* m2-exp.y (%union) <bval>: Now const.
* linespec.c (get_current_search_block): Make return type const.
(create_sals_line_offset, find_label_symbols): Update.
* inline-frame.c (inline_frame_sniffer, skip_inline_frames):
Update.
(block_starting_point_at): Make "block" const.
* infrun.c (insert_exception_resume_breakpoint): Make "b" const.
(check_exception_resume): Update.
* guile/scm-frame.c (gdbscm_frame_block): Update.
* guile/scm-block.c (gdbscm_lookup_block): Update.
* frame.h (get_frame_block): Update.
(get_selected_block): Make return type const.
* frame.c (frame_id_inner): Update.
* f-valprint.c (info_common_command_for_block)
(info_common_command): Update.
* dwarf2loc.c (dwarf2_find_location_expression)
(dwarf_expr_frame_base, dwarf2_compile_expr_to_ax)
(locexpr_describe_location_piece): Update.
* c-exp.y (%union) <bval>: Now const.
* breakpoint.c (resolve_sal_pc): Update.
* blockframe.c (get_frame_block):Make return type const.
(get_pc_function_start, get_frame_function, find_pc_sect_function)
(block_innermost_frame): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(block_for_pc, block_for_pc_sect): Update.
* block.c (blockvector_for_pc_sect, blockvector_for_pc): Make
'pblock' const.
(block_for_pc_sect, block_for_pc): Make return type const.
* ax-gdb.c (gen_expr): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* ada-lang.c (ada_read_renaming_var_value): Make 'block' const.
(ada_make_symbol_completion_list, ada_add_exceptions_from_frame)
(ada_read_var_value): Update.
* ada-exp.y (struct name_info) <block>: Now const.
(%union): Likewise.
(block_lookup): Constify.
2013-03-12 23:51:37 +08:00
|
|
|
|
static struct symbol *mylookup_symbol (char *, const struct block *,
|
|
|
|
|
domain_enum, enum address_class);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void sort_blocks (struct symtab *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct partial_symtab *new_psymtab (char *, struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
static void psymtab_to_symtab_1 (struct objfile *objfile,
|
|
|
|
|
struct partial_symtab *, const char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void add_block (struct block *, struct symtab *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2008-05-28 04:24:51 +08:00
|
|
|
|
static void add_symbol (struct symbol *, struct symtab *, struct block *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static int add_line (struct linetable *, int, CORE_ADDR, int);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static struct linetable *shrink_linetable (struct linetable *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-03-20 03:00:04 +08:00
|
|
|
|
static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
|
|
|
|
|
CORE_ADDR);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static char *mdebug_next_symbol_text (struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2013-01-18 11:09:42 +08:00
|
|
|
|
/* Exported procedure: Builds a symtab from the partial symtab SELF.
|
|
|
|
|
Restores the environment in effect when SELF was created, delegates
|
1999-04-16 09:35:26 +08:00
|
|
|
|
most of the work to an ancillary procedure, and sorts
|
2013-01-18 11:09:42 +08:00
|
|
|
|
and reorders the symtab list at the end. SELF is not NULL. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2013-01-18 11:09:42 +08:00
|
|
|
|
mdebug_read_symtab (struct partial_symtab *self, struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
if (info_verbose)
|
|
|
|
|
{
|
2013-01-18 11:09:42 +08:00
|
|
|
|
printf_filtered (_("Reading in symbols for %s..."), self->filename);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
next_symbol_text_func = mdebug_next_symbol_text;
|
|
|
|
|
|
2013-01-18 11:09:42 +08:00
|
|
|
|
psymtab_to_symtab_1 (objfile, self, self->filename);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Match with global symbols. This only needs to be done once,
|
2011-01-09 11:20:33 +08:00
|
|
|
|
after all of the symtabs and dependencies have been read in. */
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
scan_file_globals (objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (info_verbose)
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 08:39:24 +08:00
|
|
|
|
printf_filtered (_("done.\n"));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* File-level interface functions. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Find a file descriptor given its index RF relative to a file CF. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static FDR *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
get_rfd (int cf, int rf)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
FDR *fdrs;
|
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
|
|
|
|
FDR *f;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
RFDT rfd;
|
|
|
|
|
|
|
|
|
|
fdrs = debug_info->fdr;
|
|
|
|
|
f = fdrs + cf;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Object files do not have the RFD table, all refs are absolute. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (f->rfdBase == 0)
|
|
|
|
|
return fdrs + rf;
|
|
|
|
|
(*debug_swap->swap_rfd_in) (cur_bfd,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
((char *) debug_info->external_rfd
|
|
|
|
|
+ ((f->rfdBase + rf)
|
|
|
|
|
* debug_swap->external_rfd_size)),
|
|
|
|
|
&rfd);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return fdrs + rfd;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Return a safer print NAME for a file descriptor. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static char *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
fdr_name (FDR *f)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
if (f->rss == -1)
|
|
|
|
|
return "<stripped file>";
|
|
|
|
|
if (f->rss == 0)
|
|
|
|
|
return "<NFY>";
|
|
|
|
|
return debug_info->ss + f->issBase + f->rss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Read in and parse the symtab of the file OBJFILE. Symbols from
|
|
|
|
|
different sections are relocated via the SECTION_OFFSETS. */
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
mdebug_build_psymtabs (struct objfile *objfile,
|
|
|
|
|
const struct ecoff_debug_swap *swap,
|
|
|
|
|
struct ecoff_debug_info *info)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
cur_bfd = objfile->obfd;
|
|
|
|
|
debug_swap = swap;
|
|
|
|
|
debug_info = info;
|
|
|
|
|
|
2001-09-05 10:54:15 +08:00
|
|
|
|
stabsread_new_init ();
|
|
|
|
|
buildsym_new_init ();
|
|
|
|
|
free_header_files ();
|
|
|
|
|
init_header_files ();
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Make sure all the FDR information is swapped in. */
|
|
|
|
|
if (info->fdr == (FDR *) NULL)
|
|
|
|
|
{
|
|
|
|
|
char *fdr_src;
|
|
|
|
|
char *fdr_end;
|
|
|
|
|
FDR *fdr_ptr;
|
|
|
|
|
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-08 02:29:54 +08:00
|
|
|
|
info->fdr = (FDR *) obstack_alloc (&objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(info->symbolic_header.ifdMax
|
|
|
|
|
* sizeof (FDR)));
|
|
|
|
|
fdr_src = info->external_fdr;
|
|
|
|
|
fdr_end = (fdr_src
|
|
|
|
|
+ info->symbolic_header.ifdMax * swap->external_fdr_size);
|
|
|
|
|
fdr_ptr = info->fdr;
|
|
|
|
|
for (; fdr_src < fdr_end; fdr_src += swap->external_fdr_size, fdr_ptr++)
|
|
|
|
|
(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-09 08:02:17 +08:00
|
|
|
|
parse_partial_symbols (objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Check to make sure file was compiled with -g. If not, warn the
|
|
|
|
|
user of this limitation. */
|
|
|
|
|
if (compare_glevel (max_glevel, GLEVEL_2) < 0)
|
|
|
|
|
{
|
|
|
|
|
if (max_gdbinfo == 0)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
printf_unfiltered (_("\n%s not compiled with -g, "
|
|
|
|
|
"debugging support is limited.\n"),
|
1999-07-08 04:19:36 +08:00
|
|
|
|
objfile->name);
|
2011-01-06 06:22:53 +08:00
|
|
|
|
printf_unfiltered (_("You should compile with -g2 or "
|
|
|
|
|
"-g3 for best debugging support.\n"));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Local utilities */
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Map of FDR indexes to partial symtabs. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
struct pst_map
|
|
|
|
|
{
|
|
|
|
|
struct partial_symtab *pst; /* the psymtab proper */
|
|
|
|
|
long n_globals; /* exported globals (external symbols) */
|
|
|
|
|
long globals_offset; /* cumulative */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Utility stack, used to nest procedures and blocks properly.
|
|
|
|
|
It is a doubly linked list, to avoid too many alloc/free.
|
|
|
|
|
Since we might need it quite a few times it is NOT deallocated
|
2011-01-09 11:20:33 +08:00
|
|
|
|
after use. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct parse_stack
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
struct parse_stack *next, *prev;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
struct symtab *cur_st; /* Current symtab. */
|
|
|
|
|
struct block *cur_block; /* Block in it. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
|
|
|
|
/* What are we parsing. stFile, or stBlock are for files and
|
|
|
|
|
blocks. stProc or stStaticProc means we have seen the start of a
|
|
|
|
|
procedure, but not the start of the block within in. When we see
|
|
|
|
|
the start of that block, we change it to stNil, without pushing a
|
|
|
|
|
new block, i.e. stNil means both a procedure and a block. */
|
|
|
|
|
|
|
|
|
|
int blocktype;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
struct type *cur_type; /* Type we parse fields for. */
|
|
|
|
|
int cur_field; /* Field number in cur_type. */
|
|
|
|
|
CORE_ADDR procadr; /* Start addres of this procedure. */
|
|
|
|
|
int numargs; /* Its argument count. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
*top_stack; /* Top stack ptr */
|
|
|
|
|
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Enter a new lexical context. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
push_parse_stack (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct parse_stack *new;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Reuse frames if possible. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (top_stack && top_stack->prev)
|
|
|
|
|
new = top_stack->prev;
|
|
|
|
|
else
|
|
|
|
|
new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Initialize new frame with previous content. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (top_stack)
|
|
|
|
|
{
|
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
|
|
|
|
struct parse_stack *prev = new->prev;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
*new = *top_stack;
|
|
|
|
|
top_stack->prev = new;
|
|
|
|
|
new->prev = prev;
|
|
|
|
|
new->next = top_stack;
|
|
|
|
|
}
|
|
|
|
|
top_stack = new;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Exit a lexical context. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
pop_parse_stack (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
if (!top_stack)
|
|
|
|
|
return;
|
|
|
|
|
if (top_stack->next)
|
|
|
|
|
top_stack = top_stack->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Cross-references might be to things we haven't looked at
|
|
|
|
|
yet, e.g. type references. To avoid too many type
|
|
|
|
|
duplications we keep a quick fixup table, an array
|
2011-01-09 11:20:33 +08:00
|
|
|
|
of lists of references indexed by file descriptor. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
struct mdebug_pending
|
|
|
|
|
{
|
|
|
|
|
struct mdebug_pending *next; /* link */
|
|
|
|
|
char *s; /* the unswapped symbol */
|
|
|
|
|
struct type *t; /* its partial type descriptor */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2012-12-13 00:22:33 +08:00
|
|
|
|
/* The pending information is kept for an entire object file. We
|
|
|
|
|
allocate the pending information table when we create the partial
|
|
|
|
|
symbols, and we store a pointer to the single table in each
|
|
|
|
|
psymtab. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct mdebug_pending **pending_list;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Check whether we already saw symbol SH in file FH. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct mdebug_pending *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
is_pending_symbol (FDR *fh, char *sh)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
int f_idx = fh - debug_info->fdr;
|
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 mdebug_pending *p;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Linear search is ok, list is typically no more than 10 deep. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
for (p = pending_list[f_idx]; p; p = p->next)
|
|
|
|
|
if (p->s == sh)
|
|
|
|
|
break;
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Add a new symbol SH of type T. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
add_pending (FDR *fh, char *sh, struct type *t)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
int f_idx = fh - debug_info->fdr;
|
|
|
|
|
struct mdebug_pending *p = is_pending_symbol (fh, sh);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Make sure we do not make duplicates. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (!p)
|
|
|
|
|
{
|
|
|
|
|
p = ((struct mdebug_pending *)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
obstack_alloc (&mdebugread_objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
sizeof (struct mdebug_pending)));
|
|
|
|
|
p->s = sh;
|
|
|
|
|
p->t = t;
|
|
|
|
|
p->next = pending_list[f_idx];
|
|
|
|
|
pending_list[f_idx] = p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parsing Routines proper. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse a single symbol. Mostly just make up a GDB symbol for it.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
For blocks, procedures and types we open a new lexical context.
|
|
|
|
|
This is basically just a big switch on the symbol's type. Argument
|
|
|
|
|
AX is the base pointer of aux symbols for this file (fh->iauxBase).
|
|
|
|
|
EXT_SH points to the unswapped symbol, which is needed for struct,
|
|
|
|
|
union, etc., types; it is NULL for an EXTR. BIGEND says whether
|
|
|
|
|
aux symbols are big-endian or little-endian. Return count of
|
|
|
|
|
SYMR's handled (normally one). */
|
|
|
|
|
|
2009-06-04 20:28:39 +08:00
|
|
|
|
static int
|
|
|
|
|
mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
|
|
|
|
|
{
|
|
|
|
|
return gdbarch_ecoff_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct symbol_register_ops mdebug_register_funcs = {
|
|
|
|
|
mdebug_reg_to_regnum
|
|
|
|
|
};
|
|
|
|
|
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
/* The "aclass" indices for computed symbols. */
|
|
|
|
|
|
|
|
|
|
static int mdebug_register_index;
|
|
|
|
|
static int mdebug_regparm_index;
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
static int
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
|
|
|
|
|
struct section_offsets *section_offsets, struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2008-03-26 22:53:28 +08:00
|
|
|
|
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
|
2002-03-20 03:00:04 +08:00
|
|
|
|
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
char *name;
|
|
|
|
|
struct symbol *s;
|
|
|
|
|
struct block *b;
|
|
|
|
|
struct mdebug_pending *pend;
|
|
|
|
|
struct type *t;
|
|
|
|
|
struct field *f;
|
|
|
|
|
int count = 1;
|
|
|
|
|
enum address_class class;
|
|
|
|
|
TIR tir;
|
|
|
|
|
long svalue = sh->value;
|
|
|
|
|
int bitsize;
|
|
|
|
|
|
|
|
|
|
if (ext_sh == (char *) NULL)
|
|
|
|
|
name = debug_info->ssext + sh->iss;
|
|
|
|
|
else
|
|
|
|
|
name = debug_info->ss + cur_fdr->issBase + sh->iss;
|
|
|
|
|
|
|
|
|
|
switch (sh->sc)
|
|
|
|
|
{
|
|
|
|
|
case scText:
|
|
|
|
|
case scRConst:
|
|
|
|
|
/* Do not relocate relative values.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
The value of a stEnd symbol is the displacement from the
|
|
|
|
|
corresponding start symbol value.
|
|
|
|
|
The value of a stBlock symbol is the displacement from the
|
|
|
|
|
procedure address. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (sh->st != stEnd && sh->st != stBlock)
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scData:
|
|
|
|
|
case scSData:
|
|
|
|
|
case scRData:
|
|
|
|
|
case scPData:
|
|
|
|
|
case scXData:
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scBss:
|
|
|
|
|
case scSBss:
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (sh->st)
|
|
|
|
|
{
|
|
|
|
|
case stNil:
|
|
|
|
|
break;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stGlobal: /* External symbol, goes into global block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
class = LOC_STATIC;
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
|
|
|
|
|
GLOBAL_BLOCK);
|
|
|
|
|
s = new_symbol (name);
|
|
|
|
|
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
|
|
|
|
goto data;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stStatic: /* Static data, goes into current block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
class = LOC_STATIC;
|
|
|
|
|
b = top_stack->cur_block;
|
|
|
|
|
s = new_symbol (name);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_COMMON (sh->sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* It is a FORTRAN common block. At least for SGI Fortran the
|
|
|
|
|
address is not in the symbol; we need to fix it later in
|
|
|
|
|
scan_file_globals. */
|
* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
2008-08-22 02:14:39 +08:00
|
|
|
|
int bucket = hashname (SYMBOL_LINKAGE_NAME (s));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
|
|
|
|
|
global_sym_chain[bucket] = s;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
|
|
|
|
goto data;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stLocal: /* Local variable, goes into current block. */
|
2009-06-04 20:28:39 +08:00
|
|
|
|
b = top_stack->cur_block;
|
|
|
|
|
s = new_symbol (name);
|
|
|
|
|
SYMBOL_VALUE (s) = svalue;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (sh->sc == scRegister)
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
class = mdebug_register_index;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
|
|
|
|
class = LOC_LOCAL;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
data: /* Common code for symbols describing data. */
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = class;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, b);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Type could be missing if file is compiled without debugging info. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (sh->sc)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|| sh->sc == scNil || sh->index == indexNil)
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
SYMBOL_TYPE (s) = objfile_type (objfile)->nodebug_data_symbol;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
|
|
|
|
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Value of a data symbol is its memory address. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stParam: /* Arg to procedure, goes into current
|
|
|
|
|
block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
max_gdbinfo++;
|
|
|
|
|
found_ecoff_debugging_info = 1;
|
|
|
|
|
top_stack->numargs++;
|
|
|
|
|
|
|
|
|
|
/* Special GNU C++ name. */
|
|
|
|
|
if (is_cplus_marker (name[0]) && name[1] == 't' && name[2] == 0)
|
2011-01-09 11:20:33 +08:00
|
|
|
|
name = "this"; /* FIXME, not alloc'd in obstack. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
s = new_symbol (name);
|
|
|
|
|
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
2008-05-28 03:29:52 +08:00
|
|
|
|
SYMBOL_IS_ARGUMENT (s) = 1;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
switch (sh->sc)
|
|
|
|
|
{
|
|
|
|
|
case scRegister:
|
|
|
|
|
/* Pass by value in register. */
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = mdebug_register_index;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scVar:
|
|
|
|
|
/* Pass by reference on stack. */
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_REF_ARG;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scVarRegister:
|
|
|
|
|
/* Pass by reference in register. */
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = mdebug_regparm_index;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
/* Pass by value on stack. */
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_ARG;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
SYMBOL_VALUE (s) = svalue;
|
|
|
|
|
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stLabel: /* label, goes into current block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
s = new_symbol (name);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_LABEL; /* but not misused. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stProc: /* Procedure, usually goes into global block. */
|
|
|
|
|
case stStaticProc: /* Static procedure, goes into current block. */
|
2003-01-07 15:09:25 +08:00
|
|
|
|
/* For stProc symbol records, we need to check the storage class
|
|
|
|
|
as well, as only (stProc, scText) entries represent "real"
|
|
|
|
|
procedures - See the Compaq document titled "Object File /
|
|
|
|
|
Symbol Table Format Specification" for more information.
|
|
|
|
|
If the storage class is not scText, we discard the whole block
|
|
|
|
|
of symbol records for this stProc. */
|
|
|
|
|
if (sh->st == stProc && sh->sc != scText)
|
|
|
|
|
{
|
|
|
|
|
char *ext_tsym = ext_sh;
|
|
|
|
|
int keep_counting = 1;
|
|
|
|
|
SYMR tsym;
|
|
|
|
|
|
|
|
|
|
while (keep_counting)
|
|
|
|
|
{
|
|
|
|
|
ext_tsym += external_sym_size;
|
|
|
|
|
(*swap_sym_in) (cur_bfd, ext_tsym, &tsym);
|
|
|
|
|
count++;
|
|
|
|
|
switch (tsym.st)
|
|
|
|
|
{
|
|
|
|
|
case stParam:
|
|
|
|
|
break;
|
|
|
|
|
case stEnd:
|
|
|
|
|
keep_counting = 0;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("unknown symbol type 0x%x"), sh->st);
|
2003-01-07 15:09:25 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
s = new_symbol (name);
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_BLOCK;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Type of the return value. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
t = objfile_type (objfile)->builtin_int;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
|
2004-01-18 09:22:57 +08:00
|
|
|
|
if (strcmp (name, "malloc") == 0
|
|
|
|
|
&& TYPE_CODE (t) == TYPE_CODE_VOID)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* I don't know why, but, at least under Alpha GNU/Linux,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
when linking against a malloc without debugging
|
|
|
|
|
symbols, its read as a function returning void---this
|
|
|
|
|
is bad because it means we cannot call functions with
|
|
|
|
|
string arguments interactively; i.e., "call
|
|
|
|
|
printf("howdy\n")" would fail with the error message
|
|
|
|
|
"program has no memory available". To avoid this, we
|
|
|
|
|
patch up the type and make it void*
|
2011-01-09 11:20:33 +08:00
|
|
|
|
instead. (davidm@azstarnet.com). */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
t = make_pointer_type (t, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
b = top_stack->cur_block;
|
|
|
|
|
if (sh->st == stProc)
|
|
|
|
|
{
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* The next test should normally be true, but provides a
|
|
|
|
|
hook for nested functions (which we don't want to make
|
2005-01-14 08:59:32 +08:00
|
|
|
|
global). */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (b == BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK))
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
|
|
|
|
/* Irix 5 sometimes has duplicate names for the same
|
|
|
|
|
function. We want to add such names up at the global
|
|
|
|
|
level, not as a nested function. */
|
|
|
|
|
else if (sh->value == top_stack->procadr)
|
|
|
|
|
b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
|
|
|
|
}
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, b);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Make a type for the procedure itself. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_TYPE (s) = lookup_function_type (t);
|
|
|
|
|
|
2003-01-05 06:37:49 +08:00
|
|
|
|
/* All functions in C++ have prototypes. For C we don't have enough
|
|
|
|
|
information in the debug info. */
|
|
|
|
|
if (SYMBOL_LANGUAGE (s) == language_cplus)
|
gdb:
* xml-tdesc.c (tdesc_end_union): Update.
* stabsread.c (define_symbol): Update.
(read_type): Update.
(read_struct_type): Update.
(read_enum_type): Update.
* spu-tdep.c (spu_builtin_type_vec128): Update.
* sh-tdep.c (sh_push_dummy_call_fpu): Update.
(sh_push_dummy_call_nofpu): Update.
* mdebugread.c (parse_symbol): Update.
(parse_symbol): Update.
(parse_symbol): Update.
(upgrade_type): Update.
* jv-lang.c (java_lookup_class): Update.
* iq2000-tdep.c (iq2000_pointer_to_address): Update.
* i386-tdep.c (i386_mmx_type): Update.
(i386_sse_type): Update.
* gdbtypes.h (enum type_flag_value): New enum.
(enum type_instance_flag_value): New enum.
(TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB,
TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED,
TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR,
TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED,
TYPE_FLAG_NOTTEXT): Now enum constants.
(TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE,
TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1,
TYPE_FLAG_ADDRESS_CLASS_2): Remove.
(TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE,
TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants.
(TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB,
TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS,
TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED,
TYPE_NOTTEXT): Update.
(TYPE_FLAG_ADDRESS_CLASS_ALL): Remove.
(TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define.
(TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE,
TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2,
TYPE_ADDRESS_CLASS_ALL): Update.
(struct main_type) <flags>: Remove.
<flag_unsigned, flag_nosign, flag_stub, flag_target_stub,
flag_static, flag_prototyped, flag_incomplete, flag_varargs,
flag_vector, flag_stub_supported, flag_nottext,
flag_fixed_instance>: New fields.
<nfields, vptr_fieldno>: Move earlier.
(TYPE_FLAGS): Remove.
* gdbtypes.c (make_pointer_type): Update.
(address_space_name_to_int): Update.
(address_space_int_to_name): Update.
(make_type_with_address_space): Update.
(make_cv_type): Update.
(create_range_type): Update.
(get_discrete_bounds): Update.
(create_set_type): Update.
(make_vector_type): Update.
(smash_to_method_type): Update.
(check_typedef): Update.
(check_stub_method): Update.
(init_type): Individually assign flag fields.
(recursive_dump_type): Don't print entire TYPE_FLAGS field. Do
print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT.
(copy_type_recursive): Copy the entire main type. Don't use
TYPE_FLAGS.
* features/rs6000/powerpc-altivec64l.c
(initialize_tdesc_powerpc_altivec64l): Update.
* features/rs6000/powerpc-altivec64.c
(initialize_tdesc_powerpc_altivec64): Update.
* features/rs6000/powerpc-altivec32l.c
(initialize_tdesc_powerpc_altivec32l): Update.
* features/rs6000/powerpc-altivec32.c
(initialize_tdesc_powerpc_altivec32): Update.
* features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400):
Update.
* features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt):
Update.
* dwarf2read.c (read_structure_type): Update.
(read_enumeration_type): Likewise.
(process_enumeration_scope): Likewise.
(read_tag_pointer_type): Likewise.
(read_subroutine_type): Likewise.
(read_subroutine_type): Likewise.
(read_base_type): Likewise.
* coffread.c (coff_read_enum_type): Update.
* ada-valprint.c (adjust_type_signedness): Update.
* ada-typeprint.c (print_record_field_types): Update.
* ada-lang.c (packed_array_type): Update.
(empty_record): Don't reset TYPE_FLAGS.
(ada_template_to_fixed_record_type_1): Update.
(ada_template_to_fixed_record_type_1): Likewise.
(template_to_static_fixed_type): Likewise.
(to_record_with_fixed_variant_part): Likewise.
(to_fixed_record_type): Likewise.
(to_fixed_array_type): Likewise.
(to_static_fixed_type): Likewise.
gdb/testsuite:
* gdb.base/maint.exp: Update "maint print type".
2008-08-25 00:39:57 +08:00
|
|
|
|
TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
|
2003-01-05 06:37:49 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Create and enter a new lexical context. */
|
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
|
|
|
|
b = new_block (FUNCTION_BLOCK);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_BLOCK_VALUE (s) = b;
|
|
|
|
|
BLOCK_FUNCTION (b) = s;
|
|
|
|
|
BLOCK_START (b) = BLOCK_END (b) = sh->value;
|
|
|
|
|
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
|
|
|
|
|
add_block (b, top_stack->cur_st);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Not if we only have partial info. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
push_parse_stack ();
|
|
|
|
|
top_stack->cur_block = b;
|
|
|
|
|
top_stack->blocktype = sh->st;
|
|
|
|
|
top_stack->cur_type = SYMBOL_TYPE (s);
|
|
|
|
|
top_stack->cur_field = -1;
|
|
|
|
|
top_stack->procadr = sh->value;
|
|
|
|
|
top_stack->numargs = 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* Beginning of code for structure, union, and enum definitions.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
They all share a common set of local variables, defined here. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
enum type_code type_code;
|
|
|
|
|
char *ext_tsym;
|
|
|
|
|
int nfields;
|
|
|
|
|
long max_value;
|
|
|
|
|
struct field *f;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stStruct: /* Start a block defining a struct type. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
type_code = TYPE_CODE_STRUCT;
|
|
|
|
|
goto structured_common;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stUnion: /* Start a block defining a union type. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
type_code = TYPE_CODE_UNION;
|
|
|
|
|
goto structured_common;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stEnum: /* Start a block defining an enum type. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
type_code = TYPE_CODE_ENUM;
|
|
|
|
|
goto structured_common;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case stBlock: /* Either a lexical block, or some type. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (sh->sc != scInfo && !SC_IS_COMMON (sh->sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
goto case_stBlock_code; /* Lexical block */
|
|
|
|
|
|
|
|
|
|
type_code = TYPE_CODE_UNDEF; /* We have a type. */
|
|
|
|
|
|
|
|
|
|
/* Common code for handling struct, union, enum, and/or as-yet-
|
|
|
|
|
unknown-type blocks of info about structured data. `type_code'
|
|
|
|
|
has been set to the proper TYPE_CODE, if we know it. */
|
|
|
|
|
structured_common:
|
|
|
|
|
found_ecoff_debugging_info = 1;
|
|
|
|
|
push_parse_stack ();
|
|
|
|
|
top_stack->blocktype = stBlock;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* First count the number of fields and the highest value. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
nfields = 0;
|
|
|
|
|
max_value = 0;
|
|
|
|
|
for (ext_tsym = ext_sh + external_sym_size;
|
|
|
|
|
;
|
|
|
|
|
ext_tsym += external_sym_size)
|
|
|
|
|
{
|
|
|
|
|
SYMR tsym;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd, ext_tsym, &tsym);
|
|
|
|
|
|
|
|
|
|
switch (tsym.st)
|
|
|
|
|
{
|
|
|
|
|
case stEnd:
|
2003-01-03 22:01:47 +08:00
|
|
|
|
/* C++ encodes class types as structures where there the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
methods are encoded as stProc. The scope of stProc
|
2003-01-03 22:01:47 +08:00
|
|
|
|
symbols also ends with stEnd, thus creating a risk of
|
|
|
|
|
taking the wrong stEnd symbol record as the end of
|
|
|
|
|
the current struct, which would cause GDB to undercount
|
|
|
|
|
the real number of fields in this struct. To make sure
|
|
|
|
|
we really reached the right stEnd symbol record, we
|
|
|
|
|
check the associated name, and match it against the
|
|
|
|
|
struct name. Since method names are mangled while
|
|
|
|
|
the class name is not, there is no risk of having a
|
|
|
|
|
method whose name is identical to the class name
|
|
|
|
|
(in particular constructor method names are different
|
|
|
|
|
from the class name). There is therefore no risk that
|
2003-03-20 03:45:49 +08:00
|
|
|
|
this check stops the count on the StEnd of a method.
|
|
|
|
|
|
|
|
|
|
Also, assume that we're really at the end when tsym.iss
|
|
|
|
|
is 0 (issNull). */
|
|
|
|
|
if (tsym.iss == issNull
|
|
|
|
|
|| strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss,
|
|
|
|
|
name) == 0)
|
2003-01-03 22:01:47 +08:00
|
|
|
|
goto end_of_fields;
|
|
|
|
|
break;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
case stMember:
|
|
|
|
|
if (nfields == 0 && type_code == TYPE_CODE_UNDEF)
|
1999-04-27 02:34:20 +08:00
|
|
|
|
{
|
|
|
|
|
/* If the type of the member is Nil (or Void),
|
|
|
|
|
without qualifiers, assume the tag is an
|
|
|
|
|
enumeration.
|
|
|
|
|
Alpha cc -migrate enums are recognized by a zero
|
|
|
|
|
index and a zero symbol value.
|
|
|
|
|
DU 4.0 cc enums are recognized by a member type of
|
|
|
|
|
btEnum without qualifiers and a zero symbol value. */
|
|
|
|
|
if (tsym.index == indexNil
|
|
|
|
|
|| (tsym.index == 0 && sh->value == 0))
|
|
|
|
|
type_code = TYPE_CODE_ENUM;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
(*debug_swap->swap_tir_in) (bigend,
|
|
|
|
|
&ax[tsym.index].a_ti,
|
|
|
|
|
&tir);
|
|
|
|
|
if ((tir.bt == btNil || tir.bt == btVoid
|
|
|
|
|
|| (tir.bt == btEnum && sh->value == 0))
|
|
|
|
|
&& tir.tq0 == tqNil)
|
|
|
|
|
type_code = TYPE_CODE_ENUM;
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
nfields++;
|
|
|
|
|
if (tsym.value > max_value)
|
|
|
|
|
max_value = tsym.value;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stBlock:
|
|
|
|
|
case stUnion:
|
|
|
|
|
case stEnum:
|
|
|
|
|
case stStruct:
|
|
|
|
|
{
|
|
|
|
|
#if 0
|
|
|
|
|
/* This is a no-op; is it trying to tell us something
|
|
|
|
|
we should be checking? */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (tsym.sc == scVariant); /*UNIMPLEMENTED */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
#endif
|
|
|
|
|
if (tsym.index != 0)
|
|
|
|
|
{
|
|
|
|
|
/* This is something like a struct within a
|
1999-07-08 04:19:36 +08:00
|
|
|
|
struct. Skip over the fields of the inner
|
|
|
|
|
struct. The -1 is because the for loop will
|
|
|
|
|
increment ext_tsym. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ext_tsym = ((char *) debug_info->external_sym
|
|
|
|
|
+ ((cur_fdr->isymBase + tsym.index - 1)
|
|
|
|
|
* external_sym_size));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stTypedef:
|
|
|
|
|
/* mips cc puts out a typedef for struct x if it is not yet
|
|
|
|
|
defined when it encounters
|
|
|
|
|
struct y { struct x *xp; };
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Just ignore it. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stIndirect:
|
|
|
|
|
/* Irix5 cc puts out a stIndirect for struct x if it is not
|
|
|
|
|
yet defined when it encounters
|
|
|
|
|
struct y { struct x *xp; };
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Just ignore it. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
_("declaration block contains "
|
|
|
|
|
"unhandled symbol type %d"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
tsym.st);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-03-06 06:02:47 +08:00
|
|
|
|
end_of_fields:
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* In an stBlock, there is no way to distinguish structs,
|
|
|
|
|
unions, and enums at this point. This is a bug in the
|
|
|
|
|
original design (that has been fixed with the recent
|
|
|
|
|
addition of the stStruct, stUnion, and stEnum symbol
|
|
|
|
|
types.) The way you can tell is if/when you see a variable
|
|
|
|
|
or field of that type. In that case the variable's type
|
|
|
|
|
(in the AUX table) says if the type is struct, union, or
|
|
|
|
|
enum, and points back to the stBlock here. So you can
|
|
|
|
|
patch the tag kind up later - but only if there actually is
|
|
|
|
|
a variable or field of that type.
|
|
|
|
|
|
|
|
|
|
So until we know for sure, we will guess at this point.
|
|
|
|
|
The heuristic is:
|
|
|
|
|
If the first member has index==indexNil or a void type,
|
|
|
|
|
assume we have an enumeration.
|
|
|
|
|
Otherwise, if there is more than one member, and all
|
|
|
|
|
the members have offset 0, assume we have a union.
|
|
|
|
|
Otherwise, assume we have a struct.
|
|
|
|
|
|
|
|
|
|
The heuristic could guess wrong in the case of of an
|
|
|
|
|
enumeration with no members or a union with one (or zero)
|
|
|
|
|
members, or when all except the last field of a struct have
|
|
|
|
|
width zero. These are uncommon and/or illegal situations,
|
|
|
|
|
and in any case guessing wrong probably doesn't matter
|
|
|
|
|
much.
|
|
|
|
|
|
|
|
|
|
But if we later do find out we were wrong, we fixup the tag
|
|
|
|
|
kind. Members of an enumeration must be handled
|
|
|
|
|
differently from struct/union fields, and that is harder to
|
|
|
|
|
patch up, but luckily we shouldn't need to. (If there are
|
|
|
|
|
any enumeration members, we can tell for sure it's an enum
|
2011-01-09 11:20:33 +08:00
|
|
|
|
here.) */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (type_code == TYPE_CODE_UNDEF)
|
1999-04-27 02:34:20 +08:00
|
|
|
|
{
|
|
|
|
|
if (nfields > 1 && max_value == 0)
|
|
|
|
|
type_code = TYPE_CODE_UNION;
|
|
|
|
|
else
|
|
|
|
|
type_code = TYPE_CODE_STRUCT;
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Create a new type or use the pending type. */
|
|
|
|
|
pend = is_pending_symbol (cur_fdr, ext_sh);
|
|
|
|
|
if (pend == (struct mdebug_pending *) NULL)
|
|
|
|
|
{
|
|
|
|
|
t = new_type (NULL);
|
|
|
|
|
add_pending (cur_fdr, ext_sh, t);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
t = pend->t;
|
|
|
|
|
|
|
|
|
|
/* Do not set the tag name if it is a compiler generated tag name
|
|
|
|
|
(.Fxx or .xxfake or empty) for unnamed struct/union/enums.
|
|
|
|
|
Alpha cc puts out an sh->iss of zero for those. */
|
|
|
|
|
if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
|
|
|
|
|
TYPE_TAG_NAME (t) = NULL;
|
|
|
|
|
else
|
2011-06-15 02:53:14 +08:00
|
|
|
|
TYPE_TAG_NAME (t) = obconcat (&mdebugread_objfile->objfile_obstack,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
name, (char *) NULL);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
TYPE_CODE (t) = type_code;
|
|
|
|
|
TYPE_LENGTH (t) = sh->value;
|
|
|
|
|
TYPE_NFIELDS (t) = nfields;
|
|
|
|
|
TYPE_FIELDS (t) = f = ((struct field *)
|
|
|
|
|
TYPE_ALLOC (t,
|
|
|
|
|
nfields * sizeof (struct field)));
|
|
|
|
|
|
|
|
|
|
if (type_code == TYPE_CODE_ENUM)
|
|
|
|
|
{
|
|
|
|
|
int unsigned_enum = 1;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* This is a non-empty enum. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* DEC c89 has the number of enumerators in the sh.value field,
|
|
|
|
|
not the type length, so we have to compensate for that
|
|
|
|
|
incompatibility quirk.
|
|
|
|
|
This might do the wrong thing for an enum with one or two
|
|
|
|
|
enumerators and gcc -gcoff -fshort-enums, but these cases
|
|
|
|
|
are hopefully rare enough.
|
|
|
|
|
Alpha cc -migrate has a sh.value field of zero, we adjust
|
|
|
|
|
that too. */
|
|
|
|
|
if (TYPE_LENGTH (t) == TYPE_NFIELDS (t)
|
|
|
|
|
|| TYPE_LENGTH (t) == 0)
|
2008-03-26 22:53:28 +08:00
|
|
|
|
TYPE_LENGTH (t) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
for (ext_tsym = ext_sh + external_sym_size;
|
|
|
|
|
;
|
|
|
|
|
ext_tsym += external_sym_size)
|
|
|
|
|
{
|
|
|
|
|
SYMR tsym;
|
|
|
|
|
struct symbol *enum_sym;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd, ext_tsym, &tsym);
|
|
|
|
|
|
|
|
|
|
if (tsym.st != stMember)
|
|
|
|
|
break;
|
|
|
|
|
|
2012-04-18 14:46:47 +08:00
|
|
|
|
SET_FIELD_ENUMVAL (*f, tsym.value);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
FIELD_TYPE (*f) = t;
|
|
|
|
|
FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss;
|
|
|
|
|
FIELD_BITSIZE (*f) = 0;
|
|
|
|
|
|
2013-04-09 03:48:30 +08:00
|
|
|
|
enum_sym = allocate_symbol (mdebugread_objfile);
|
* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
2008-08-22 02:14:39 +08:00
|
|
|
|
SYMBOL_SET_LINKAGE_NAME
|
* symfile.h (obsavestring): Don't declare.
* symfile.c (obsavestring): Remove.
* ada-exp.y: Use obstack_copy0, not obsavestring.
* ada-lang.c: Use obstack_copy0, not obsavestring.
* coffread.c: Use obstack_copy0, not obsavestring.
* cp-namespace.c: Use obstack_copy0, not obsavestring.
* dbxread.c: Use obstack_copy0, not obsavestring.
* dwarf2read.c: Use obstack_copy0, not obsavestring.
* jit.c: Use obstack_copy0, not obsavestring.
* mdebugread.c: Use obstack_copy0, not obsavestring.
* psymtab.c: Use obstack_copy0, not obsavestring.
* stabsread.c: Use obstack_copy0, not obsavestring.
* xcoffread.c: Use obstack_copy0, not obsavestring.
2013-01-22 02:13:14 +08:00
|
|
|
|
(enum_sym,
|
|
|
|
|
obstack_copy0 (&mdebugread_objfile->objfile_obstack,
|
|
|
|
|
f->name, strlen (f->name)));
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (enum_sym) = LOC_CONST;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_TYPE (enum_sym) = t;
|
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
|
|
|
|
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_VALUE (enum_sym) = tsym.value;
|
|
|
|
|
if (SYMBOL_VALUE (enum_sym) < 0)
|
|
|
|
|
unsigned_enum = 0;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (enum_sym, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Skip the stMembers that we've handled. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
count++;
|
|
|
|
|
f++;
|
|
|
|
|
}
|
|
|
|
|
if (unsigned_enum)
|
gdb:
* xml-tdesc.c (tdesc_end_union): Update.
* stabsread.c (define_symbol): Update.
(read_type): Update.
(read_struct_type): Update.
(read_enum_type): Update.
* spu-tdep.c (spu_builtin_type_vec128): Update.
* sh-tdep.c (sh_push_dummy_call_fpu): Update.
(sh_push_dummy_call_nofpu): Update.
* mdebugread.c (parse_symbol): Update.
(parse_symbol): Update.
(parse_symbol): Update.
(upgrade_type): Update.
* jv-lang.c (java_lookup_class): Update.
* iq2000-tdep.c (iq2000_pointer_to_address): Update.
* i386-tdep.c (i386_mmx_type): Update.
(i386_sse_type): Update.
* gdbtypes.h (enum type_flag_value): New enum.
(enum type_instance_flag_value): New enum.
(TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB,
TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED,
TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR,
TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED,
TYPE_FLAG_NOTTEXT): Now enum constants.
(TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE,
TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1,
TYPE_FLAG_ADDRESS_CLASS_2): Remove.
(TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE,
TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants.
(TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB,
TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS,
TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED,
TYPE_NOTTEXT): Update.
(TYPE_FLAG_ADDRESS_CLASS_ALL): Remove.
(TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define.
(TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE,
TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2,
TYPE_ADDRESS_CLASS_ALL): Update.
(struct main_type) <flags>: Remove.
<flag_unsigned, flag_nosign, flag_stub, flag_target_stub,
flag_static, flag_prototyped, flag_incomplete, flag_varargs,
flag_vector, flag_stub_supported, flag_nottext,
flag_fixed_instance>: New fields.
<nfields, vptr_fieldno>: Move earlier.
(TYPE_FLAGS): Remove.
* gdbtypes.c (make_pointer_type): Update.
(address_space_name_to_int): Update.
(address_space_int_to_name): Update.
(make_type_with_address_space): Update.
(make_cv_type): Update.
(create_range_type): Update.
(get_discrete_bounds): Update.
(create_set_type): Update.
(make_vector_type): Update.
(smash_to_method_type): Update.
(check_typedef): Update.
(check_stub_method): Update.
(init_type): Individually assign flag fields.
(recursive_dump_type): Don't print entire TYPE_FLAGS field. Do
print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT.
(copy_type_recursive): Copy the entire main type. Don't use
TYPE_FLAGS.
* features/rs6000/powerpc-altivec64l.c
(initialize_tdesc_powerpc_altivec64l): Update.
* features/rs6000/powerpc-altivec64.c
(initialize_tdesc_powerpc_altivec64): Update.
* features/rs6000/powerpc-altivec32l.c
(initialize_tdesc_powerpc_altivec32l): Update.
* features/rs6000/powerpc-altivec32.c
(initialize_tdesc_powerpc_altivec32): Update.
* features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400):
Update.
* features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt):
Update.
* dwarf2read.c (read_structure_type): Update.
(read_enumeration_type): Likewise.
(process_enumeration_scope): Likewise.
(read_tag_pointer_type): Likewise.
(read_subroutine_type): Likewise.
(read_subroutine_type): Likewise.
(read_base_type): Likewise.
* coffread.c (coff_read_enum_type): Update.
* ada-valprint.c (adjust_type_signedness): Update.
* ada-typeprint.c (print_record_field_types): Update.
* ada-lang.c (packed_array_type): Update.
(empty_record): Don't reset TYPE_FLAGS.
(ada_template_to_fixed_record_type_1): Update.
(ada_template_to_fixed_record_type_1): Likewise.
(template_to_static_fixed_type): Likewise.
(to_record_with_fixed_variant_part): Likewise.
(to_fixed_record_type): Likewise.
(to_fixed_array_type): Likewise.
(to_static_fixed_type): Likewise.
gdb/testsuite:
* gdb.base/maint.exp: Update "maint print type".
2008-08-25 00:39:57 +08:00
|
|
|
|
TYPE_UNSIGNED (t) = 1;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Make this the current type. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
top_stack->cur_type = t;
|
|
|
|
|
top_stack->cur_field = 0;
|
|
|
|
|
|
|
|
|
|
/* Do not create a symbol for alpha cc unnamed structs. */
|
|
|
|
|
if (sh->iss == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* gcc puts out an empty struct for an opaque struct definitions,
|
|
|
|
|
do not create a symbol for it either. */
|
|
|
|
|
if (TYPE_NFIELDS (t) == 0)
|
|
|
|
|
{
|
gdb:
* xml-tdesc.c (tdesc_end_union): Update.
* stabsread.c (define_symbol): Update.
(read_type): Update.
(read_struct_type): Update.
(read_enum_type): Update.
* spu-tdep.c (spu_builtin_type_vec128): Update.
* sh-tdep.c (sh_push_dummy_call_fpu): Update.
(sh_push_dummy_call_nofpu): Update.
* mdebugread.c (parse_symbol): Update.
(parse_symbol): Update.
(parse_symbol): Update.
(upgrade_type): Update.
* jv-lang.c (java_lookup_class): Update.
* iq2000-tdep.c (iq2000_pointer_to_address): Update.
* i386-tdep.c (i386_mmx_type): Update.
(i386_sse_type): Update.
* gdbtypes.h (enum type_flag_value): New enum.
(enum type_instance_flag_value): New enum.
(TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB,
TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED,
TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR,
TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED,
TYPE_FLAG_NOTTEXT): Now enum constants.
(TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE,
TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1,
TYPE_FLAG_ADDRESS_CLASS_2): Remove.
(TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE,
TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1,
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants.
(TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB,
TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS,
TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED,
TYPE_NOTTEXT): Update.
(TYPE_FLAG_ADDRESS_CLASS_ALL): Remove.
(TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define.
(TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE,
TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2,
TYPE_ADDRESS_CLASS_ALL): Update.
(struct main_type) <flags>: Remove.
<flag_unsigned, flag_nosign, flag_stub, flag_target_stub,
flag_static, flag_prototyped, flag_incomplete, flag_varargs,
flag_vector, flag_stub_supported, flag_nottext,
flag_fixed_instance>: New fields.
<nfields, vptr_fieldno>: Move earlier.
(TYPE_FLAGS): Remove.
* gdbtypes.c (make_pointer_type): Update.
(address_space_name_to_int): Update.
(address_space_int_to_name): Update.
(make_type_with_address_space): Update.
(make_cv_type): Update.
(create_range_type): Update.
(get_discrete_bounds): Update.
(create_set_type): Update.
(make_vector_type): Update.
(smash_to_method_type): Update.
(check_typedef): Update.
(check_stub_method): Update.
(init_type): Individually assign flag fields.
(recursive_dump_type): Don't print entire TYPE_FLAGS field. Do
print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT.
(copy_type_recursive): Copy the entire main type. Don't use
TYPE_FLAGS.
* features/rs6000/powerpc-altivec64l.c
(initialize_tdesc_powerpc_altivec64l): Update.
* features/rs6000/powerpc-altivec64.c
(initialize_tdesc_powerpc_altivec64): Update.
* features/rs6000/powerpc-altivec32l.c
(initialize_tdesc_powerpc_altivec32l): Update.
* features/rs6000/powerpc-altivec32.c
(initialize_tdesc_powerpc_altivec32): Update.
* features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400):
Update.
* features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt):
Update.
* dwarf2read.c (read_structure_type): Update.
(read_enumeration_type): Likewise.
(process_enumeration_scope): Likewise.
(read_tag_pointer_type): Likewise.
(read_subroutine_type): Likewise.
(read_subroutine_type): Likewise.
(read_base_type): Likewise.
* coffread.c (coff_read_enum_type): Update.
* ada-valprint.c (adjust_type_signedness): Update.
* ada-typeprint.c (print_record_field_types): Update.
* ada-lang.c (packed_array_type): Update.
(empty_record): Don't reset TYPE_FLAGS.
(ada_template_to_fixed_record_type_1): Update.
(ada_template_to_fixed_record_type_1): Likewise.
(template_to_static_fixed_type): Likewise.
(to_record_with_fixed_variant_part): Likewise.
(to_fixed_record_type): Likewise.
(to_fixed_array_type): Likewise.
(to_static_fixed_type): Likewise.
gdb/testsuite:
* gdb.base/maint.exp: Update "maint print type".
2008-08-25 00:39:57 +08:00
|
|
|
|
TYPE_STUB (t) = 1;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s = new_symbol (name);
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = STRUCT_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_TYPEDEF;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_VALUE (s) = 0;
|
|
|
|
|
SYMBOL_TYPE (s) = t;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* End of local variables shared by struct, union, enum, and
|
|
|
|
|
block (as yet unknown struct/union/enum) processing. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case_stBlock_code:
|
|
|
|
|
found_ecoff_debugging_info = 1;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Beginnning of (code) block. Value of symbol
|
|
|
|
|
is the displacement from procedure start. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
push_parse_stack ();
|
|
|
|
|
|
|
|
|
|
/* Do not start a new block if this is the outermost block of a
|
1999-07-08 04:19:36 +08:00
|
|
|
|
procedure. This allows the LOC_BLOCK symbol to point to the
|
|
|
|
|
block with the local variables, so funcname::var works. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (top_stack->blocktype == stProc
|
|
|
|
|
|| top_stack->blocktype == stStaticProc)
|
|
|
|
|
{
|
|
|
|
|
top_stack->blocktype = stNil;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
top_stack->blocktype = stBlock;
|
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
|
|
|
|
b = new_block (NON_FUNCTION_BLOCK);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
BLOCK_START (b) = sh->value + top_stack->procadr;
|
|
|
|
|
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
|
|
|
|
|
top_stack->cur_block = b;
|
|
|
|
|
add_block (b, top_stack->cur_st);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stEnd: /* end (of anything) */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (sh->sc == scInfo || SC_IS_COMMON (sh->sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* Finished with type */
|
|
|
|
|
top_stack->cur_type = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (sh->sc == scText &&
|
|
|
|
|
(top_stack->blocktype == stProc ||
|
|
|
|
|
top_stack->blocktype == stStaticProc))
|
|
|
|
|
{
|
|
|
|
|
/* Finished with procedure */
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
|
2004-10-31 10:59:21 +08:00
|
|
|
|
struct mdebug_extra_func_info *e;
|
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 = top_stack->cur_block;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct type *ftype = top_stack->cur_type;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
BLOCK_END (top_stack->cur_block) += sh->value; /* size */
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Make up special symbol to contain procedure specific info. */
|
2004-10-31 10:59:21 +08:00
|
|
|
|
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
|
2011-06-15 02:53:14 +08:00
|
|
|
|
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->builtin_void;
|
2004-10-31 10:59:21 +08:00
|
|
|
|
e = ((struct mdebug_extra_func_info *)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
obstack_alloc (&mdebugread_objfile->objfile_obstack,
|
2004-10-31 10:59:21 +08:00
|
|
|
|
sizeof (struct mdebug_extra_func_info)));
|
|
|
|
|
memset (e, 0, sizeof (struct mdebug_extra_func_info));
|
2009-01-13 19:52:43 +08:00
|
|
|
|
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
e->numargs = top_stack->numargs;
|
|
|
|
|
e->pdr.framereg = -1;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* f77 emits proc-level with address bounds==[0,0],
|
|
|
|
|
So look for such child blocks, and patch them. */
|
|
|
|
|
for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i++)
|
|
|
|
|
{
|
|
|
|
|
struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (BLOCK_SUPERBLOCK (b_bad) == b
|
|
|
|
|
&& BLOCK_START (b_bad) == top_stack->procadr
|
|
|
|
|
&& BLOCK_END (b_bad) == top_stack->procadr)
|
|
|
|
|
{
|
|
|
|
|
BLOCK_START (b_bad) = BLOCK_START (b);
|
|
|
|
|
BLOCK_END (b_bad) = BLOCK_END (b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TYPE_NFIELDS (ftype) <= 0)
|
|
|
|
|
{
|
|
|
|
|
/* No parameter type information is recorded with the function's
|
2011-01-09 11:20:33 +08:00
|
|
|
|
type. Set that from the type of the parameter symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int nparams = top_stack->numargs;
|
|
|
|
|
int iparams;
|
|
|
|
|
struct symbol *sym;
|
|
|
|
|
|
|
|
|
|
if (nparams > 0)
|
|
|
|
|
{
|
* tracepoint.c (scope_info): Update.
* symtab.c (lookup_block_symbol, iterate_over_symbols)
(find_pc_sect_symtab, search_symbols)
(default_make_symbol_completion_list_break_on)
(make_file_symbol_completion_list): Update.
* symmisc.c (dump_symtab_1): Update.
* stack.c (print_frame_args, iterate_over_block_locals)
(print_frame_labels, iterate_over_block_arg_vars): Update.
* python/py-block.c (block_object) <dict>: Remove.
<block>: New field.
<iter>: Change type.
(blpy_iter): Update.
(blpy_block_syms_iternext): Update.
* psymtab.c (map_block): Use block iterators.
* objfiles.c (objfile_relocate1): Use ALL_DICT_SYMBOLS.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (parse_symbol, mylookup_symbol): Update.
* infrun.c (check_exception_resume): Update.
* cp-support.c (make_symbol_overload_list_block): Update.
* coffread.c (patch_opaque_types): Update.
* buildsym.c (finish_block, end_symtab): Use ALL_DICT_SYMBOLS.
* block.h (struct block_iterator): New.
(block_iterator_first, block_iterator_next, block_iter_name_first)
(block_iter_name_next, block_iter_match_first)
(block_iter_match_next): Declare.
(ALL_BLOCK_SYMBOLS): Redefine.
* block.c (block_iterator_first, block_iterator_next)
(block_iter_name_first, block_iter_name_next)
(block_iter_match_first, block_iter_match_next): New functions.
* ada-lang.c (ada_add_block_symbols)
(ada_make_symbol_completion_list): Use block iterator.
2012-05-11 03:50:09 +08:00
|
|
|
|
struct block_iterator iter;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
TYPE_NFIELDS (ftype) = nparams;
|
|
|
|
|
TYPE_FIELDS (ftype) = (struct field *)
|
|
|
|
|
TYPE_ALLOC (ftype, nparams * sizeof (struct field));
|
1999-07-08 04:19:36 +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
|
|
|
|
iparams = 0;
|
|
|
|
|
ALL_BLOCK_SYMBOLS (b, iter, 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
|
|
|
|
if (iparams == nparams)
|
|
|
|
|
break;
|
|
|
|
|
|
2008-05-28 03:29:52 +08:00
|
|
|
|
if (SYMBOL_IS_ARGUMENT (sym))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym);
|
2002-01-21 03:12:23 +08:00
|
|
|
|
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
iparams++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (sh->sc == scText && top_stack->blocktype == stBlock)
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* End of (code) block. The value of the symbol is the
|
1999-04-16 09:35:26 +08:00
|
|
|
|
displacement from the procedure`s start address of the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
end of this block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
BLOCK_END (top_stack->cur_block) = sh->value + top_stack->procadr;
|
|
|
|
|
}
|
|
|
|
|
else if (sh->sc == scText && top_stack->blocktype == stNil)
|
|
|
|
|
{
|
|
|
|
|
/* End of outermost block. Pop parse stack and ignore. The
|
|
|
|
|
following stEnd of stProc will take care of the block. */
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
else if (sh->sc == scText && top_stack->blocktype == stFile)
|
|
|
|
|
{
|
|
|
|
|
/* End of file. Pop parse stack and ignore. Higher
|
|
|
|
|
level code deals with this. */
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
else
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("stEnd with storage class %d not handled"), sh->sc);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
pop_parse_stack (); /* Restore previous lexical context. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stMember: /* member of struct or union */
|
|
|
|
|
f = &TYPE_FIELDS (top_stack->cur_type)[top_stack->cur_field++];
|
|
|
|
|
FIELD_NAME (*f) = name;
|
Convert static_kind into loc_kind enum.
* gdbtypes.h (enum field_loc_kind): New.
(union field_location): New field dwarf_block.
(struct field): Rename static_kind as loc_kind.
(FIELD_STATIC_KIND): Rename to ...
(FIELD_LOC_KIND): ... here.
(TYPE_FIELD_STATIC_KIND): Rename to ...
(TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND.
(TYPE_FIELD_STATIC_HAS_ADDR): Remove.
(TYPE_FIELD_STATIC): Remove.
(TYPE_FIELD_BITPOS): Reformat.
(SET_FIELD_BITPOS): New.
(FIELD_PHYSADDR): Rename to ...
(FIELD_STATIC_PHYSADDR): ... here.
(TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename.
(SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND.
(FIELD_PHYSNAME): Rename to ...
(FIELD_STATIC_PHYSNAME): ... here.
(TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename.
(SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND.
(FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New.
(field_is_static): New declaration.
* gdbtypes.c (field_is_static): New function.
(copy_type_recursive): Update throughout.
* amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c,
eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c,
p-valprint.c, valops.c, value.c, varobj.c: Update throughout.
2008-10-08 20:49:13 +08:00
|
|
|
|
SET_FIELD_BITPOS (*f, sh->value);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
bitsize = 0;
|
2011-01-06 06:22:53 +08:00
|
|
|
|
FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index,
|
|
|
|
|
&bitsize, bigend, name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
FIELD_BITSIZE (*f) = bitsize;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stIndirect: /* forward declaration on Irix5 */
|
|
|
|
|
/* Forward declarations from Irix5 cc are handled by cross_ref,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
skip them. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stTypedef: /* type definition */
|
|
|
|
|
found_ecoff_debugging_info = 1;
|
|
|
|
|
|
|
|
|
|
/* Typedefs for forward declarations and opaque structs from alpha cc
|
1999-07-08 04:19:36 +08:00
|
|
|
|
are handled by cross_ref, skip them. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (sh->iss == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* Parse the type or use the pending type. */
|
|
|
|
|
pend = is_pending_symbol (cur_fdr, ext_sh);
|
|
|
|
|
if (pend == (struct mdebug_pending *) NULL)
|
|
|
|
|
{
|
1999-07-08 04:19:36 +08:00
|
|
|
|
t = parse_type (cur_fd, ax, sh->index, (int *) NULL, bigend, name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
add_pending (cur_fdr, ext_sh, t);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
t = pend->t;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Mips cc puts out a typedef with the name of the struct for forward
|
|
|
|
|
declarations. These should not go into the symbol table and
|
1999-07-08 04:19:36 +08:00
|
|
|
|
TYPE_NAME should not be set for them.
|
|
|
|
|
They can't be distinguished from an intentional typedef to
|
|
|
|
|
the same name however:
|
|
|
|
|
x.h:
|
|
|
|
|
struct x { int ix; int jx; };
|
|
|
|
|
struct xx;
|
|
|
|
|
x.c:
|
|
|
|
|
typedef struct x x;
|
|
|
|
|
struct xx {int ixx; int jxx; };
|
|
|
|
|
generates a cross referencing stTypedef for x and xx.
|
|
|
|
|
The user visible effect of this is that the type of a pointer
|
|
|
|
|
to struct foo sometimes is given as `foo *' instead of `struct foo *'.
|
|
|
|
|
The problem is fixed with alpha cc and Irix5 cc. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* However if the typedef cross references to an opaque aggregate, it
|
1999-07-08 04:19:36 +08:00
|
|
|
|
is safe to omit it from the symbol table. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (has_opaque_xref (cur_fdr, sh))
|
|
|
|
|
break;
|
|
|
|
|
s = new_symbol (name);
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_TYPEDEF;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
|
|
|
|
|
SYMBOL_TYPE (s) = t;
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Incomplete definitions of structs should not get a name. */
|
|
|
|
|
if (TYPE_NAME (SYMBOL_TYPE (s)) == NULL
|
|
|
|
|
&& (TYPE_NFIELDS (SYMBOL_TYPE (s)) != 0
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|| (TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_STRUCT
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&& TYPE_CODE (SYMBOL_TYPE (s)) != TYPE_CODE_UNION)))
|
|
|
|
|
{
|
|
|
|
|
if (TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_PTR
|
|
|
|
|
|| TYPE_CODE (SYMBOL_TYPE (s)) == TYPE_CODE_FUNC)
|
|
|
|
|
{
|
|
|
|
|
/* If we are giving a name to a type such as "pointer to
|
1999-07-08 04:19:36 +08:00
|
|
|
|
foo" or "function returning foo", we better not set
|
|
|
|
|
the TYPE_NAME. If the program contains "typedef char
|
|
|
|
|
*caddr_t;", we don't want all variables of type char
|
|
|
|
|
* to print as caddr_t. This is not just a
|
|
|
|
|
consequence of GDB's type management; CC and GCC (at
|
|
|
|
|
least through version 2.4) both output variables of
|
|
|
|
|
either type char * or caddr_t with the type
|
|
|
|
|
refering to the stTypedef symbol for caddr_t. If a future
|
|
|
|
|
compiler cleans this up it GDB is not ready for it
|
|
|
|
|
yet, but if it becomes ready we somehow need to
|
|
|
|
|
disable this check (without breaking the PCC/GCC2.4
|
|
|
|
|
case).
|
|
|
|
|
|
|
|
|
|
Sigh.
|
|
|
|
|
|
|
|
|
|
Fortunately, this check seems not to be necessary
|
|
|
|
|
for anything except pointers or functions. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
2008-08-22 02:14:39 +08:00
|
|
|
|
TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_LINKAGE_NAME (s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stFile: /* file name */
|
|
|
|
|
push_parse_stack ();
|
|
|
|
|
top_stack->blocktype = sh->st;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* I`ve never seen these for C */
|
|
|
|
|
case stRegReloc:
|
|
|
|
|
break; /* register relocation */
|
|
|
|
|
case stForward:
|
|
|
|
|
break; /* forwarding address */
|
|
|
|
|
case stConstant:
|
|
|
|
|
break; /* constant */
|
|
|
|
|
default:
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("unknown symbol type 0x%x"), sh->st);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
/* Basic types. */
|
|
|
|
|
|
|
|
|
|
static const struct objfile_data *basic_type_data;
|
|
|
|
|
|
|
|
|
|
static struct type *
|
|
|
|
|
basic_type (int bt, struct objfile *objfile)
|
|
|
|
|
{
|
|
|
|
|
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
|
|
|
|
struct type **map_bt = objfile_data (objfile, basic_type_data);
|
|
|
|
|
struct type *tp;
|
|
|
|
|
|
|
|
|
|
if (bt >= btMax)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
if (!map_bt)
|
|
|
|
|
{
|
|
|
|
|
map_bt = OBSTACK_CALLOC (&objfile->objfile_obstack,
|
|
|
|
|
btMax, struct type *);
|
|
|
|
|
set_objfile_data (objfile, basic_type_data, map_bt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (map_bt[bt])
|
|
|
|
|
return map_bt[bt];
|
|
|
|
|
|
|
|
|
|
switch (bt)
|
|
|
|
|
{
|
|
|
|
|
case btNil:
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
tp = objfile_type (objfile)->builtin_void;
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btAdr:
|
|
|
|
|
tp = init_type (TYPE_CODE_PTR, 4, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"adr_32", objfile);
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
TYPE_TARGET_TYPE (tp) = objfile_type (objfile)->builtin_void;
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btChar:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 1, 0,
|
|
|
|
|
"char", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btUChar:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned char", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btShort:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 2, 0,
|
|
|
|
|
"short", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btUShort:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned short", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btInt:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 4, 0,
|
|
|
|
|
"int", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btUInt:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned int", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btLong:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 4, 0,
|
|
|
|
|
"long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btULong:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btFloat:
|
|
|
|
|
tp = init_type (TYPE_CODE_FLT,
|
|
|
|
|
gdbarch_float_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"float", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btDouble:
|
|
|
|
|
tp = init_type (TYPE_CODE_FLT,
|
|
|
|
|
gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"double", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btComplex:
|
|
|
|
|
tp = init_type (TYPE_CODE_COMPLEX,
|
|
|
|
|
2 * gdbarch_float_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"complex", objfile);
|
|
|
|
|
TYPE_TARGET_TYPE (tp) = basic_type (btFloat, objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btDComplex:
|
|
|
|
|
tp = init_type (TYPE_CODE_COMPLEX,
|
|
|
|
|
2 * gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"double complex", objfile);
|
|
|
|
|
TYPE_TARGET_TYPE (tp) = basic_type (btDouble, objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btFixedDec:
|
|
|
|
|
/* We use TYPE_CODE_INT to print these as integers. Does this do any
|
|
|
|
|
good? Would we be better off with TYPE_CODE_ERROR? Should
|
|
|
|
|
TYPE_CODE_ERROR print things in hex if it knows the size? */
|
|
|
|
|
tp = init_type (TYPE_CODE_INT,
|
|
|
|
|
gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"fixed decimal", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btFloatDec:
|
|
|
|
|
tp = init_type (TYPE_CODE_ERROR,
|
|
|
|
|
gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT, 0,
|
|
|
|
|
"floating decimal", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btString:
|
|
|
|
|
/* Is a "string" the way btString means it the same as TYPE_CODE_STRING?
|
|
|
|
|
FIXME. */
|
|
|
|
|
tp = init_type (TYPE_CODE_STRING, 1, 0,
|
|
|
|
|
"string", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btVoid:
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
tp = objfile_type (objfile)->builtin_void;
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btLong64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, 0,
|
|
|
|
|
"long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btULong64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btLongLong64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, 0,
|
|
|
|
|
"long long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btULongLong64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned long long", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btAdr64:
|
|
|
|
|
tp = init_type (TYPE_CODE_PTR, 8, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"adr_64", objfile);
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
TYPE_TARGET_TYPE (tp) = objfile_type (objfile)->builtin_void;
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btInt64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, 0,
|
|
|
|
|
"int", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btUInt64:
|
|
|
|
|
tp = init_type (TYPE_CODE_INT, 8, TYPE_FLAG_UNSIGNED,
|
|
|
|
|
"unsigned int", objfile);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
tp = NULL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
map_bt[bt] = tp;
|
|
|
|
|
return tp;
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Parse the type information provided in the raw AX entries for
|
2011-01-09 11:20:33 +08:00
|
|
|
|
the symbol SH. Return the bitfield size in BS, in case.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
We must byte-swap the AX entries before we use them; BIGEND says whether
|
|
|
|
|
they are big-endian or little-endian (from fh->fBigendian). */
|
|
|
|
|
|
|
|
|
|
static struct type *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|
|
|
|
int bigend, char *sym_name)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
TIR t[1];
|
|
|
|
|
struct type *tp = 0;
|
|
|
|
|
enum type_code type_code = TYPE_CODE_UNDEF;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Handle undefined types, they have indexNil. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (aux_index == indexNil)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
return basic_type (btInt, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Handle corrupt aux indices. */
|
|
|
|
|
if (aux_index >= (debug_info->fdr + fd)->caux)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
index_complaint (sym_name);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
return basic_type (btInt, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
ax += aux_index;
|
|
|
|
|
|
|
|
|
|
/* Use aux as a type information record, map its basic type. */
|
|
|
|
|
(*debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = basic_type (t->bt, mdebugread_objfile);
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
if (tp == NULL)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Cannot use builtin types -- build our own. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
switch (t->bt)
|
|
|
|
|
{
|
|
|
|
|
case btStruct:
|
|
|
|
|
type_code = TYPE_CODE_STRUCT;
|
|
|
|
|
break;
|
|
|
|
|
case btUnion:
|
|
|
|
|
type_code = TYPE_CODE_UNION;
|
|
|
|
|
break;
|
|
|
|
|
case btEnum:
|
|
|
|
|
type_code = TYPE_CODE_ENUM;
|
|
|
|
|
break;
|
|
|
|
|
case btRange:
|
|
|
|
|
type_code = TYPE_CODE_RANGE;
|
|
|
|
|
break;
|
|
|
|
|
case btSet:
|
|
|
|
|
type_code = TYPE_CODE_SET;
|
|
|
|
|
break;
|
|
|
|
|
case btIndirect:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* alpha cc -migrate uses this for typedefs. The true type will
|
1999-04-16 09:35:26 +08:00
|
|
|
|
be obtained by crossreferencing below. */
|
|
|
|
|
type_code = TYPE_CODE_ERROR;
|
|
|
|
|
break;
|
|
|
|
|
case btTypedef:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* alpha cc uses this for typedefs. The true type will be
|
1999-04-16 09:35:26 +08:00
|
|
|
|
obtained by crossreferencing below. */
|
|
|
|
|
type_code = TYPE_CODE_ERROR;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2002-12-17 08:39:08 +08:00
|
|
|
|
basic_type_complaint (t->bt, sym_name);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
return basic_type (btInt, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Move on to next aux. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ax++;
|
|
|
|
|
|
|
|
|
|
if (t->fBitfield)
|
|
|
|
|
{
|
|
|
|
|
int width = AUX_GET_WIDTH (bigend, ax);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2003-01-13 Elena Zannoni <ezannoni@redhat.com>
* stabsread.h (process_later, resolve_cfront_continuation):
Obsolete.
Update copyright years.
* buildsym.c (start_subfile): Obsolete comment pertinent to Cfront.
Update copyright year.
* dbxread.c(struct cont_elem): Obsolete.
(process_later, process_now): Obsolete functions.
(read_dbx_symtab, read_ofile_symtab): Obsolete cfront support.
Update copyright year.
* gdbtypes.c (INIT_EXTRA, ADD_EXTRA): Obsolete macros.
(add_name, add_mangled_type, cfront_mangle_name): Obsolete functions.
* mdebugread.c (parse_type): Obsolete comment pertinent to Cfront.
(parse_partial_symbols): Obsolete cfront support.
* stabsread.c
(CFRONT_VISIBILITY_PRIVATE,CFRONT_VISIBILITY_PUBLIC): Obsolete
macros.
(get_substring, get_cfront_method_physname, msg_unknown_complaint,
read_cfront_baseclasses, read_cfront_member_functions,
resolve_cfront_continuation,read_cfront_static_fields,
copy_cfront_struct_fields): Obsolete functions.
(define_symbol, read_one_struct_field): Obsolete cfront support.
* xcoffread.c (scan_xcoff_symtab): Obsolete CFront support.
Update Copyright year.
2003-01-14 08:15:05 +08:00
|
|
|
|
/* Inhibit core dumps if TIR is corrupted. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (bs == (int *) NULL)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* Alpha cc -migrate encodes char and unsigned char types
|
|
|
|
|
as short and unsigned short types with a field width of 8.
|
|
|
|
|
Enum types also have a field width which we ignore for now. */
|
|
|
|
|
if (t->bt == btShort && width == 8)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = basic_type (btChar, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else if (t->bt == btUShort && width == 8)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = basic_type (btUChar, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else if (t->bt == btEnum)
|
|
|
|
|
;
|
|
|
|
|
else
|
2011-01-06 06:22:53 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
|
|
|
|
_("can't handle TIR fBitfield for %s"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
1999-07-08 04:19:36 +08:00
|
|
|
|
*bs = width;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ax++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A btIndirect entry cross references to an aux entry containing
|
|
|
|
|
the type. */
|
|
|
|
|
if (t->bt == btIndirect)
|
|
|
|
|
{
|
|
|
|
|
RNDXR rn[1];
|
|
|
|
|
int rf;
|
|
|
|
|
FDR *xref_fh;
|
|
|
|
|
int xref_fd;
|
|
|
|
|
|
|
|
|
|
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
|
|
|
|
|
ax++;
|
|
|
|
|
if (rn->rfd == 0xfff)
|
|
|
|
|
{
|
|
|
|
|
rf = AUX_GET_ISYM (bigend, ax);
|
|
|
|
|
ax++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rf = rn->rfd;
|
|
|
|
|
|
|
|
|
|
if (rf == -1)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("unable to cross ref btIndirect for %s"), sym_name);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
return basic_type (btInt, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
xref_fh = get_rfd (fd, rf);
|
|
|
|
|
xref_fd = xref_fh - debug_info->fdr;
|
|
|
|
|
tp = parse_type (xref_fd, debug_info->external_aux + xref_fh->iauxBase,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
rn->index, (int *) NULL, xref_fh->fBigendian, sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* All these types really point to some (common) MIPS type
|
|
|
|
|
definition, and only the type-qualifiers fully identify
|
2011-01-09 11:20:33 +08:00
|
|
|
|
them. We'll make the same effort at sharing. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (t->bt == btStruct ||
|
|
|
|
|
t->bt == btUnion ||
|
|
|
|
|
t->bt == btEnum ||
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
/* btSet (I think) implies that the name is a tag name, not a typedef
|
|
|
|
|
name. This apparently is a MIPS extension for C sets. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
t->bt == btSet)
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* Try to cross reference this type, build new type on failure. */
|
|
|
|
|
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
|
|
|
|
|
if (tp == (struct type *) NULL)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = init_type (type_code, 0, 0, (char *) NULL, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* DEC c89 produces cross references to qualified aggregate types,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
dereference them. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
while (TYPE_CODE (tp) == TYPE_CODE_PTR
|
|
|
|
|
|| TYPE_CODE (tp) == TYPE_CODE_ARRAY)
|
2002-05-13 Daniel Jacobowitz <drow@mvista.com>
* ax-gdb.c (gen_sign_extend, gen_fetch, gen_usual_unary)
(gen_cast, gen_scale, gen_add, gen_sub, gen_binop, gen_deref)
(gen_address_of, gen_struct_ref, gen_repeat): Use type
access macros.
* c-typeprint.c (cp_type_print_method_args): Likewise.
(c_type_print_args): Likewise.
* d10v-tdep.c (d10v_push_arguments): Likewise.
(d10v_extract_return_value): Likewise.
* expprint.c (print_subexp): Likewise.
* gdbtypes.c (lookup_primitive_typename): Likewise.
(lookup_template_type, add_mangled_type, print_arg_types): Likewise.
* gdbtypes.h (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB)
(TYPE_TARGET_STUB, TYPE_STATIC, TYPE_CONST, TYPE_VOLATILE)
(TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_CODE_SPACE, TYPE_VARARGS)
(TYPE_VECTOR): Likewise.
* hpread.c (hpread_read_struct_type)
(fix_static_member_physnames, fixup_class_method_type)
(hpread_type_lookup): Likewise.
* mdebugread.c (parse_symbol, parse_type): Likewise.
* p-lang.c (is_pascal_string_type): Likewise.
* valops.c (hand_function_call): Likewise.
* x86-64-tdep.c (classify_argument): Likewise.
* hpread.c (hpread_read_function_type)
(hpread_read_doc_function_type): Call replace_type.
* dstread.c (create_new_type): Delete.
(decode_dst_structure, process_dst_function): Call alloc_type.
Use type access macros.
2002-05-13 22:00:36 +08:00
|
|
|
|
tp = TYPE_TARGET_TYPE (tp);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Make sure that TYPE_CODE(tp) has an expected type code.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
Any type may be returned from cross_ref if file indirect entries
|
|
|
|
|
are corrupted. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (TYPE_CODE (tp) != TYPE_CODE_STRUCT
|
|
|
|
|
&& TYPE_CODE (tp) != TYPE_CODE_UNION
|
|
|
|
|
&& TYPE_CODE (tp) != TYPE_CODE_ENUM)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
unexpected_type_code_complaint (sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Usually, TYPE_CODE(tp) is already type_code. The main
|
|
|
|
|
exception is if we guessed wrong re struct/union/enum.
|
|
|
|
|
But for struct vs. union a wrong guess is harmless, so
|
|
|
|
|
don't complain(). */
|
|
|
|
|
if ((TYPE_CODE (tp) == TYPE_CODE_ENUM
|
|
|
|
|
&& type_code != TYPE_CODE_ENUM)
|
|
|
|
|
|| (TYPE_CODE (tp) != TYPE_CODE_ENUM
|
|
|
|
|
&& type_code == TYPE_CODE_ENUM))
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
bad_tag_guess_complaint (sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TYPE_CODE (tp) != type_code)
|
|
|
|
|
{
|
|
|
|
|
TYPE_CODE (tp) = type_code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Do not set the tag name if it is a compiler generated tag name
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(.Fxx or .xxfake or empty) for unnamed struct/union/enums. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (name[0] == '.' || name[0] == '\0')
|
|
|
|
|
TYPE_TAG_NAME (tp) = NULL;
|
|
|
|
|
else if (TYPE_TAG_NAME (tp) == NULL
|
2003-11-08 08:13:03 +08:00
|
|
|
|
|| strcmp (TYPE_TAG_NAME (tp), name) != 0)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
TYPE_TAG_NAME (tp)
|
* symfile.h (obsavestring): Don't declare.
* symfile.c (obsavestring): Remove.
* ada-exp.y: Use obstack_copy0, not obsavestring.
* ada-lang.c: Use obstack_copy0, not obsavestring.
* coffread.c: Use obstack_copy0, not obsavestring.
* cp-namespace.c: Use obstack_copy0, not obsavestring.
* dbxread.c: Use obstack_copy0, not obsavestring.
* dwarf2read.c: Use obstack_copy0, not obsavestring.
* jit.c: Use obstack_copy0, not obsavestring.
* mdebugread.c: Use obstack_copy0, not obsavestring.
* psymtab.c: Use obstack_copy0, not obsavestring.
* stabsread.c: Use obstack_copy0, not obsavestring.
* xcoffread.c: Use obstack_copy0, not obsavestring.
2013-01-22 02:13:14 +08:00
|
|
|
|
= obstack_copy0 (&mdebugread_objfile->objfile_obstack,
|
|
|
|
|
name, strlen (name));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* All these types really point to some (common) MIPS type
|
|
|
|
|
definition, and only the type-qualifiers fully identify
|
|
|
|
|
them. We'll make the same effort at sharing.
|
|
|
|
|
FIXME: We are not doing any guessing on range types. */
|
|
|
|
|
if (t->bt == btRange)
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* Try to cross reference this type, build new type on failure. */
|
|
|
|
|
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
|
|
|
|
|
if (tp == (struct type *) NULL)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = init_type (type_code, 0, 0, (char *) NULL, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Make sure that TYPE_CODE(tp) has an expected type code.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
Any type may be returned from cross_ref if file indirect entries
|
|
|
|
|
are corrupted. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (TYPE_CODE (tp) != TYPE_CODE_RANGE)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
unexpected_type_code_complaint (sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Usually, TYPE_CODE(tp) is already type_code. The main
|
2011-01-09 11:20:33 +08:00
|
|
|
|
exception is if we guessed wrong re struct/union/enum. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (TYPE_CODE (tp) != type_code)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
bad_tag_guess_complaint (sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
TYPE_CODE (tp) = type_code;
|
|
|
|
|
}
|
2004-01-18 09:22:57 +08:00
|
|
|
|
if (TYPE_NAME (tp) == NULL
|
|
|
|
|
|| strcmp (TYPE_NAME (tp), name) != 0)
|
* symfile.h (obsavestring): Don't declare.
* symfile.c (obsavestring): Remove.
* ada-exp.y: Use obstack_copy0, not obsavestring.
* ada-lang.c: Use obstack_copy0, not obsavestring.
* coffread.c: Use obstack_copy0, not obsavestring.
* cp-namespace.c: Use obstack_copy0, not obsavestring.
* dbxread.c: Use obstack_copy0, not obsavestring.
* dwarf2read.c: Use obstack_copy0, not obsavestring.
* jit.c: Use obstack_copy0, not obsavestring.
* mdebugread.c: Use obstack_copy0, not obsavestring.
* psymtab.c: Use obstack_copy0, not obsavestring.
* stabsread.c: Use obstack_copy0, not obsavestring.
* xcoffread.c: Use obstack_copy0, not obsavestring.
2013-01-22 02:13:14 +08:00
|
|
|
|
TYPE_NAME (tp)
|
|
|
|
|
= obstack_copy0 (&mdebugread_objfile->objfile_obstack,
|
|
|
|
|
name, strlen (name));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (t->bt == btTypedef)
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* Try to cross reference this type, it should succeed. */
|
|
|
|
|
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
|
|
|
|
|
if (tp == (struct type *) NULL)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("unable to cross ref btTypedef for %s"), sym_name);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
tp = basic_type (btInt, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Deal with range types. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (t->bt == btRange)
|
|
|
|
|
{
|
* dwarf2read.c (struct attribute): Increase sizes of unsnd and snd
fields to allow larger integer sizes.
(read_subrange_type): Increase size of bound values.
Add logic to determine signedness based on base-type size, signedness.
(read_attribute_value): Change format for bad byte size in message.
(read_8_bytes): Increase size of result type.
(dump_die_shallow): Change format for value.
(dwarf2_get_attr_constant_value): Increase size of return type.
Correct comment.
* gdbtypes.c (create_range_type): Change API to increase size of
bounds. struct field -> union field.
Always take signedness from base type.
(check_typedef): Use new API for TYPE_LOW_BOUND, TYPE_HIGH_BOUND.
(recursive_dump_type, copy_type_recursive): Adjust to new
representation of range types.
* gdbtypes.h (fields_or_bounds): New union containing struct field and
new struct range_bounds, used for range types.
(TYPE_RANGE_DATA): New macro to access range_bounds member.
(TYPE_LOW_BOUND, TYPE_HIGH_BOUND): Represent with new TYPE_RANGE_DATA.
(TYPE_LOW_BOUND_UNDEFINED, TYPE_HIGH_BOUND_UNDEFINED): New macros,
taking over the job of TYPE_FIELD_ARTIFICIAL for range bounds.
(SET_TYPE_LOW_BOUND, SET_TYPE_HIGH_BOUND, SET_TYPE_LOW_BOUND_DEFINED)
(SET_TYPE_HIGH_BOUND_DEFINED): New macros.
(TYPE_FIELDS, TYPE_BASECLASS, TYPE_BASECLASS_NAME, TYPE_FIELD)
(TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED)
(TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED, TYPE_ARRAY_UPPER_BOUND_VALUE)
(TYPE_ARRAY_LOWER_BOUND_VALUE): Adjust to new representation.
(create_range_type): Adjust API.
* ada-lang.c (ada_modulus): Use new extended bound values.
(discrete_type_low_bound): Rename to...
(ada_discrete_type_low_bound): ... and make external.
(discrete_type_high_bound): Rename to...
(ada_discrete_type_high_bound): ... and make external.
(ada_value_slice_from_ptr, ada_array_bound_from_type)
(ada_evaluate_subexp, to_fixed_range_type):
Use ada_discrete_type_low_bound, ada_discrete_type_high_bound.
* ada-typeprint.c (print_range): Use ada_discrete_type_low_bound,
ada_discrete_type_high_bound. Don't look at field count, which
is no longer meaningful. Print bounds whenever argument is a range
or enumeration.
* ada-lang.h (ada_discrete_type_low_bound,ada_discrete_type_high_bound):
Declare.
* varobj.c (c_describe_child): Adjust to render larger values.
* mdebugread.c (parse_type): Use proper abstractions for range types:
TYPE_RANGE_DATA, SET_TYPE_LOW_BOUND_DEFINED,
SET_TYPE_HIGH_BOUND_DEFINED.
* p-typeprint.c (pascal_type_print_varspec_prefix): Use larger format
for bounds.
2009-12-14 14:19:13 +08:00
|
|
|
|
TYPE_NFIELDS (tp) = 0;
|
|
|
|
|
TYPE_RANGE_DATA (tp) = ((struct range_bounds *)
|
|
|
|
|
TYPE_ZALLOC (tp, sizeof (struct range_bounds)));
|
Fix TYPE_HIGH_BOUND for TYPE_CODE_RANGE using arbitrary TYPE_NFIELDS in
preparation for supporting DW_AT_byte_stride.
* ada-lang.c (packed_array_type, ada_index_type): Use TYPE_INDEX_TYPE.
(ada_array_bound_from_type): Move `index_type' declaration to the
function start. New variable `retval'. Return the bounds for
TYPE_CODE_RANGE using TYPE_LOW_BOUND and TYPE_HIGH_BOUND. Abort on
invalid index type codes.
* ada-typeprint.c (print_range): Set `upper_bound' for TYPE_CODE_RANGE
now using TYPE_HIGH_BOUND.
* ada-valprint.c (val_print_packed_array_elements): Use `index_type'.
* eval.c (evaluate_subexp_standard): Use TYPE_INDEX_TYPE.
* gdbtypes.c (create_range_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
refer to the number of fields only through TYPE_NFIELDS.
(create_array_type): Use TYPE_INDEX_TYPE.
(check_typedef): Use TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND.
* gdbtypes.h (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED)
(TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): Use TYPE_INDEX_TYPE.
(TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): Use
TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
* hppa-tdep.c (hppa_alignof <TYPE_CODE_ARRAY>): Use TYPE_INDEX_TYPE.
* mdebugread.c (parse_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
* valarith.c (value_bit_index): Use TYPE_INDEX_TYPE.
2008-12-28 22:14:19 +08:00
|
|
|
|
TYPE_LOW_BOUND (tp) = AUX_GET_DNLOW (bigend, ax);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ax++;
|
Fix TYPE_HIGH_BOUND for TYPE_CODE_RANGE using arbitrary TYPE_NFIELDS in
preparation for supporting DW_AT_byte_stride.
* ada-lang.c (packed_array_type, ada_index_type): Use TYPE_INDEX_TYPE.
(ada_array_bound_from_type): Move `index_type' declaration to the
function start. New variable `retval'. Return the bounds for
TYPE_CODE_RANGE using TYPE_LOW_BOUND and TYPE_HIGH_BOUND. Abort on
invalid index type codes.
* ada-typeprint.c (print_range): Set `upper_bound' for TYPE_CODE_RANGE
now using TYPE_HIGH_BOUND.
* ada-valprint.c (val_print_packed_array_elements): Use `index_type'.
* eval.c (evaluate_subexp_standard): Use TYPE_INDEX_TYPE.
* gdbtypes.c (create_range_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
refer to the number of fields only through TYPE_NFIELDS.
(create_array_type): Use TYPE_INDEX_TYPE.
(check_typedef): Use TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND.
* gdbtypes.h (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED)
(TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): Use TYPE_INDEX_TYPE.
(TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): Use
TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
* hppa-tdep.c (hppa_alignof <TYPE_CODE_ARRAY>): Use TYPE_INDEX_TYPE.
* mdebugread.c (parse_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND,
* valarith.c (value_bit_index): Use TYPE_INDEX_TYPE.
2008-12-28 22:14:19 +08:00
|
|
|
|
TYPE_HIGH_BOUND (tp) = AUX_GET_DNHIGH (bigend, ax);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ax++;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse all the type qualifiers now. If there are more
|
|
|
|
|
than 6 the game will continue in the next aux. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
#define PARSE_TQ(tq) \
|
|
|
|
|
if (t->tq != tqNil) \
|
|
|
|
|
ax += upgrade_type(fd, &tp, t->tq, ax, bigend, sym_name); \
|
|
|
|
|
else \
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
PARSE_TQ (tq0);
|
|
|
|
|
PARSE_TQ (tq1);
|
|
|
|
|
PARSE_TQ (tq2);
|
|
|
|
|
PARSE_TQ (tq3);
|
|
|
|
|
PARSE_TQ (tq4);
|
|
|
|
|
PARSE_TQ (tq5);
|
|
|
|
|
#undef PARSE_TQ
|
|
|
|
|
|
|
|
|
|
/* mips cc 2.x and gcc never put out continued aux entries. */
|
|
|
|
|
if (!t->continued)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
(*debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
|
|
|
|
|
ax++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Complain for illegal continuations due to corrupt aux entries. */
|
|
|
|
|
if (t->continued)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
|
|
|
|
_("illegal TIR continued for %s"), sym_name);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return tp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make up a complex type from a basic one. Type is passed by
|
2011-01-09 11:20:33 +08:00
|
|
|
|
reference in TPP and side-effected as necessary. The type
|
1999-04-16 09:35:26 +08:00
|
|
|
|
qualifier TQ says how to handle the aux symbols at AX for
|
|
|
|
|
the symbol SX we are currently analyzing. BIGEND says whether
|
|
|
|
|
aux symbols are big-endian or little-endian.
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Returns the number of aux symbols we parsed. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int
|
2000-07-30 09:48:28 +08:00
|
|
|
|
upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
|
|
|
|
|
char *sym_name)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
int off;
|
|
|
|
|
struct type *t;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Used in array processing. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int rf, id;
|
|
|
|
|
FDR *fh;
|
|
|
|
|
struct type *range;
|
|
|
|
|
struct type *indx;
|
|
|
|
|
int lower, upper;
|
|
|
|
|
RNDXR rndx;
|
|
|
|
|
|
|
|
|
|
switch (tq)
|
|
|
|
|
{
|
|
|
|
|
case tqPtr:
|
|
|
|
|
t = lookup_pointer_type (*tpp);
|
|
|
|
|
*tpp = t;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case tqProc:
|
|
|
|
|
t = lookup_function_type (*tpp);
|
|
|
|
|
*tpp = t;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case tqArray:
|
|
|
|
|
off = 0;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Determine and record the domain type (type of index). */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx);
|
|
|
|
|
id = rndx.index;
|
|
|
|
|
rf = rndx.rfd;
|
|
|
|
|
if (rf == 0xfff)
|
|
|
|
|
{
|
|
|
|
|
ax++;
|
|
|
|
|
rf = AUX_GET_ISYM (bigend, ax);
|
|
|
|
|
off++;
|
|
|
|
|
}
|
|
|
|
|
fh = get_rfd (fd, rf);
|
|
|
|
|
|
|
|
|
|
indx = parse_type (fh - debug_info->fdr,
|
|
|
|
|
debug_info->external_aux + fh->iauxBase,
|
|
|
|
|
id, (int *) NULL, bigend, sym_name);
|
|
|
|
|
|
|
|
|
|
/* The bounds type should be an integer type, but might be anything
|
1999-07-08 04:19:36 +08:00
|
|
|
|
else due to corrupt aux entries. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (TYPE_CODE (indx) != TYPE_CODE_INT)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
_("illegal array index type for %s, assuming int"),
|
|
|
|
|
sym_name);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
indx = objfile_type (mdebugread_objfile)->builtin_int;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Get the bounds, and create the array type. */
|
|
|
|
|
ax++;
|
|
|
|
|
lower = AUX_GET_DNLOW (bigend, ax);
|
|
|
|
|
ax++;
|
|
|
|
|
upper = AUX_GET_DNHIGH (bigend, ax);
|
|
|
|
|
ax++;
|
|
|
|
|
rf = AUX_GET_WIDTH (bigend, ax); /* bit size of array element */
|
|
|
|
|
|
2013-12-19 16:31:17 +08:00
|
|
|
|
range = create_static_range_type ((struct type *) NULL, indx,
|
|
|
|
|
lower, upper);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
t = create_array_type ((struct type *) NULL, *tpp, range);
|
|
|
|
|
|
|
|
|
|
/* We used to fill in the supplied array element bitsize
|
1999-07-08 04:19:36 +08:00
|
|
|
|
here if the TYPE_LENGTH of the target type was zero.
|
|
|
|
|
This happens for a `pointer to an array of anonymous structs',
|
|
|
|
|
but in this case the array element bitsize is also zero,
|
|
|
|
|
so nothing is gained.
|
|
|
|
|
And we used to check the TYPE_LENGTH of the target type against
|
|
|
|
|
the supplied array element bitsize.
|
|
|
|
|
gcc causes a mismatch for `pointer to array of object',
|
|
|
|
|
since the sdb directives it uses do not have a way of
|
|
|
|
|
specifying the bitsize, but it does no harm (the
|
|
|
|
|
TYPE_LENGTH should be correct) and we should be able to
|
|
|
|
|
ignore the erroneous bitsize from the auxiliary entry safely.
|
|
|
|
|
dbx seems to ignore it too. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
Convert static_kind into loc_kind enum.
* gdbtypes.h (enum field_loc_kind): New.
(union field_location): New field dwarf_block.
(struct field): Rename static_kind as loc_kind.
(FIELD_STATIC_KIND): Rename to ...
(FIELD_LOC_KIND): ... here.
(TYPE_FIELD_STATIC_KIND): Rename to ...
(TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND.
(TYPE_FIELD_STATIC_HAS_ADDR): Remove.
(TYPE_FIELD_STATIC): Remove.
(TYPE_FIELD_BITPOS): Reformat.
(SET_FIELD_BITPOS): New.
(FIELD_PHYSADDR): Rename to ...
(FIELD_STATIC_PHYSADDR): ... here.
(TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename.
(SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND.
(FIELD_PHYSNAME): Rename to ...
(FIELD_STATIC_PHYSNAME): ... here.
(TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename.
(SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND.
(FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New.
(field_is_static): New declaration.
* gdbtypes.c (field_is_static): New function.
(copy_type_recursive): Update throughout.
* amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c,
eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c,
p-valprint.c, valops.c, value.c, varobj.c: Update throughout.
2008-10-08 20:49:13 +08:00
|
|
|
|
/* TYPE_TARGET_STUB now takes care of the zero TYPE_LENGTH problem. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (TYPE_LENGTH (*tpp) == 0)
|
Convert static_kind into loc_kind enum.
* gdbtypes.h (enum field_loc_kind): New.
(union field_location): New field dwarf_block.
(struct field): Rename static_kind as loc_kind.
(FIELD_STATIC_KIND): Rename to ...
(FIELD_LOC_KIND): ... here.
(TYPE_FIELD_STATIC_KIND): Rename to ...
(TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND.
(TYPE_FIELD_STATIC_HAS_ADDR): Remove.
(TYPE_FIELD_STATIC): Remove.
(TYPE_FIELD_BITPOS): Reformat.
(SET_FIELD_BITPOS): New.
(FIELD_PHYSADDR): Rename to ...
(FIELD_STATIC_PHYSADDR): ... here.
(TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename.
(SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND.
(FIELD_PHYSNAME): Rename to ...
(FIELD_STATIC_PHYSNAME): ... here.
(TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename.
(SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND.
(FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New.
(field_is_static): New declaration.
* gdbtypes.c (field_is_static): New function.
(copy_type_recursive): Update throughout.
* amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c,
eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c,
p-valprint.c, valops.c, value.c, varobj.c: Update throughout.
2008-10-08 20:49:13 +08:00
|
|
|
|
TYPE_TARGET_STUB (t) = 1;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
*tpp = t;
|
|
|
|
|
return 4 + off;
|
|
|
|
|
|
|
|
|
|
case tqVol:
|
|
|
|
|
/* Volatile -- currently ignored */
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case tqConst:
|
|
|
|
|
/* Const -- currently ignored */
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
default:
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("unknown type qualifier 0x%x"), tq);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Parse a procedure descriptor record PR. Note that the procedure is
|
|
|
|
|
parsed _after_ the local symbols, now we just insert the extra
|
2004-10-31 10:59:21 +08:00
|
|
|
|
information we need into a MDEBUG_EFI_SYMBOL_NAME symbol that has
|
1999-04-16 09:35:26 +08:00
|
|
|
|
already been placed in the procedure's main block. Note also that
|
|
|
|
|
images that have been partially stripped (ld -x) have been deprived
|
|
|
|
|
of local symbols, and we have to cope with them here. FIRST_OFF is
|
|
|
|
|
the offset of the first procedure for this FDR; we adjust the
|
|
|
|
|
address by this amount, but I don't know why. SEARCH_SYMTAB is the symtab
|
2004-10-31 10:59:21 +08:00
|
|
|
|
to look for the function which contains the MDEBUG_EFI_SYMBOL_NAME symbol
|
1999-04-16 09:35:26 +08:00
|
|
|
|
in question, or NULL to use top_stack->cur_block. */
|
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_procedure (PDR *pr, struct symtab *search_symtab,
|
|
|
|
|
struct partial_symtab *pst)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct symbol *s, *i;
|
constify struct block in some places
This makes some spots in gdb, particularly general_symbol_info, use a
"const struct block", then fixes the fallout.
The justification is that, ordinarily, blocks ought to be readonly.
Note though that we can't add "const" in the blockvector due to block
relocation. This can be done once blocks are made independent of the
program space.
2014-06-18 Tom Tromey <tromey@redhat.com>
* varobj.c (varobj_create): Update.
* valops.c (value_of_this): Update.
* tracepoint.c (add_local_symbols, scope_info): Update.
* symtab.h (struct general_symbol_info) <block>: Now const.
* symtab.c (skip_prologue_sal)
(default_make_symbol_completion_list_break_on)
(skip_prologue_using_sal): Update.
* stack.h (iterate_over_block_locals)
(iterate_over_block_local_vars): Update.
* stack.c (print_frame_args): Update.
(iterate_over_block_locals, iterate_over_block_local_vars): Make
parameter const.
(get_selected_block): Make return type const.
* python/py-frame.c (frapy_block): Update.
* python/py-block.c (gdbpy_block_for_pc): Update.
* p-exp.y (%union) <bval>: Now const.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (mylookup_symbol, parse_procedure): Update.
* m2-exp.y (%union) <bval>: Now const.
* linespec.c (get_current_search_block): Make return type const.
(create_sals_line_offset, find_label_symbols): Update.
* inline-frame.c (inline_frame_sniffer, skip_inline_frames):
Update.
(block_starting_point_at): Make "block" const.
* infrun.c (insert_exception_resume_breakpoint): Make "b" const.
(check_exception_resume): Update.
* guile/scm-frame.c (gdbscm_frame_block): Update.
* guile/scm-block.c (gdbscm_lookup_block): Update.
* frame.h (get_frame_block): Update.
(get_selected_block): Make return type const.
* frame.c (frame_id_inner): Update.
* f-valprint.c (info_common_command_for_block)
(info_common_command): Update.
* dwarf2loc.c (dwarf2_find_location_expression)
(dwarf_expr_frame_base, dwarf2_compile_expr_to_ax)
(locexpr_describe_location_piece): Update.
* c-exp.y (%union) <bval>: Now const.
* breakpoint.c (resolve_sal_pc): Update.
* blockframe.c (get_frame_block):Make return type const.
(get_pc_function_start, get_frame_function, find_pc_sect_function)
(block_innermost_frame): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(block_for_pc, block_for_pc_sect): Update.
* block.c (blockvector_for_pc_sect, blockvector_for_pc): Make
'pblock' const.
(block_for_pc_sect, block_for_pc): Make return type const.
* ax-gdb.c (gen_expr): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* ada-lang.c (ada_read_renaming_var_value): Make 'block' const.
(ada_make_symbol_completion_list, ada_add_exceptions_from_frame)
(ada_read_var_value): Update.
* ada-exp.y (struct name_info) <block>: Now const.
(%union): Likewise.
(block_lookup): Constify.
2013-03-12 23:51:37 +08:00
|
|
|
|
const struct block *b;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
char *sh_name;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Simple rule to find files linked "-x". */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (cur_fdr->rss == -1)
|
|
|
|
|
{
|
|
|
|
|
if (pr->isym == -1)
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Static procedure at address pr->adr. Sigh. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* FIXME-32x64. assuming pr->adr fits in long. */
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("can't handle PDR for static proc at 0x%lx"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
(unsigned long) pr->adr);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* external */
|
|
|
|
|
EXTR she;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(*debug_swap->swap_ext_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_ext
|
|
|
|
|
+ (pr->isym
|
|
|
|
|
* debug_swap->external_ext_size)),
|
|
|
|
|
&she);
|
|
|
|
|
sh_name = debug_info->ssext + she.asym.iss;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Full symbols */
|
|
|
|
|
SYMR sh;
|
|
|
|
|
|
|
|
|
|
(*debug_swap->swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ ((cur_fdr->isymBase + pr->isym)
|
|
|
|
|
* debug_swap->external_sym_size)),
|
|
|
|
|
&sh);
|
|
|
|
|
sh_name = debug_info->ss + cur_fdr->issBase + sh.iss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (search_symtab != NULL)
|
|
|
|
|
{
|
|
|
|
|
#if 0
|
|
|
|
|
/* This loses both in the case mentioned (want a static, find a global),
|
1999-07-08 04:19:36 +08:00
|
|
|
|
but also if we are looking up a non-mangled name which happens to
|
|
|
|
|
match the name of a mangled function. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* We have to save the cur_fdr across the call to lookup_symbol.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
If the pdr is for a static function and if a global function with
|
|
|
|
|
the same name exists, lookup_symbol will eventually read in the symtab
|
|
|
|
|
for the global function and clobber cur_fdr. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
FDR *save_cur_fdr = cur_fdr;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
* symtab.h (lookup_symbol_in_language): Remove SYMTAB parameter.
(lookup_symbol): Likewise.
* symtab.c (lookup_symbol_in_language): Remove SYMTAB parameter.
(lookup_symbol): Likewise.
(search_symbols): Update.
* linespec.c (find_methods, collect_methods): Update.
(add_matching_methods, add_constructors): Update.
(decode_compound, decode_dollar, decode_variable): Update.
(lookup_prefix_sym): Update.
(symbol_found): Remove SYM_SYMTAB parameter.
Use SYMBOL_SYMTAB (sym) instead.
* gdbtypes.c (lookup_typename): Update.
(lookup_struct, lookup_union, lookup_enum): Update.
(lookup_template_type): Update.
(check_typedef): Update.
* language.c (lang_bool_type): Update.
* mdebugread.c (parse_procedure): Update.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* parse.c (write_dollar_variable): Update.
* printcmd.c (address_info): Update.
* source.c (select_source_symtab): Update.
* stack.c (print_frame_args, print_frame_arg_vars): Update.
* valops.c (find_function_in_inferior): Update.
(value_struct_elt_for_reference): Update.
* value.c (value_static_field, value_fn_field): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* arm-tdep.c (arm_skip_prologue): Update.
* mt-tdep.c (mt_skip_prologue): Update.
* xstormy16-tdep.c (xstormy16_skip_prologue): Update.
* ada-lang.h (struct ada_symbol_info): Remove SYMTAB member.
* ada-lang.c (ada_add_block_symbols): Remove SYMTAB parameter.
(add_defn_to_vec): Likewise.
(ada_add_block_symbols): Likewise.
(lookup_cached_symbol, cache_symbol): Likewise.
(standard_lookup): Update.
(ada_lookup_symbol_list): Update.
* c-valprint.c (c_val_print): Update.
* cp-support.c (cp_lookup_rtti_type): Update.
* jv-lang.c (java_lookup_class, get_java_object_type): Update.
* objc-lang.c (lookup_struct_typedef, find_imps): Update.
* p-valprint.c (pascal_val_print): Update.
* scm-lang.c (scm_lookup_name): Update.
* c-exp.y: Update.
* f-exp.y: Update.
* jv-exp.y: Update.
* m2-exp.y: Update.
* objc-exp.y: Update.
* p-exp.y: Update.
2008-05-19 23:50:10 +08:00
|
|
|
|
s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cur_fdr = save_cur_fdr;
|
|
|
|
|
#else
|
|
|
|
|
s = mylookup_symbol
|
|
|
|
|
(sh_name,
|
|
|
|
|
BLOCKVECTOR_BLOCK (BLOCKVECTOR (search_symtab), STATIC_BLOCK),
|
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
|
|
|
|
VAR_DOMAIN,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
LOC_BLOCK);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
s = mylookup_symbol (sh_name, top_stack->cur_block,
|
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
|
|
|
|
VAR_DOMAIN, LOC_BLOCK);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (s != 0)
|
|
|
|
|
{
|
|
|
|
|
b = SYMBOL_BLOCK_VALUE (s);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("PDR for %s, but no symbol"), sh_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
#if 1
|
|
|
|
|
return;
|
|
|
|
|
#else
|
|
|
|
|
/* FIXME -- delete. We can't do symbol allocation now; it's all done. */
|
|
|
|
|
s = new_symbol (sh_name);
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMBOL_CLASS (s) = LOC_BLOCK;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Donno its type, hope int is ok. */
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
SYMBOL_TYPE (s)
|
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol,
and nodebug_tls_symbol members.
(struct objfile_type): New data structure.
(objfile_type): Add prototype.
* gdbtypes.c (gdbtypes_post_init): Remove initialization code
for types no longer in struct builtin_type.
(objfile_type_data): New static variable.
(_initialize_gdbtypes): Initialize it.
(objfile_type): New function.
* gdbtypes.h (builtin_type_error): Remove.
* gdbtypes.c (build_complex): Do not use builtin_type_error.
* symtab.c (builtin_type_error): Remove.
(_initialize_symtab): Remove initialization.
* stabsread.c (dbx_lookup_type, define_symbol, error_type,
rs6000_builtin_type, read_range_type): Use per-objfile types
instead of global or per-architecture builtin types.
* coffread.c (decode_type): Likewise.
* dwarf2read.c (read_array_type, read_tag_string_type,
new_symbol, die_type): Likewise.
* mdebugread.c (parse_symbol, basic_type, upgrade_type,
parse_procedure, psymtab_to_symtab_1): Likewise.
* xcoffread.c (process_xcoff_symbol): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* stabsread.c (rs6000_builtin_type_data): New static variable.
(_initialize_stabsread): Initialize it.
(rs6000_builtin_type): Add OBJFILE argument. Allocate builtin
types per-objfile instead of globally.
* stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it
instead of current_objfile; pass it to rs6000_builtin_type.
(dbx_alloc_type, read_type, read_range_type): Update calls.
(cleanup_undefined_types_noname): Add OBJFILE argument and
pass it to dbx_lookup_type.
(cleanup_undefined_types): Add OBJFILE argument and pass it
to cleanup_undefined_types_noname.
* stabsread.h (cleanup_undefined_types): Add OBJFILE argument.
* buildsym.c (end_symtab): Update call.
2009-06-29 21:18:37 +08:00
|
|
|
|
= lookup_function_type (objfile_type (pst->objfile)->builtin_int);
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Won't have symbols for this one. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
b = new_block (2);
|
|
|
|
|
SYMBOL_BLOCK_VALUE (s) = b;
|
|
|
|
|
BLOCK_FUNCTION (b) = s;
|
|
|
|
|
BLOCK_START (b) = pr->adr;
|
|
|
|
|
/* BOUND used to be the end of procedure's text, but the
|
1999-07-08 04:19:36 +08:00
|
|
|
|
argument is no longer passed in. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
BLOCK_END (b) = bound;
|
|
|
|
|
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
|
|
|
|
|
add_block (b, top_stack->cur_st);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-31 10:59:21 +08:00
|
|
|
|
i = mylookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, LOC_CONST);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (i)
|
|
|
|
|
{
|
2009-01-13 19:52:43 +08:00
|
|
|
|
struct mdebug_extra_func_info *e;
|
|
|
|
|
|
|
|
|
|
e = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (i);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
e->pdr = *pr;
|
|
|
|
|
|
|
|
|
|
/* GDB expects the absolute function start address for the
|
1999-07-08 04:19:36 +08:00
|
|
|
|
procedure descriptor in e->pdr.adr.
|
|
|
|
|
As the address in the procedure descriptor is usually relative,
|
|
|
|
|
we would have to relocate e->pdr.adr with cur_fdr->adr and
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)).
|
1999-07-08 04:19:36 +08:00
|
|
|
|
Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
|
|
|
|
|
in shared libraries on some systems, and on other systems
|
|
|
|
|
e->pdr.adr is sometimes offset by a bogus value.
|
|
|
|
|
To work around these problems, we replace e->pdr.adr with
|
|
|
|
|
the start address of the function. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
e->pdr.adr = BLOCK_START (b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* It would be reasonable that functions that have been compiled
|
|
|
|
|
without debugging info have a btNil type for their return value,
|
|
|
|
|
and functions that are void and are compiled with debugging info
|
|
|
|
|
have btVoid.
|
|
|
|
|
gcc and DEC f77 put out btNil types for both cases, so btNil is mapped
|
|
|
|
|
to TYPE_CODE_VOID in parse_type to get the `compiled with debugging info'
|
|
|
|
|
case right.
|
|
|
|
|
The glevel field in cur_fdr could be used to determine the presence
|
|
|
|
|
of debugging info, but GCC doesn't always pass the -g switch settings
|
|
|
|
|
to the assembler and GAS doesn't set the glevel field from the -g switch
|
|
|
|
|
settings.
|
|
|
|
|
To work around these problems, the return value type of a TYPE_CODE_VOID
|
|
|
|
|
function is adjusted accordingly if no debugging info was found in the
|
|
|
|
|
compilation unit. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (processing_gcc_compilation == 0
|
|
|
|
|
&& found_ecoff_debugging_info == 0
|
|
|
|
|
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (s))) == TYPE_CODE_VOID)
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->nodebug_text_symbol;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse the external symbol ES. Just call parse_symbol() after
|
1999-04-16 09:35:26 +08:00
|
|
|
|
making sure we know where the aux are for it.
|
|
|
|
|
BIGEND says whether aux entries are big-endian or little-endian.
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
This routine clobbers top_stack->cur_block and ->cur_st. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void parse_external (EXTR *, int, struct section_offsets *,
|
|
|
|
|
struct objfile *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
|
|
|
|
|
struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
union aux_ext *ax;
|
|
|
|
|
|
|
|
|
|
if (es->ifd != ifdNil)
|
|
|
|
|
{
|
|
|
|
|
cur_fd = es->ifd;
|
|
|
|
|
cur_fdr = debug_info->fdr + cur_fd;
|
|
|
|
|
ax = debug_info->external_aux + cur_fdr->iauxBase;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cur_fdr = debug_info->fdr;
|
|
|
|
|
ax = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Reading .o files */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (es->asym.sc) || es->asym.sc == scNil)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
char *what;
|
|
|
|
|
switch (es->asym.st)
|
|
|
|
|
{
|
|
|
|
|
case stNil:
|
|
|
|
|
/* These are generated for static symbols in .o files,
|
|
|
|
|
ignore them. */
|
|
|
|
|
return;
|
|
|
|
|
case stStaticProc:
|
|
|
|
|
case stProc:
|
|
|
|
|
what = "procedure";
|
|
|
|
|
n_undef_procs++;
|
|
|
|
|
break;
|
|
|
|
|
case stGlobal:
|
|
|
|
|
what = "variable";
|
|
|
|
|
n_undef_vars++;
|
|
|
|
|
break;
|
|
|
|
|
case stLabel:
|
|
|
|
|
what = "label";
|
|
|
|
|
n_undef_labels++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
what = "symbol";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
n_undef_symbols++;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* FIXME: Turn this into a complaint? */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (info_verbose)
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 08:39:24 +08:00
|
|
|
|
printf_filtered (_("Warning: %s `%s' is undefined (in %s)\n"),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
what, debug_info->ssext + es->asym.iss,
|
|
|
|
|
fdr_name (cur_fdr));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (es->asym.st)
|
|
|
|
|
{
|
|
|
|
|
case stProc:
|
|
|
|
|
case stStaticProc:
|
|
|
|
|
/* There is no need to parse the external procedure symbols.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
If they are from objects compiled without -g, their index will
|
|
|
|
|
be indexNil, and the symbol definition from the minimal symbol
|
|
|
|
|
is preferrable (yielding a function returning int instead of int).
|
|
|
|
|
If the index points to a local procedure symbol, the local
|
|
|
|
|
symbol already provides the correct type.
|
|
|
|
|
Note that the index of the external procedure symbol points
|
|
|
|
|
to the local procedure symbol in the local symbol table, and
|
|
|
|
|
_not_ to the auxiliary symbol info. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case stGlobal:
|
|
|
|
|
case stLabel:
|
|
|
|
|
/* Global common symbols are resolved by the runtime loader,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
ignore them. */
|
|
|
|
|
if (SC_IS_COMMON (es->asym.sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* Note that the case of a symbol with indexNil must be handled
|
1999-07-08 04:19:36 +08:00
|
|
|
|
anyways by parse_symbol(). */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
parse_symbol (&es->asym, ax, (char *) NULL,
|
|
|
|
|
bigend, section_offsets, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Parse the line number info for file descriptor FH into
|
|
|
|
|
GDB's linetable LT. MIPS' encoding requires a little bit
|
|
|
|
|
of magic to get things out. Note also that MIPS' line
|
|
|
|
|
numbers can go back and forth, apparently we can live
|
2011-01-09 11:20:33 +08:00
|
|
|
|
with that and do not need to reorder our linetables. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
|
static void parse_lines (FDR *, PDR *, struct linetable *, int,
|
|
|
|
|
struct partial_symtab *, CORE_ADDR);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
|
|
|
|
|
struct partial_symtab *pst, CORE_ADDR lowest_pdr_addr)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
unsigned char *base;
|
|
|
|
|
int j, k;
|
|
|
|
|
int delta, count, lineno = 0;
|
|
|
|
|
|
|
|
|
|
if (fh->cbLine == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Scan by procedure descriptors. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
k = 0;
|
|
|
|
|
for (j = 0; j < fh->cpd; j++, pr++)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR l;
|
|
|
|
|
CORE_ADDR adr;
|
|
|
|
|
unsigned char *halt;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* No code for this one. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (pr->iline == ilineNil ||
|
|
|
|
|
pr->lnLow == -1 || pr->lnHigh == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Determine start and end address of compressed line bytes for
|
1999-07-08 04:19:36 +08:00
|
|
|
|
this procedure. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
base = debug_info->line + fh->cbLineOffset;
|
|
|
|
|
if (j != (fh->cpd - 1))
|
1999-07-08 04:19:36 +08:00
|
|
|
|
halt = base + pr[1].cbLineOffset;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
1999-07-08 04:19:36 +08:00
|
|
|
|
halt = base + fh->cbLine;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
base += pr->cbLineOffset;
|
|
|
|
|
|
2002-09-19 04:47:39 +08:00
|
|
|
|
adr = pst->textlow + pr->adr - lowest_pdr_addr;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
l = adr >> 2; /* in words */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
for (lineno = pr->lnLow; base < halt;)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
count = *base & 0x0f;
|
|
|
|
|
delta = *base++ >> 4;
|
|
|
|
|
if (delta >= 8)
|
|
|
|
|
delta -= 16;
|
|
|
|
|
if (delta == -8)
|
|
|
|
|
{
|
|
|
|
|
delta = (base[0] << 8) | base[1];
|
|
|
|
|
if (delta >= 0x8000)
|
|
|
|
|
delta -= 0x10000;
|
|
|
|
|
base += 2;
|
|
|
|
|
}
|
|
|
|
|
lineno += delta; /* first delta is 0 */
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Complain if the line table overflows. Could happen
|
1999-04-16 09:35:26 +08:00
|
|
|
|
with corrupt binaries. */
|
|
|
|
|
if (lt->nitems >= maxlines)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("guessed size of linetable for %s incorrectly"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
fdr_name (fh));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
k = add_line (lt, lineno, l, k);
|
|
|
|
|
l += count + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
static void
|
|
|
|
|
function_outside_compilation_unit_complaint (const char *arg1)
|
|
|
|
|
{
|
|
|
|
|
complaint (&symfile_complaints,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
_("function `%s' appears to be defined "
|
|
|
|
|
"outside of all compilation units"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
arg1);
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-23 11:28:38 +08:00
|
|
|
|
/* Use the STORAGE_CLASS to compute which section the given symbol
|
|
|
|
|
belongs to, and then records this new minimal symbol. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
record_minimal_symbol (const char *name, const CORE_ADDR address,
|
|
|
|
|
enum minimal_symbol_type ms_type, int storage_class,
|
|
|
|
|
struct objfile *objfile)
|
|
|
|
|
{
|
|
|
|
|
int section;
|
|
|
|
|
|
|
|
|
|
switch (storage_class)
|
|
|
|
|
{
|
|
|
|
|
case scText:
|
|
|
|
|
section = SECT_OFF_TEXT (objfile);
|
|
|
|
|
break;
|
|
|
|
|
case scData:
|
|
|
|
|
section = SECT_OFF_DATA (objfile);
|
|
|
|
|
break;
|
|
|
|
|
case scBss:
|
|
|
|
|
section = SECT_OFF_BSS (objfile);
|
|
|
|
|
break;
|
|
|
|
|
case scSData:
|
|
|
|
|
section = get_section_index (objfile, ".sdata");
|
|
|
|
|
break;
|
|
|
|
|
case scSBss:
|
|
|
|
|
section = get_section_index (objfile, ".sbss");
|
|
|
|
|
break;
|
|
|
|
|
case scRData:
|
|
|
|
|
section = get_section_index (objfile, ".rdata");
|
|
|
|
|
break;
|
|
|
|
|
case scInit:
|
|
|
|
|
section = get_section_index (objfile, ".init");
|
|
|
|
|
break;
|
|
|
|
|
case scXData:
|
|
|
|
|
section = get_section_index (objfile, ".xdata");
|
|
|
|
|
break;
|
|
|
|
|
case scPData:
|
|
|
|
|
section = get_section_index (objfile, ".pdata");
|
|
|
|
|
break;
|
|
|
|
|
case scFini:
|
|
|
|
|
section = get_section_index (objfile, ".fini");
|
|
|
|
|
break;
|
|
|
|
|
case scRConst:
|
|
|
|
|
section = get_section_index (objfile, ".rconst");
|
|
|
|
|
break;
|
|
|
|
|
#ifdef scTlsData
|
|
|
|
|
case scTlsData:
|
|
|
|
|
section = get_section_index (objfile, ".tlsdata");
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef scTlsBss
|
|
|
|
|
case scTlsBss:
|
|
|
|
|
section = get_section_index (objfile, ".tlsbss");
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
default:
|
|
|
|
|
/* This kind of symbol is not associated to a section. */
|
|
|
|
|
section = -1;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-02 00:41:27 +08:00
|
|
|
|
prim_record_minimal_symbol_and_info (name, address, ms_type,
|
2013-04-09 04:13:22 +08:00
|
|
|
|
section, objfile);
|
2005-05-23 11:28:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Master parsing procedure for first-pass reading of file symbols
|
|
|
|
|
into a partial_symtab. */
|
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
parse_partial_symbols (struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2008-03-26 22:53:28 +08:00
|
|
|
|
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
|
|
|
|
|
const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
|
|
|
|
|
const bfd_size_type external_ext_size = debug_swap->external_ext_size;
|
2002-03-20 03:00:04 +08:00
|
|
|
|
void (*const swap_ext_in) (bfd *, void *, EXTR *) = debug_swap->swap_ext_in;
|
|
|
|
|
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
|
|
|
|
|
void (*const swap_rfd_in) (bfd *, void *, RFDT *) = debug_swap->swap_rfd_in;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int f_idx, s_idx;
|
|
|
|
|
HDRR *hdr = &debug_info->symbolic_header;
|
|
|
|
|
/* Running pointers */
|
|
|
|
|
FDR *fh;
|
|
|
|
|
char *ext_out;
|
|
|
|
|
char *ext_out_end;
|
|
|
|
|
EXTR *ext_block;
|
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
|
|
|
|
EXTR *ext_in;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
EXTR *ext_in_end;
|
|
|
|
|
SYMR sh;
|
|
|
|
|
struct partial_symtab *pst;
|
|
|
|
|
int textlow_not_set = 1;
|
|
|
|
|
int past_first_source_file = 0;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* List of current psymtab's include files. */
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
const char **psymtab_include_list;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int includes_allocated;
|
|
|
|
|
int includes_used;
|
|
|
|
|
EXTR *extern_tab;
|
|
|
|
|
struct pst_map *fdr_to_pst;
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Index within current psymtab dependency list. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct partial_symtab **dependency_list;
|
|
|
|
|
int dependencies_used, dependencies_allocated;
|
|
|
|
|
struct cleanup *old_chain;
|
|
|
|
|
char *name;
|
|
|
|
|
enum language prev_language;
|
|
|
|
|
asection *text_sect;
|
|
|
|
|
int relocatable = 0;
|
|
|
|
|
|
|
|
|
|
/* Irix 5.2 shared libraries have a fh->adr field of zero, but
|
|
|
|
|
the shared libraries are prelinked at a high memory address.
|
|
|
|
|
We have to adjust the start address of the object file for this case,
|
|
|
|
|
by setting it to the start address of the first procedure in the file.
|
|
|
|
|
But we should do no adjustments if we are debugging a .o file, where
|
|
|
|
|
the text section (and fh->adr) really starts at zero. */
|
|
|
|
|
text_sect = bfd_get_section_by_name (cur_bfd, ".text");
|
|
|
|
|
if (text_sect != NULL
|
|
|
|
|
&& (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
|
|
|
|
|
relocatable = 1;
|
|
|
|
|
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-08 02:29:54 +08:00
|
|
|
|
extern_tab = (EXTR *) obstack_alloc (&objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
sizeof (EXTR) * hdr->iextMax);
|
|
|
|
|
|
|
|
|
|
includes_allocated = 30;
|
|
|
|
|
includes_used = 0;
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
psymtab_include_list = (const char **) alloca (includes_allocated *
|
|
|
|
|
sizeof (const char *));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
next_symbol_text_func = mdebug_next_symbol_text;
|
|
|
|
|
|
|
|
|
|
dependencies_allocated = 30;
|
|
|
|
|
dependencies_used = 0;
|
|
|
|
|
dependency_list =
|
|
|
|
|
(struct partial_symtab **) alloca (dependencies_allocated *
|
|
|
|
|
sizeof (struct partial_symtab *));
|
|
|
|
|
|
2013-01-22 02:05:13 +08:00
|
|
|
|
set_last_source_file (NULL);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Big plan:
|
|
|
|
|
*
|
|
|
|
|
* Only parse the Local and External symbols, and the Relative FDR.
|
|
|
|
|
* Fixup enough of the loader symtab to be able to use it.
|
|
|
|
|
* Allocate space only for the file's portions we need to
|
2011-01-09 11:20:33 +08:00
|
|
|
|
* look at. (XXX)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
max_gdbinfo = 0;
|
|
|
|
|
max_glevel = MIN_GLEVEL;
|
|
|
|
|
|
|
|
|
|
/* Allocate the map FDR -> PST.
|
|
|
|
|
Minor hack: -O3 images might claim some global data belongs
|
2011-01-09 11:20:33 +08:00
|
|
|
|
to FDR -1. We`ll go along with that. */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
fdr_to_pst = (struct pst_map *)
|
|
|
|
|
xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
|
2000-12-15 09:01:51 +08:00
|
|
|
|
old_chain = make_cleanup (xfree, fdr_to_pst);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fdr_to_pst++;
|
|
|
|
|
{
|
1999-09-09 08:02:17 +08:00
|
|
|
|
struct partial_symtab *pst = new_psymtab ("", objfile);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fdr_to_pst[-1].pst = pst;
|
|
|
|
|
FDR_IDX (pst) = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Allocate the global pending list. */
|
|
|
|
|
pending_list =
|
|
|
|
|
((struct mdebug_pending **)
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-08 02:29:54 +08:00
|
|
|
|
obstack_alloc (&objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
hdr->ifdMax * sizeof (struct mdebug_pending *)));
|
2002-03-20 03:00:04 +08:00
|
|
|
|
memset (pending_list, 0,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
hdr->ifdMax * sizeof (struct mdebug_pending *));
|
|
|
|
|
|
|
|
|
|
/* Pass 0 over external syms: swap them in. */
|
|
|
|
|
ext_block = (EXTR *) xmalloc (hdr->iextMax * sizeof (EXTR));
|
2000-12-15 09:01:51 +08:00
|
|
|
|
make_cleanup (xfree, ext_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
ext_out = (char *) debug_info->external_ext;
|
|
|
|
|
ext_out_end = ext_out + hdr->iextMax * external_ext_size;
|
|
|
|
|
ext_in = ext_block;
|
|
|
|
|
for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
|
|
|
|
|
(*swap_ext_in) (cur_bfd, ext_out, ext_in);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pass 1 over external syms: Presize and partition the list. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ext_in = ext_block;
|
|
|
|
|
ext_in_end = ext_in + hdr->iextMax;
|
|
|
|
|
for (; ext_in < ext_in_end; ext_in++)
|
|
|
|
|
{
|
|
|
|
|
/* See calls to complain below. */
|
|
|
|
|
if (ext_in->ifd >= -1
|
|
|
|
|
&& ext_in->ifd < hdr->ifdMax
|
|
|
|
|
&& ext_in->asym.iss >= 0
|
|
|
|
|
&& ext_in->asym.iss < hdr->issExtMax)
|
|
|
|
|
fdr_to_pst[ext_in->ifd].n_globals++;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pass 1.5 over files: partition out global symbol space. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
s_idx = 0;
|
|
|
|
|
for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++)
|
|
|
|
|
{
|
|
|
|
|
fdr_to_pst[f_idx].globals_offset = s_idx;
|
|
|
|
|
s_idx += fdr_to_pst[f_idx].n_globals;
|
|
|
|
|
fdr_to_pst[f_idx].n_globals = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ECOFF in ELF:
|
|
|
|
|
|
|
|
|
|
For ECOFF in ELF, we skip the creation of the minimal symbols.
|
|
|
|
|
The ECOFF symbols should be a subset of the Elf symbols, and the
|
|
|
|
|
section information of the elf symbols will be more accurate.
|
|
|
|
|
FIXME! What about Irix 5's native linker?
|
|
|
|
|
|
|
|
|
|
By default, Elf sections which don't exist in ECOFF
|
|
|
|
|
get put in ECOFF's absolute section by the gnu linker.
|
|
|
|
|
Since absolute sections don't get relocated, we
|
|
|
|
|
end up calculating an address different from that of
|
|
|
|
|
the symbol's minimal symbol (created earlier from the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Elf symtab).
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
To fix this, either :
|
|
|
|
|
1) don't create the duplicate symbol
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(assumes ECOFF symtab is a subset of the ELF symtab;
|
|
|
|
|
assumes no side-effects result from ignoring ECOFF symbol)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2) create it, only if lookup for existing symbol in ELF's minimal
|
1999-07-08 04:19:36 +08:00
|
|
|
|
symbols fails
|
|
|
|
|
(inefficient;
|
|
|
|
|
assumes no side-effects result from ignoring ECOFF symbol)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
3) create it, but lookup ELF's minimal symbol and use it's section
|
1999-07-08 04:19:36 +08:00
|
|
|
|
during relocation, then modify "uniqify" phase to merge and
|
|
|
|
|
eliminate the duplicate symbol
|
|
|
|
|
(highly inefficient)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
I've implemented #1 here...
|
|
|
|
|
Skip the creation of the minimal symbols based on the ECOFF
|
2011-01-09 11:20:33 +08:00
|
|
|
|
symbol table. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pass 2 over external syms: fill in external symbols. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
ext_in = ext_block;
|
|
|
|
|
ext_in_end = ext_in + hdr->iextMax;
|
|
|
|
|
for (; ext_in < ext_in_end; ext_in++)
|
|
|
|
|
{
|
|
|
|
|
enum minimal_symbol_type ms_type = mst_text;
|
|
|
|
|
CORE_ADDR svalue = ext_in->asym.value;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
/* The Irix 5 native tools seem to sometimes generate bogus
|
|
|
|
|
external symbols. */
|
|
|
|
|
if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
_("bad ifd for external symbol: %d (max %ld)"),
|
|
|
|
|
ext_in->ifd, hdr->ifdMax);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
|
|
|
|
|
{
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("bad iss for external symbol: %ld (max %ld)"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
ext_in->asym.iss, hdr->issExtMax);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
extern_tab[fdr_to_pst[ext_in->ifd].globals_offset
|
|
|
|
|
+ fdr_to_pst[ext_in->ifd].n_globals++] = *ext_in;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (ext_in->asym.sc) || ext_in->asym.sc == scNil)
|
|
|
|
|
continue;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pass 3 over files, over local syms: fill in static symbols. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
name = debug_info->ssext + ext_in->asym.iss;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Process ECOFF Symbol Types and Storage Classes. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
switch (ext_in->asym.st)
|
|
|
|
|
{
|
|
|
|
|
case stProc:
|
|
|
|
|
/* Beginnning of Procedure */
|
|
|
|
|
break;
|
|
|
|
|
case stStaticProc:
|
|
|
|
|
/* Load time only static procs */
|
|
|
|
|
ms_type = mst_file_text;
|
|
|
|
|
break;
|
|
|
|
|
case stGlobal:
|
|
|
|
|
/* External symbol */
|
|
|
|
|
if (SC_IS_COMMON (ext_in->asym.sc))
|
|
|
|
|
{
|
|
|
|
|
/* The value of a common symbol is its size, not its address.
|
|
|
|
|
Ignore it. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
|
|
|
|
else if (SC_IS_DATA (ext_in->asym.sc))
|
|
|
|
|
{
|
|
|
|
|
ms_type = mst_data;
|
|
|
|
|
}
|
|
|
|
|
else if (SC_IS_BSS (ext_in->asym.sc))
|
|
|
|
|
{
|
|
|
|
|
ms_type = mst_bss;
|
|
|
|
|
}
|
2002-04-22 18:19:35 +08:00
|
|
|
|
else if (SC_IS_SBSS (ext_in->asym.sc))
|
|
|
|
|
{
|
|
|
|
|
ms_type = mst_bss;
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
else
|
|
|
|
|
ms_type = mst_abs;
|
|
|
|
|
break;
|
|
|
|
|
case stLabel:
|
|
|
|
|
/* Label */
|
2002-04-22 18:19:35 +08:00
|
|
|
|
|
|
|
|
|
/* On certain platforms, some extra label symbols can be
|
2011-01-09 11:20:33 +08:00
|
|
|
|
generated by the linker. One possible usage for this kind
|
2002-04-22 18:19:35 +08:00
|
|
|
|
of symbols is to represent the address of the begining of a
|
2011-01-09 11:20:33 +08:00
|
|
|
|
given section. For instance, on Tru64 5.1, the address of
|
2002-04-22 18:19:35 +08:00
|
|
|
|
the _ftext label is the start address of the .text section.
|
|
|
|
|
|
|
|
|
|
The storage class of these symbols is usually directly
|
2011-01-09 11:20:33 +08:00
|
|
|
|
related to the section to which the symbol refers. For
|
2002-04-22 18:19:35 +08:00
|
|
|
|
instance, on Tru64 5.1, the storage class for the _fdata
|
|
|
|
|
label is scData, refering to the .data section.
|
|
|
|
|
|
|
|
|
|
It is actually possible that the section associated to the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
storage class of the label does not exist. On True64 5.1
|
2002-04-22 18:19:35 +08:00
|
|
|
|
for instance, the libm.so shared library does not contain
|
|
|
|
|
any .data section, although it contains a _fpdata label
|
2011-01-09 11:20:33 +08:00
|
|
|
|
which storage class is scData... Since these symbols are
|
2002-04-22 18:19:35 +08:00
|
|
|
|
usually useless for the debugger user anyway, we just
|
2011-01-09 11:20:33 +08:00
|
|
|
|
discard these symbols. */
|
2002-04-22 18:19:35 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_TEXT (ext_in->asym.sc))
|
|
|
|
|
{
|
2002-04-22 18:19:35 +08:00
|
|
|
|
if (objfile->sect_index_text == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
ms_type = mst_file_text;
|
|
|
|
|
}
|
|
|
|
|
else if (SC_IS_DATA (ext_in->asym.sc))
|
|
|
|
|
{
|
2002-04-22 18:19:35 +08:00
|
|
|
|
if (objfile->sect_index_data == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
ms_type = mst_file_data;
|
|
|
|
|
}
|
|
|
|
|
else if (SC_IS_BSS (ext_in->asym.sc))
|
|
|
|
|
{
|
2002-04-22 18:19:35 +08:00
|
|
|
|
if (objfile->sect_index_bss == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
ms_type = mst_file_bss;
|
|
|
|
|
}
|
2002-04-22 18:19:35 +08:00
|
|
|
|
else if (SC_IS_SBSS (ext_in->asym.sc))
|
|
|
|
|
{
|
|
|
|
|
const int sbss_sect_index = get_section_index (objfile, ".sbss");
|
|
|
|
|
|
|
|
|
|
if (sbss_sect_index == -1)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
ms_type = mst_file_bss;
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
else
|
|
|
|
|
ms_type = mst_abs;
|
|
|
|
|
break;
|
|
|
|
|
case stLocal:
|
|
|
|
|
case stNil:
|
|
|
|
|
/* The alpha has the section start addresses in stLocal symbols
|
2011-01-09 11:20:33 +08:00
|
|
|
|
whose name starts with a `.'. Skip those but complain for all
|
1999-07-08 04:19:36 +08:00
|
|
|
|
other stLocal symbols.
|
|
|
|
|
Irix6 puts the section start addresses in stNil symbols, skip
|
2011-01-09 11:20:33 +08:00
|
|
|
|
those too. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (name[0] == '.')
|
|
|
|
|
continue;
|
|
|
|
|
/* Fall through. */
|
|
|
|
|
default:
|
|
|
|
|
ms_type = mst_unknown;
|
2002-12-17 08:39:08 +08:00
|
|
|
|
unknown_ext_complaint (name);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
|
|
|
|
if (!ECOFF_IN_ELF (cur_bfd))
|
2005-05-23 11:28:38 +08:00
|
|
|
|
record_minimal_symbol (name, svalue, ms_type, ext_in->asym.sc,
|
|
|
|
|
objfile);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Pass 3 over files, over local syms: fill in static symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
|
|
|
|
|
{
|
|
|
|
|
struct partial_symtab *save_pst;
|
|
|
|
|
EXTR *ext_ptr;
|
|
|
|
|
CORE_ADDR textlow;
|
|
|
|
|
|
|
|
|
|
cur_fdr = fh = debug_info->fdr + f_idx;
|
|
|
|
|
|
|
|
|
|
if (fh->csym == 0)
|
|
|
|
|
{
|
|
|
|
|
fdr_to_pst[f_idx].pst = NULL;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Determine the start address for this object file from the
|
1999-07-08 04:19:36 +08:00
|
|
|
|
file header and relocate it, except for Irix 5.2 zero fh->adr. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (fh->cpd)
|
|
|
|
|
{
|
|
|
|
|
textlow = fh->adr;
|
|
|
|
|
if (relocatable || textlow != 0)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
textlow += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
textlow = 0;
|
1999-09-09 08:02:17 +08:00
|
|
|
|
pst = start_psymtab_common (objfile, objfile->section_offsets,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fdr_name (fh),
|
|
|
|
|
textlow,
|
|
|
|
|
objfile->global_psymbols.next,
|
|
|
|
|
objfile->static_psymbols.next);
|
2010-03-11 02:27:00 +08:00
|
|
|
|
pst->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
|
|
|
|
|
sizeof (struct symloc));
|
2002-03-20 03:00:04 +08:00
|
|
|
|
memset (pst->read_symtab_private, 0, sizeof (struct symloc));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
save_pst = pst;
|
|
|
|
|
FDR_IDX (pst) = f_idx;
|
|
|
|
|
CUR_BFD (pst) = cur_bfd;
|
|
|
|
|
DEBUG_SWAP (pst) = debug_swap;
|
|
|
|
|
DEBUG_INFO (pst) = debug_info;
|
|
|
|
|
PENDING_LIST (pst) = pending_list;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* The way to turn this into a symtab is to call... */
|
2013-01-18 11:09:42 +08:00
|
|
|
|
pst->read_symtab = mdebug_read_symtab;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Set up language for the pst.
|
|
|
|
|
The language from the FDR is used if it is unambigious (e.g. cfront
|
1999-07-08 04:19:36 +08:00
|
|
|
|
with native cc and g++ will set the language to C).
|
|
|
|
|
Otherwise we have to deduce the language from the filename.
|
|
|
|
|
Native ecoff has every header file in a separate FDR, so
|
|
|
|
|
deduce_language_from_filename will return language_unknown for
|
|
|
|
|
a header file, which is not what we want.
|
|
|
|
|
But the FDRs for the header files are after the FDR for the source
|
|
|
|
|
file, so we can assign the language of the source file to the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
following header files. Then we save the language in the private
|
1999-07-08 04:19:36 +08:00
|
|
|
|
pst data so that we can reuse it when building symtabs. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
prev_language = psymtab_language;
|
|
|
|
|
|
|
|
|
|
switch (fh->lang)
|
|
|
|
|
{
|
|
|
|
|
case langCplusplusV2:
|
|
|
|
|
psymtab_language = language_cplus;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
psymtab_language = deduce_language_from_filename (fdr_name (fh));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (psymtab_language == language_unknown)
|
|
|
|
|
psymtab_language = prev_language;
|
|
|
|
|
PST_PRIVATE (pst)->pst_language = psymtab_language;
|
|
|
|
|
|
2002-09-19 04:47:39 +08:00
|
|
|
|
pst->texthigh = pst->textlow;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* For stabs-in-ecoff files, the second symbol must be @stab.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
This symbol is emitted by mips-tfile to signal that the
|
|
|
|
|
current object file uses encapsulated stabs instead of mips
|
|
|
|
|
ecoff for local symbols. (It is the second symbol because
|
|
|
|
|
the first symbol is the stFile used to signal the start of a
|
2011-01-09 11:20:33 +08:00
|
|
|
|
file). */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
processing_gcc_compilation = 0;
|
|
|
|
|
if (fh->csym >= 2)
|
|
|
|
|
{
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ (fh->isymBase + 1) * external_sym_size),
|
|
|
|
|
&sh);
|
2004-01-18 09:22:57 +08:00
|
|
|
|
if (strcmp (debug_info->ss + fh->issBase + sh.iss,
|
|
|
|
|
stabs_symbol) == 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
processing_gcc_compilation = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (processing_gcc_compilation != 0)
|
|
|
|
|
{
|
|
|
|
|
for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++)
|
|
|
|
|
{
|
|
|
|
|
int type_code;
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
const char *namestring;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
(((char *) debug_info->external_sym)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
+ (fh->isymBase + cur_sdx) * external_sym_size),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&sh);
|
|
|
|
|
type_code = ECOFF_UNMARK_STAB (sh.index);
|
|
|
|
|
if (!ECOFF_IS_STAB (&sh))
|
|
|
|
|
{
|
|
|
|
|
if (sh.st == stProc || sh.st == stStaticProc)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR procaddr;
|
|
|
|
|
long isym;
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (sh.st == stStaticProc)
|
|
|
|
|
{
|
|
|
|
|
namestring = debug_info->ss + fh->issBase + sh.iss;
|
2005-05-23 11:28:38 +08:00
|
|
|
|
record_minimal_symbol (namestring, sh.value,
|
|
|
|
|
mst_file_text, sh.sc,
|
|
|
|
|
objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
2013-10-16 03:28:57 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
procaddr = sh.value;
|
|
|
|
|
|
|
|
|
|
isym = AUX_GET_ISYM (fh->fBigendian,
|
|
|
|
|
(debug_info->external_aux
|
|
|
|
|
+ fh->iauxBase
|
|
|
|
|
+ sh.index));
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ ((fh->isymBase + isym - 1)
|
|
|
|
|
* external_sym_size)),
|
|
|
|
|
&sh);
|
|
|
|
|
if (sh.st == stEnd)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR high = procaddr + sh.value;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
/* Kludge for Irix 5.2 zero fh->adr. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (!relocatable
|
2002-09-19 04:47:39 +08:00
|
|
|
|
&& (pst->textlow == 0 || procaddr < pst->textlow))
|
|
|
|
|
pst->textlow = procaddr;
|
|
|
|
|
if (high > pst->texthigh)
|
|
|
|
|
pst->texthigh = high;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (sh.st == stStatic)
|
|
|
|
|
{
|
|
|
|
|
switch (sh.sc)
|
|
|
|
|
{
|
|
|
|
|
case scUndefined:
|
|
|
|
|
case scSUndefined:
|
|
|
|
|
case scNil:
|
|
|
|
|
case scAbs:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case scData:
|
|
|
|
|
case scSData:
|
|
|
|
|
case scRData:
|
|
|
|
|
case scPData:
|
|
|
|
|
case scXData:
|
|
|
|
|
namestring = debug_info->ss + fh->issBase + sh.iss;
|
2005-05-23 11:28:38 +08:00
|
|
|
|
record_minimal_symbol (namestring, sh.value,
|
|
|
|
|
mst_file_data, sh.sc,
|
|
|
|
|
objfile);
|
2013-10-16 03:28:57 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* FIXME! Shouldn't this use cases for bss,
|
2011-01-09 11:20:33 +08:00
|
|
|
|
then have the default be abs? */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
namestring = debug_info->ss + fh->issBase + sh.iss;
|
2005-05-23 11:28:38 +08:00
|
|
|
|
record_minimal_symbol (namestring, sh.value,
|
|
|
|
|
mst_file_bss, sh.sc,
|
|
|
|
|
objfile);
|
2013-10-16 03:28:57 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_BSS (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Handle stabs continuation. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
char *stabstring = debug_info->ss + fh->issBase + sh.iss;
|
|
|
|
|
int len = strlen (stabstring);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
while (stabstring[len - 1] == '\\')
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
SYMR sh2;
|
|
|
|
|
char *stabstring1 = stabstring;
|
|
|
|
|
char *stabstring2;
|
|
|
|
|
int len2;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Ignore continuation char from 1st string. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
len--;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Read next stabstring. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cur_sdx++;
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
(((char *) debug_info->external_sym)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
+ (fh->isymBase + cur_sdx)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
* external_sym_size),
|
|
|
|
|
&sh2);
|
|
|
|
|
stabstring2 = debug_info->ss + fh->issBase + sh2.iss;
|
|
|
|
|
len2 = strlen (stabstring2);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Concatinate stabstring2 with stabstring1. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (stabstring
|
1999-07-08 04:19:36 +08:00
|
|
|
|
&& stabstring != debug_info->ss + fh->issBase + sh.iss)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
stabstring = xrealloc (stabstring, len + len2 + 1);
|
|
|
|
|
else
|
2002-01-24 12:08:33 +08:00
|
|
|
|
{
|
|
|
|
|
stabstring = xmalloc (len + len2 + 1);
|
|
|
|
|
strcpy (stabstring, stabstring1);
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
strcpy (stabstring + len, stabstring2);
|
|
|
|
|
len += len2;
|
|
|
|
|
}
|
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
switch (type_code)
|
|
|
|
|
{
|
|
|
|
|
char *p;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Standard, external, non-debugger, symbols. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
case N_TEXT | N_EXT:
|
|
|
|
|
case N_NBTEXT | N_EXT:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
goto record_it;
|
|
|
|
|
|
|
|
|
|
case N_DATA | N_EXT:
|
|
|
|
|
case N_NBDATA | N_EXT:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
goto record_it;
|
|
|
|
|
|
|
|
|
|
case N_BSS:
|
|
|
|
|
case N_BSS | N_EXT:
|
|
|
|
|
case N_NBBSS | N_EXT:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case N_SETV | N_EXT: /* FIXME, is this in BSS? */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_BSS (objfile));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
goto record_it;
|
|
|
|
|
|
|
|
|
|
case N_ABS | N_EXT:
|
|
|
|
|
record_it:
|
2011-03-03 07:54:16 +08:00
|
|
|
|
continue;
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Standard, local, non-debugger, symbols. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
case N_NBTEXT:
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* We need to be able to deal with both N_FN or
|
|
|
|
|
N_TEXT, because we have no way of knowing
|
|
|
|
|
whether the sys-supplied ld or GNU ld was used
|
|
|
|
|
to make the executable. Sequents throw in
|
|
|
|
|
another wrinkle -- they renumbered N_FN. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
case N_FN:
|
|
|
|
|
case N_FN_SEQ:
|
|
|
|
|
case N_TEXT:
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case N_DATA:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
goto record_it;
|
|
|
|
|
|
|
|
|
|
case N_UNDF | N_EXT:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
continue; /* Just undefined, not COMMON. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
case N_UNDF:
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Lots of symbol types we can just ignore. */
|
|
|
|
|
|
|
|
|
|
case N_ABS:
|
|
|
|
|
case N_NBDATA:
|
|
|
|
|
case N_NBBSS:
|
|
|
|
|
continue;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Keep going . . . */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Special symbol types for GNU
|
|
|
|
|
*/
|
|
|
|
|
case N_INDR:
|
|
|
|
|
case N_INDR | N_EXT:
|
|
|
|
|
case N_SETA:
|
|
|
|
|
case N_SETA | N_EXT:
|
|
|
|
|
case N_SETT:
|
|
|
|
|
case N_SETT | N_EXT:
|
|
|
|
|
case N_SETD:
|
|
|
|
|
case N_SETD | N_EXT:
|
|
|
|
|
case N_SETB:
|
|
|
|
|
case N_SETB | N_EXT:
|
|
|
|
|
case N_SETV:
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Debugger symbols
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
case N_SO:
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR valu;
|
|
|
|
|
static int prev_so_symnum = -10;
|
|
|
|
|
static int first_so_symnum;
|
2011-03-24 02:23:56 +08:00
|
|
|
|
const char *p;
|
2001-11-07 06:35:25 +08:00
|
|
|
|
int prev_textlow_not_set;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
valu = sh.value + ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
prev_textlow_not_set = textlow_not_set;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* A zero value is probably an indication for the
|
2011-01-09 11:20:33 +08:00
|
|
|
|
SunPRO 3.0 compiler. end_psymtab explicitly tests
|
2011-01-06 06:22:53 +08:00
|
|
|
|
for zero, so don't relocate it. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2007-10-19 20:26:35 +08:00
|
|
|
|
if (sh.value == 0
|
2008-03-26 22:53:28 +08:00
|
|
|
|
&& gdbarch_sofun_address_maybe_missing (gdbarch))
|
2001-11-07 06:35:25 +08:00
|
|
|
|
{
|
|
|
|
|
textlow_not_set = 1;
|
|
|
|
|
valu = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
textlow_not_set = 0;
|
2007-10-19 20:26:35 +08:00
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
past_first_source_file = 1;
|
|
|
|
|
|
|
|
|
|
if (prev_so_symnum != symnum - 1)
|
2011-01-09 11:20:33 +08:00
|
|
|
|
{ /* Here if prev stab wasn't N_SO. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
first_so_symnum = symnum;
|
|
|
|
|
|
|
|
|
|
if (pst)
|
|
|
|
|
{
|
|
|
|
|
pst = (struct partial_symtab *) 0;
|
|
|
|
|
includes_used = 0;
|
|
|
|
|
dependencies_used = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prev_so_symnum = symnum;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* End the current partial symtab and start a
|
|
|
|
|
new one. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
/* SET_NAMESTRING ();*/
|
|
|
|
|
namestring = stabstring;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Null name means end of .o file. Don't start a new
|
2011-01-09 11:20:33 +08:00
|
|
|
|
one. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
if (*namestring == '\000')
|
|
|
|
|
continue;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Some compilers (including gcc) emit a pair of
|
|
|
|
|
initial N_SOs. The first one is a directory name;
|
|
|
|
|
the second the file name. If pst exists, is
|
|
|
|
|
empty, and has a filename ending in '/', we assume
|
2011-01-09 11:20:33 +08:00
|
|
|
|
the previous N_SO was a directory name. */
|
2011-03-24 02:23:56 +08:00
|
|
|
|
p = lbasename (namestring);
|
|
|
|
|
if (p != namestring && *p == '\000')
|
2011-01-06 06:22:53 +08:00
|
|
|
|
continue; /* Simply ignore directory
|
2011-01-09 11:20:33 +08:00
|
|
|
|
name SOs. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Some other compilers (C++ ones in particular) emit
|
|
|
|
|
useless SOs for non-existant .c files. We ignore
|
|
|
|
|
all subsequent SOs that immediately follow the
|
|
|
|
|
first. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
if (!pst)
|
|
|
|
|
pst = save_pst;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case N_BINCL:
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case N_SOL:
|
|
|
|
|
{
|
|
|
|
|
enum language tmp_language;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Mark down an include file in the current psymtab. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* SET_NAMESTRING (); */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
namestring = stabstring;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
tmp_language
|
|
|
|
|
= deduce_language_from_filename (namestring);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Only change the psymtab's language if we've
|
|
|
|
|
learned something useful (eg. tmp_language is not
|
|
|
|
|
language_unknown). In addition, to match what
|
|
|
|
|
start_subfile does, never change from C++ to
|
|
|
|
|
C. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
if (tmp_language != language_unknown
|
|
|
|
|
&& (tmp_language != language_c
|
|
|
|
|
|| psymtab_language != language_cplus))
|
|
|
|
|
psymtab_language = tmp_language;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* In C++, one may expect the same filename to come
|
|
|
|
|
round many times, when code is coming alternately
|
|
|
|
|
from the main file and from inline functions in
|
2011-01-09 11:20:33 +08:00
|
|
|
|
other files. So I check to see if this is a file
|
2011-01-06 06:22:53 +08:00
|
|
|
|
we've seen before -- either the main source file,
|
|
|
|
|
or a previously included file.
|
|
|
|
|
|
|
|
|
|
This seems to be a lot of time to be spending on
|
|
|
|
|
N_SOL, but things like "break c-exp.y:435" need to
|
|
|
|
|
work (I suppose the psymtab_include_list could be
|
|
|
|
|
hashed or put in a binary tree, if profiling shows
|
|
|
|
|
this is a major hog). */
|
2011-03-24 02:23:56 +08:00
|
|
|
|
if (pst && filename_cmp (namestring, pst->filename) == 0)
|
2001-11-07 06:35:25 +08:00
|
|
|
|
continue;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
{
|
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
|
|
|
|
int i;
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
for (i = 0; i < includes_used; i++)
|
2011-03-24 02:23:56 +08:00
|
|
|
|
if (filename_cmp (namestring,
|
|
|
|
|
psymtab_include_list[i]) == 0)
|
2001-11-07 06:35:25 +08:00
|
|
|
|
{
|
|
|
|
|
i = -1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (i == -1)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
psymtab_include_list[includes_used++] = namestring;
|
|
|
|
|
if (includes_used >= includes_allocated)
|
|
|
|
|
{
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
const char **orig = psymtab_include_list;
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
psymtab_include_list = (const char **)
|
2001-11-07 06:35:25 +08:00
|
|
|
|
alloca ((includes_allocated *= 2) *
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
sizeof (const char *));
|
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
|
|
|
|
memcpy (psymtab_include_list, orig,
|
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 12:48:23 +08:00
|
|
|
|
includes_used * sizeof (const char *));
|
2001-11-07 06:35:25 +08:00
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case N_LSYM: /* Typedef or automatic variable. */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_STSYM: /* Data seg var -- static */
|
|
|
|
|
case N_LCSYM: /* BSS " */
|
|
|
|
|
case N_ROSYM: /* Read-only data seg var -- static. */
|
|
|
|
|
case N_NBSTS: /* Gould nobase. */
|
|
|
|
|
case N_NBLCS: /* symbols. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
case N_FUN:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_GSYM: /* Global (extern) variable; can be
|
|
|
|
|
data or bss (sigh FIXME). */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
/* Following may probably be ignored; I'll leave them here
|
|
|
|
|
for now (until I do Pascal and Modula 2 extensions). */
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_PC: /* I may or may not need this; I
|
|
|
|
|
suspect not. */
|
|
|
|
|
case N_M2C: /* I suspect that I can ignore this
|
2011-01-09 11:20:33 +08:00
|
|
|
|
here. */
|
|
|
|
|
case N_SCOPE: /* Same. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* SET_NAMESTRING (); */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
namestring = stabstring;
|
|
|
|
|
p = (char *) strchr (namestring, ':');
|
|
|
|
|
if (!p)
|
2011-01-09 11:20:33 +08:00
|
|
|
|
continue; /* Not a debugging symbol. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Main processing section for debugging symbols which
|
2011-01-06 06:22:53 +08:00
|
|
|
|
the initial read through the symbol tables needs to
|
|
|
|
|
worry about. If we reach this point, the symbol
|
|
|
|
|
which we are considering is definitely one we are
|
|
|
|
|
interested in. p must also contain the (valid)
|
|
|
|
|
index into the namestring which indicates the
|
|
|
|
|
debugging type symbol. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
switch (p[1])
|
|
|
|
|
{
|
|
|
|
|
case 'S':
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
2007-10-19 20:23:21 +08:00
|
|
|
|
|
2008-03-26 22:53:28 +08:00
|
|
|
|
if (gdbarch_static_transform_name_p (gdbarch))
|
2007-10-19 20:23:21 +08:00
|
|
|
|
namestring = gdbarch_static_transform_name
|
2008-03-26 22:53:28 +08:00
|
|
|
|
(gdbarch, namestring);
|
2007-10-19 20:23:21 +08:00
|
|
|
|
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_STATIC,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
0, sh.value,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
continue;
|
|
|
|
|
case 'G':
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* The addresses in these entries are reported
|
|
|
|
|
to be wrong. See the code that reads 'G's
|
|
|
|
|
for symtabs. */
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_STATIC,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->global_psymbols,
|
|
|
|
|
0, sh.value,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case 'T':
|
|
|
|
|
/* When a 'T' entry is defining an anonymous enum, it
|
|
|
|
|
may have a name which is the empty string, or a
|
|
|
|
|
single space. Since they're not really defining a
|
|
|
|
|
symbol, those shouldn't go in the partial symbol
|
|
|
|
|
table. We do pick up the elements of such enums at
|
|
|
|
|
'check_enum:', below. */
|
|
|
|
|
if (p >= namestring + 2
|
|
|
|
|
|| (p == namestring + 1
|
|
|
|
|
&& namestring[0] != ' '))
|
|
|
|
|
{
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
STRUCT_DOMAIN, LOC_TYPEDEF,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
sh.value, 0,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
if (p[2] == 't')
|
|
|
|
|
{
|
|
|
|
|
/* Also a typedef with the same name. */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
add_psymbol_to_list (namestring,
|
|
|
|
|
p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_TYPEDEF,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
sh.value, 0,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
psymtab_language,
|
|
|
|
|
objfile);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
p += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
goto check_enum;
|
|
|
|
|
case 't':
|
2011-01-06 06:22:53 +08:00
|
|
|
|
if (p != namestring) /* a name is there, not
|
2011-01-09 11:20:33 +08:00
|
|
|
|
just :T... */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
{
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_TYPEDEF,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
sh.value, 0,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
}
|
|
|
|
|
check_enum:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* If this is an enumerated type, we need to add
|
|
|
|
|
all the enum constants to the partial symbol
|
|
|
|
|
table. This does not cover enums without names,
|
2011-01-09 11:20:33 +08:00
|
|
|
|
e.g. "enum {a, b} c;" in C, but fortunately
|
2011-01-06 06:22:53 +08:00
|
|
|
|
those are rare. There is no way for GDB to find
|
|
|
|
|
those from the enum type without spending too
|
|
|
|
|
much time on it. Thus to solve this problem,
|
|
|
|
|
the compiler needs to put out the enum in a
|
|
|
|
|
nameless type. GCC2 does this. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
/* We are looking for something of the form
|
|
|
|
|
<name> ":" ("t" | "T") [<number> "="] "e"
|
|
|
|
|
{<constant> ":" <value> ","} ";". */
|
|
|
|
|
|
|
|
|
|
/* Skip over the colon and the 't' or 'T'. */
|
|
|
|
|
p += 2;
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* This type may be given a number. Also, numbers
|
|
|
|
|
can come in pairs like (0,26). Skip over it. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
while ((*p >= '0' && *p <= '9')
|
|
|
|
|
|| *p == '(' || *p == ',' || *p == ')'
|
|
|
|
|
|| *p == '=')
|
|
|
|
|
p++;
|
|
|
|
|
|
|
|
|
|
if (*p++ == 'e')
|
|
|
|
|
{
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* The aix4 compiler emits extra crud before
|
|
|
|
|
the members. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
if (*p == '-')
|
|
|
|
|
{
|
|
|
|
|
/* Skip over the type (?). */
|
|
|
|
|
while (*p != ':')
|
|
|
|
|
p++;
|
|
|
|
|
|
|
|
|
|
/* Skip over the colon. */
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We have found an enumerated type. */
|
|
|
|
|
/* According to comments in read_enum_type
|
|
|
|
|
a comma could end it instead of a semicolon.
|
|
|
|
|
I don't know where that happens.
|
|
|
|
|
Accept either. */
|
|
|
|
|
while (*p && *p != ';' && *p != ',')
|
|
|
|
|
{
|
|
|
|
|
char *q;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Check for and handle cretinous dbx
|
|
|
|
|
symbol name continuation! */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
if (*p == '\\' || (*p == '?' && p[1] == '\0'))
|
|
|
|
|
p = next_symbol_text (objfile);
|
|
|
|
|
|
|
|
|
|
/* Point to the character after the name
|
|
|
|
|
of the enum constant. */
|
|
|
|
|
for (q = p; *q && *q != ':'; q++)
|
|
|
|
|
;
|
|
|
|
|
/* Note that the value doesn't matter for
|
2011-01-06 06:22:53 +08:00
|
|
|
|
enum constants in psymtabs, just in
|
|
|
|
|
symtabs. */
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (p, q - p, 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
|
|
|
|
VAR_DOMAIN, LOC_CONST,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
0, 0, psymtab_language,
|
|
|
|
|
objfile);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
/* Point past the name. */
|
|
|
|
|
p = q;
|
|
|
|
|
/* Skip over the value. */
|
|
|
|
|
while (*p && *p != ',')
|
|
|
|
|
p++;
|
|
|
|
|
/* Advance past the comma. */
|
|
|
|
|
if (*p)
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
case 'c':
|
|
|
|
|
/* Constant, e.g. from "const" in Pascal. */
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_CONST,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
sh.value, 0, psymtab_language,
|
|
|
|
|
objfile);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case 'f':
|
|
|
|
|
if (! pst)
|
|
|
|
|
{
|
|
|
|
|
int name_len = p - namestring;
|
|
|
|
|
char *name = xmalloc (name_len + 1);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
memcpy (name, namestring, name_len);
|
|
|
|
|
name[name_len] = '\0';
|
2002-12-17 08:39:08 +08:00
|
|
|
|
function_outside_compilation_unit_complaint (name);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
xfree (name);
|
|
|
|
|
}
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_BLOCK,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
0, sh.value,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Global functions were ignored here, but now they
|
2011-01-06 06:22:53 +08:00
|
|
|
|
are put into the global psymtab like one would
|
|
|
|
|
expect. They're also in the minimal symbol
|
|
|
|
|
table. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
case 'F':
|
|
|
|
|
if (! pst)
|
|
|
|
|
{
|
|
|
|
|
int name_len = p - namestring;
|
|
|
|
|
char *name = xmalloc (name_len + 1);
|
2010-05-16 08:18:02 +08:00
|
|
|
|
|
2001-11-07 06:35:25 +08:00
|
|
|
|
memcpy (name, namestring, name_len);
|
|
|
|
|
name[name_len] = '\0';
|
2002-12-17 08:39:08 +08:00
|
|
|
|
function_outside_compilation_unit_complaint (name);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
xfree (name);
|
|
|
|
|
}
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (namestring, p - namestring, 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
|
|
|
|
VAR_DOMAIN, LOC_BLOCK,
|
2001-11-07 06:35:25 +08:00
|
|
|
|
&objfile->global_psymbols,
|
|
|
|
|
0, sh.value,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
continue;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Two things show up here (hopefully); static
|
|
|
|
|
symbols of local scope (static used inside
|
|
|
|
|
braces) or extensions of structure symbols. We
|
|
|
|
|
can ignore both. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
case 'V':
|
|
|
|
|
case '(':
|
|
|
|
|
case '0':
|
|
|
|
|
case '1':
|
|
|
|
|
case '2':
|
|
|
|
|
case '3':
|
|
|
|
|
case '4':
|
|
|
|
|
case '5':
|
|
|
|
|
case '6':
|
|
|
|
|
case '7':
|
|
|
|
|
case '8':
|
|
|
|
|
case '9':
|
|
|
|
|
case '-':
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case '#': /* For symbol identification (used
|
|
|
|
|
in live ranges). */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case ':':
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* It is a C++ nested symbol. We don't need to
|
|
|
|
|
record it (I don't think); if we try to look up
|
|
|
|
|
foo::bar::baz, then symbols for the symtab
|
|
|
|
|
containing foo should get read in, I think. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
/* Someone says sun cc puts out symbols like
|
|
|
|
|
/foo/baz/maclib::/usr/local/bin/maclib,
|
|
|
|
|
which would get here with a symbol type of ':'. */
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
default:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Unexpected symbol descriptor. The second and
|
|
|
|
|
subsequent stabs of a continued stab can show up
|
|
|
|
|
here. The question is whether they ever can
|
|
|
|
|
mimic a normal stab--it would be nice if not,
|
|
|
|
|
since we certainly don't want to spend the time
|
|
|
|
|
searching to the end of every string looking for
|
2001-11-07 06:35:25 +08:00
|
|
|
|
a backslash. */
|
|
|
|
|
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("unknown symbol descriptor `%c'"), p[1]);
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
/* Ignore it; perhaps it is an extension that we don't
|
|
|
|
|
know about. */
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case N_EXCL:
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case N_ENDM:
|
2002-09-19 04:47:39 +08:00
|
|
|
|
/* Solaris 2 end of module, finish current partial
|
|
|
|
|
symbol table. END_PSYMTAB will set
|
|
|
|
|
pst->texthigh to the proper value, which is
|
|
|
|
|
necessary if a module compiled without
|
|
|
|
|
debugging info follows this module. */
|
2007-10-19 20:26:35 +08:00
|
|
|
|
if (pst
|
2008-03-26 22:53:28 +08:00
|
|
|
|
&& gdbarch_sofun_address_maybe_missing (gdbarch))
|
2001-11-07 06:35:25 +08:00
|
|
|
|
{
|
|
|
|
|
pst = (struct partial_symtab *) 0;
|
|
|
|
|
includes_used = 0;
|
|
|
|
|
dependencies_used = 0;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case N_RBRAC:
|
2002-09-19 04:47:39 +08:00
|
|
|
|
if (sh.value > save_pst->texthigh)
|
|
|
|
|
save_pst->texthigh = sh.value;
|
2001-11-07 06:35:25 +08:00
|
|
|
|
continue;
|
|
|
|
|
case N_EINCL:
|
|
|
|
|
case N_DSLINE:
|
|
|
|
|
case N_BSLINE:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_SSYM: /* Claim: Structure or union
|
|
|
|
|
element. Hopefully, I can
|
|
|
|
|
ignore this. */
|
|
|
|
|
case N_ENTRY: /* Alternate entry point; can
|
2011-01-09 11:20:33 +08:00
|
|
|
|
ignore. */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_MAIN: /* Can definitely ignore this. */
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case N_CATCH: /* These are GNU C++ extensions. */
|
|
|
|
|
case N_EHDECL: /* that can safely be ignored here. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
case N_LENG:
|
|
|
|
|
case N_BCOMM:
|
|
|
|
|
case N_ECOMM:
|
|
|
|
|
case N_ECOML:
|
|
|
|
|
case N_FNAME:
|
|
|
|
|
case N_SLINE:
|
|
|
|
|
case N_RSYM:
|
|
|
|
|
case N_PSYM:
|
|
|
|
|
case N_LBRAC:
|
|
|
|
|
case N_NSYMS: /* Ultrix 4.0: symbol count */
|
|
|
|
|
case N_DEFD: /* GNU Modula-2 */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
case N_ALIAS: /* SunPro F77: alias name, ignore
|
|
|
|
|
for now. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
case N_OBJ: /* Useless types from Solaris. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
case N_OPT:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* These symbols aren't interesting; don't worry about
|
2011-01-09 11:20:33 +08:00
|
|
|
|
them. */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
default:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* If we haven't found it yet, ignore it. It's
|
|
|
|
|
probably some new type we don't know about yet. */
|
|
|
|
|
complaint (&symfile_complaints,
|
|
|
|
|
_("unknown symbol type %s"),
|
2011-01-09 11:20:33 +08:00
|
|
|
|
hex_string (type_code)); /* CUR_SYMBOL_TYPE */
|
2001-11-07 06:35:25 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (stabstring
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&& stabstring != debug_info->ss + fh->issBase + sh.iss)
|
2000-12-15 09:01:51 +08:00
|
|
|
|
xfree (stabstring);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
1999-07-08 04:19:36 +08:00
|
|
|
|
/* end - Handle continuation */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (cur_sdx = 0; cur_sdx < fh->csym;)
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
enum address_class class;
|
2013-10-16 03:28:57 +08:00
|
|
|
|
CORE_ADDR minsym_value;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ ((fh->isymBase + cur_sdx)
|
|
|
|
|
* external_sym_size)),
|
|
|
|
|
&sh);
|
|
|
|
|
|
|
|
|
|
if (ECOFF_IS_STAB (&sh))
|
|
|
|
|
{
|
|
|
|
|
cur_sdx++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Non absolute static symbols go into the minimal table. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (sh.sc) || sh.sc == scNil
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|| (sh.index == indexNil
|
|
|
|
|
&& (sh.st != stStatic || sh.sc == scAbs)))
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* FIXME, premature? */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cur_sdx++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
name = debug_info->ss + fh->issBase + sh.iss;
|
|
|
|
|
|
2013-10-16 03:28:57 +08:00
|
|
|
|
minsym_value = sh.value;
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
switch (sh.sc)
|
|
|
|
|
{
|
|
|
|
|
case scText:
|
|
|
|
|
case scRConst:
|
|
|
|
|
/* The value of a stEnd symbol is the displacement from the
|
|
|
|
|
corresponding start symbol value, do not relocate it. */
|
|
|
|
|
if (sh.st != stEnd)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scData:
|
|
|
|
|
case scSData:
|
|
|
|
|
case scRData:
|
|
|
|
|
case scPData:
|
|
|
|
|
case scXData:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scBss:
|
|
|
|
|
case scSBss:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sh.value += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_BSS (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (sh.st)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR high;
|
|
|
|
|
CORE_ADDR procaddr;
|
|
|
|
|
int new_sdx;
|
|
|
|
|
|
|
|
|
|
case stStaticProc:
|
2013-10-16 03:28:57 +08:00
|
|
|
|
prim_record_minimal_symbol_and_info (name, minsym_value,
|
2008-10-02 00:41:27 +08:00
|
|
|
|
mst_file_text,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
SECT_OFF_TEXT (objfile),
|
2013-04-09 04:13:22 +08:00
|
|
|
|
objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
|
|
|
|
case stProc:
|
2003-01-07 15:09:25 +08:00
|
|
|
|
/* Ignore all parameter symbol records. */
|
|
|
|
|
if (sh.index >= hdr->iauxMax)
|
|
|
|
|
{
|
|
|
|
|
/* Should not happen, but does when cross-compiling
|
|
|
|
|
with the MIPS compiler. FIXME -- pull later. */
|
|
|
|
|
index_complaint (name);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
new_sdx = cur_sdx + 1; /* Don't skip at all. */
|
2003-01-07 15:09:25 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
new_sdx = AUX_GET_ISYM (fh->fBigendian,
|
|
|
|
|
(debug_info->external_aux
|
|
|
|
|
+ fh->iauxBase
|
|
|
|
|
+ sh.index));
|
|
|
|
|
|
|
|
|
|
if (new_sdx <= cur_sdx)
|
|
|
|
|
{
|
|
|
|
|
/* This should not happen either... FIXME. */
|
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("bad proc end in aux found from symbol %s"),
|
2003-01-07 15:09:25 +08:00
|
|
|
|
name);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
new_sdx = cur_sdx + 1; /* Don't skip backward. */
|
2003-01-07 15:09:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For stProc symbol records, we need to check the
|
|
|
|
|
storage class as well, as only (stProc, scText)
|
|
|
|
|
entries represent "real" procedures - See the
|
|
|
|
|
Compaq document titled "Object File / Symbol Table
|
|
|
|
|
Format Specification" for more information. If the
|
|
|
|
|
storage class is not scText, we discard the whole
|
|
|
|
|
block of symbol records for this stProc. */
|
|
|
|
|
if (sh.st == stProc && sh.sc != scText)
|
|
|
|
|
goto skip;
|
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Usually there is a local and a global stProc symbol
|
2011-01-09 11:20:33 +08:00
|
|
|
|
for a function. This means that the function name
|
1999-04-16 09:35:26 +08:00
|
|
|
|
has already been entered into the mimimal symbol table
|
|
|
|
|
while processing the global symbols in pass 2 above.
|
|
|
|
|
One notable exception is the PROGRAM name from
|
|
|
|
|
f77 compiled executables, it is only put out as
|
|
|
|
|
local stProc symbol, and a global MAIN__ stProc symbol
|
|
|
|
|
points to it. It doesn't matter though, as gdb is
|
|
|
|
|
still able to find the PROGRAM name via the partial
|
|
|
|
|
symbol table, and the MAIN__ symbol via the minimal
|
|
|
|
|
symbol table. */
|
|
|
|
|
if (sh.st == stProc)
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
VAR_DOMAIN, LOC_BLOCK,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->global_psymbols,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
0, sh.value, psymtab_language, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
else
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
VAR_DOMAIN, LOC_BLOCK,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->static_psymbols,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
0, sh.value, psymtab_language, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
procaddr = sh.value;
|
|
|
|
|
|
|
|
|
|
cur_sdx = new_sdx;
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ ((fh->isymBase + cur_sdx - 1)
|
|
|
|
|
* external_sym_size)),
|
|
|
|
|
&sh);
|
|
|
|
|
if (sh.st != stEnd)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Kludge for Irix 5.2 zero fh->adr. */
|
|
|
|
|
if (!relocatable
|
2002-09-19 04:47:39 +08:00
|
|
|
|
&& (pst->textlow == 0 || procaddr < pst->textlow))
|
|
|
|
|
pst->textlow = procaddr;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
high = procaddr + sh.value;
|
2002-09-19 04:47:39 +08:00
|
|
|
|
if (high > pst->texthigh)
|
|
|
|
|
pst->texthigh = high;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case stStatic: /* Variable */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_DATA (sh.sc))
|
2013-10-16 03:28:57 +08:00
|
|
|
|
prim_record_minimal_symbol_and_info (name, minsym_value,
|
2008-10-02 00:41:27 +08:00
|
|
|
|
mst_file_data,
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
SECT_OFF_DATA (objfile),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
objfile);
|
|
|
|
|
else
|
2013-10-16 03:28:57 +08:00
|
|
|
|
prim_record_minimal_symbol_and_info (name, minsym_value,
|
2008-10-02 00:41:27 +08:00
|
|
|
|
mst_file_bss,
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-05 00:52:34 +08:00
|
|
|
|
SECT_OFF_BSS (objfile),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
objfile);
|
|
|
|
|
class = LOC_STATIC;
|
|
|
|
|
break;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
case stIndirect: /* Irix5 forward declaration */
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Skip forward declarations from Irix5 cc. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
goto skip;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
case stTypedef: /* Typedef */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Skip typedefs for forward declarations and opaque
|
|
|
|
|
structs from alpha and mips cc. */
|
|
|
|
|
if (sh.iss == 0 || has_opaque_xref (fh, &sh))
|
|
|
|
|
goto skip;
|
|
|
|
|
class = LOC_TYPEDEF;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stConstant: /* Constant decl */
|
|
|
|
|
class = LOC_CONST;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stUnion:
|
|
|
|
|
case stStruct:
|
|
|
|
|
case stEnum:
|
1999-07-08 04:19:36 +08:00
|
|
|
|
case stBlock: /* { }, str, un, enum */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Do not create a partial symbol for cc unnamed aggregates
|
2011-01-09 11:20:33 +08:00
|
|
|
|
and gcc empty aggregates. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if ((sh.sc == scInfo
|
1999-07-08 04:19:36 +08:00
|
|
|
|
|| SC_IS_COMMON (sh.sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&& sh.iss != 0
|
|
|
|
|
&& sh.index != cur_sdx + 2)
|
|
|
|
|
{
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
STRUCT_DOMAIN, LOC_TYPEDEF,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
0, (CORE_ADDR) 0,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
}
|
|
|
|
|
handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Skip over the block. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
new_sdx = sh.index;
|
|
|
|
|
if (new_sdx <= cur_sdx)
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* This happens with the Ultrix kernel. */
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("bad aux index at block symbol %s"), name);
|
2011-01-09 11:20:33 +08:00
|
|
|
|
new_sdx = cur_sdx + 1; /* Don't skip backward. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
cur_sdx = new_sdx;
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
case stFile: /* File headers */
|
|
|
|
|
case stLabel: /* Labels */
|
|
|
|
|
case stEnd: /* Ends of files */
|
|
|
|
|
goto skip;
|
|
|
|
|
|
|
|
|
|
case stLocal: /* Local variables */
|
|
|
|
|
/* Normally these are skipped because we skip over
|
|
|
|
|
all blocks we see. However, these can occur
|
2011-01-09 11:20:33 +08:00
|
|
|
|
as visible symbols in a .h file that contains code. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
goto skip;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* Both complaints are valid: one gives symbol name,
|
|
|
|
|
the other the offending symbol type. */
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("unknown local symbol %s"),
|
2002-12-17 08:39:08 +08:00
|
|
|
|
name);
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("with type %d"), sh.st);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cur_sdx++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Use this gdb symbol. */
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
VAR_DOMAIN, class,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->static_psymbols,
|
|
|
|
|
0, sh.value, psymtab_language, objfile);
|
|
|
|
|
skip:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
cur_sdx++; /* Go to next file symbol. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Now do enter the external symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
ext_ptr = &extern_tab[fdr_to_pst[f_idx].globals_offset];
|
|
|
|
|
cur_sdx = fdr_to_pst[f_idx].n_globals;
|
|
|
|
|
PST_PRIVATE (save_pst)->extern_count = cur_sdx;
|
|
|
|
|
PST_PRIVATE (save_pst)->extern_tab = ext_ptr;
|
|
|
|
|
for (; --cur_sdx >= 0; ext_ptr++)
|
|
|
|
|
{
|
|
|
|
|
enum address_class class;
|
|
|
|
|
SYMR *psh;
|
|
|
|
|
char *name;
|
|
|
|
|
CORE_ADDR svalue;
|
|
|
|
|
|
|
|
|
|
if (ext_ptr->ifd != f_idx)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
internal_error (__FILE__, __LINE__,
|
|
|
|
|
_("failed internal consistency check"));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
psh = &ext_ptr->asym;
|
|
|
|
|
|
|
|
|
|
/* Do not add undefined symbols to the partial symbol table. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_UNDEF (psh->sc) || psh->sc == scNil)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
svalue = psh->value;
|
|
|
|
|
switch (psh->sc)
|
|
|
|
|
{
|
|
|
|
|
case scText:
|
|
|
|
|
case scRConst:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
svalue += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scData:
|
|
|
|
|
case scSData:
|
|
|
|
|
case scRData:
|
|
|
|
|
case scPData:
|
|
|
|
|
case scXData:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
svalue += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_DATA (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
case scBss:
|
|
|
|
|
case scSBss:
|
2011-01-06 06:22:53 +08:00
|
|
|
|
svalue += ANOFFSET (objfile->section_offsets,
|
|
|
|
|
SECT_OFF_BSS (objfile));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (psh->st)
|
|
|
|
|
{
|
|
|
|
|
case stNil:
|
|
|
|
|
/* These are generated for static symbols in .o files,
|
|
|
|
|
ignore them. */
|
|
|
|
|
continue;
|
|
|
|
|
case stProc:
|
|
|
|
|
case stStaticProc:
|
|
|
|
|
/* External procedure symbols have been entered
|
|
|
|
|
into the minimal symbol table in pass 2 above.
|
|
|
|
|
Ignore them, as parse_external will ignore them too. */
|
|
|
|
|
continue;
|
|
|
|
|
case stLabel:
|
|
|
|
|
class = LOC_LABEL;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2002-12-17 08:39:08 +08:00
|
|
|
|
unknown_ext_complaint (debug_info->ssext + psh->iss);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
/* Fall through, pretend it's global. */
|
|
|
|
|
case stGlobal:
|
|
|
|
|
/* Global common symbols are resolved by the runtime loader,
|
|
|
|
|
ignore them. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (SC_IS_COMMON (psh->sc))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
class = LOC_STATIC;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
name = debug_info->ssext + psh->iss;
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
VAR_DOMAIN, class,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->global_psymbols,
|
|
|
|
|
0, svalue,
|
|
|
|
|
psymtab_language, objfile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Link pst to FDR. end_psymtab returns NULL if the psymtab was
|
1999-07-08 04:19:36 +08:00
|
|
|
|
empty and put on the free list. */
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
fdr_to_pst[f_idx].pst = end_psymtab (objfile, save_pst,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
psymtab_include_list, includes_used,
|
2002-09-19 04:47:39 +08:00
|
|
|
|
-1, save_pst->texthigh,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
dependency_list, dependencies_used, textlow_not_set);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
includes_used = 0;
|
|
|
|
|
dependencies_used = 0;
|
|
|
|
|
|
|
|
|
|
/* The objfile has its functions reordered if this partial symbol
|
1999-07-08 04:19:36 +08:00
|
|
|
|
table overlaps any other partial symbol table.
|
|
|
|
|
We cannot assume a reordered objfile if a partial symbol table
|
|
|
|
|
is contained within another partial symbol table, as partial symbol
|
|
|
|
|
tables for include files with executable code are contained
|
|
|
|
|
within the partial symbol table for the including source file,
|
|
|
|
|
and we do not want to flag the objfile reordered for these cases.
|
|
|
|
|
|
|
|
|
|
This strategy works well for Irix-5.2 shared libraries, but we
|
|
|
|
|
might have to use a more elaborate (and slower) algorithm for
|
|
|
|
|
other cases. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
save_pst = fdr_to_pst[f_idx].pst;
|
|
|
|
|
if (save_pst != NULL
|
2002-09-19 04:47:39 +08:00
|
|
|
|
&& save_pst->textlow != 0
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&& !(objfile->flags & OBJF_REORDERED))
|
|
|
|
|
{
|
|
|
|
|
ALL_OBJFILE_PSYMTABS (objfile, pst)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
if (save_pst != pst
|
2002-09-19 04:47:39 +08:00
|
|
|
|
&& save_pst->textlow >= pst->textlow
|
|
|
|
|
&& save_pst->textlow < pst->texthigh
|
|
|
|
|
&& save_pst->texthigh > pst->texthigh)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
{
|
|
|
|
|
objfile->flags |= OBJF_REORDERED;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Now scan the FDRs for dependencies. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
|
|
|
|
|
{
|
|
|
|
|
fh = f_idx + debug_info->fdr;
|
|
|
|
|
pst = fdr_to_pst[f_idx].pst;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (pst == (struct partial_symtab *) NULL)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* This should catch stabs-in-ecoff. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (fh->crfd <= 1)
|
|
|
|
|
continue;
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
/* Skip the first file indirect entry as it is a self dependency for
|
|
|
|
|
source files or a reverse .h -> .c dependency for header files. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
pst->number_of_dependencies = 0;
|
|
|
|
|
pst->dependencies =
|
|
|
|
|
((struct partial_symtab **)
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-08 02:29:54 +08:00
|
|
|
|
obstack_alloc (&objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
((fh->crfd - 1)
|
|
|
|
|
* sizeof (struct partial_symtab *))));
|
|
|
|
|
for (s_idx = 1; s_idx < fh->crfd; s_idx++)
|
|
|
|
|
{
|
|
|
|
|
RFDT rh;
|
|
|
|
|
|
|
|
|
|
(*swap_rfd_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_rfd
|
|
|
|
|
+ (fh->rfdBase + s_idx) * external_rfd_size),
|
|
|
|
|
&rh);
|
|
|
|
|
if (rh < 0 || rh >= hdr->ifdMax)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
complaint (&symfile_complaints, _("bad file number %ld"), rh);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Skip self dependencies of header files. */
|
|
|
|
|
if (rh == f_idx)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Do not add to dependeny list if psymtab was empty. */
|
1999-07-08 04:19:36 +08:00
|
|
|
|
if (fdr_to_pst[rh].pst == (struct partial_symtab *) NULL)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
continue;
|
2011-01-06 06:22:53 +08:00
|
|
|
|
pst->dependencies[pst->number_of_dependencies++]
|
|
|
|
|
= fdr_to_pst[rh].pst;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Remove the dummy psymtab created for -O3 images above, if it is
|
|
|
|
|
still empty, to enable the detection of stripped executables. */
|
|
|
|
|
if (objfile->psymtabs->next == NULL
|
|
|
|
|
&& objfile->psymtabs->number_of_dependencies == 0
|
|
|
|
|
&& objfile->psymtabs->n_global_syms == 0
|
|
|
|
|
&& objfile->psymtabs->n_static_syms == 0)
|
|
|
|
|
objfile->psymtabs = NULL;
|
|
|
|
|
do_cleanups (old_chain);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If the current psymbol has an enumerated type, we need to add
|
2011-02-26 10:07:10 +08:00
|
|
|
|
all the enum constants to the partial symbol table. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
|
|
|
|
|
CORE_ADDR svalue)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
|
2002-03-20 03:00:04 +08:00
|
|
|
|
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
char *ext_sym = ((char *) debug_info->external_sym
|
1999-07-08 04:19:36 +08:00
|
|
|
|
+ ((fh->isymBase + cur_sdx + 1) * external_sym_size));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
SYMR sh;
|
|
|
|
|
TIR tir;
|
|
|
|
|
|
|
|
|
|
switch (stype)
|
|
|
|
|
{
|
|
|
|
|
case stEnum:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case stBlock:
|
|
|
|
|
/* It is an enumerated type if the next symbol entry is a stMember
|
1999-07-08 04:19:36 +08:00
|
|
|
|
and its auxiliary index is indexNil or its auxiliary entry
|
|
|
|
|
is a plain btNil or btVoid.
|
|
|
|
|
Alpha cc -migrate enums are recognized by a zero index and
|
|
|
|
|
a zero symbol value.
|
|
|
|
|
DU 4.0 cc enums are recognized by a member type of btEnum without
|
|
|
|
|
qualifiers and a zero symbol value. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(*swap_sym_in) (cur_bfd, ext_sym, &sh);
|
|
|
|
|
if (sh.st != stMember)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (sh.index == indexNil
|
|
|
|
|
|| (sh.index == 0 && svalue == 0))
|
|
|
|
|
break;
|
|
|
|
|
(*debug_swap->swap_tir_in) (fh->fBigendian,
|
|
|
|
|
&(debug_info->external_aux
|
|
|
|
|
+ fh->iauxBase + sh.index)->a_ti,
|
|
|
|
|
&tir);
|
|
|
|
|
if ((tir.bt != btNil
|
|
|
|
|
&& tir.bt != btVoid
|
|
|
|
|
&& (tir.bt != btEnum || svalue != 0))
|
|
|
|
|
|| tir.tq0 != tqNil)
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (;;)
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd, ext_sym, &sh);
|
|
|
|
|
if (sh.st != stMember)
|
|
|
|
|
break;
|
|
|
|
|
name = debug_info->ss + cur_fdr->issBase + sh.iss;
|
|
|
|
|
|
|
|
|
|
/* Note that the value doesn't matter for enum constants
|
1999-07-08 04:19:36 +08:00
|
|
|
|
in psymtabs, just in symtabs. */
|
2009-11-17 02:40:23 +08:00
|
|
|
|
add_psymbol_to_list (name, strlen (name), 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
|
|
|
|
VAR_DOMAIN, LOC_CONST,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&objfile->static_psymbols, 0,
|
|
|
|
|
(CORE_ADDR) 0, psymtab_language, objfile);
|
|
|
|
|
ext_sym += external_sym_size;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Get the next symbol. OBJFILE is unused. */
|
2000-09-24 12:42:12 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
static char *
|
2000-09-24 12:42:12 +08:00
|
|
|
|
mdebug_next_symbol_text (struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
SYMR sh;
|
|
|
|
|
|
|
|
|
|
cur_sdx++;
|
|
|
|
|
(*debug_swap->swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ ((cur_fdr->isymBase + cur_sdx)
|
|
|
|
|
* debug_swap->external_sym_size)),
|
|
|
|
|
&sh);
|
|
|
|
|
return debug_info->ss + cur_fdr->issBase + sh.iss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Ancillary function to psymtab_to_symtab(). Does all the work
|
|
|
|
|
for turning the partial symtab PST into a symtab, recurring
|
|
|
|
|
first on all dependent psymtabs. The argument FILENAME is
|
|
|
|
|
only passed so we can see in debug stack traces what file
|
|
|
|
|
is being read.
|
|
|
|
|
|
|
|
|
|
This function has a split personality, based on whether the
|
|
|
|
|
symbol table contains ordinary ecoff symbols, or stabs-in-ecoff.
|
|
|
|
|
The flow of control and even the memory allocation differs. FIXME. */
|
|
|
|
|
|
|
|
|
|
static void
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
psymtab_to_symtab_1 (struct objfile *objfile,
|
|
|
|
|
struct partial_symtab *pst, const char *filename)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
bfd_size_type external_sym_size;
|
|
|
|
|
bfd_size_type external_pdr_size;
|
2002-03-20 03:00:04 +08:00
|
|
|
|
void (*swap_sym_in) (bfd *, void *, SYMR *);
|
|
|
|
|
void (*swap_pdr_in) (bfd *, void *, PDR *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
int i;
|
2001-09-05 10:02:44 +08:00
|
|
|
|
struct symtab *st = NULL;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
FDR *fh;
|
|
|
|
|
struct linetable *lines;
|
|
|
|
|
CORE_ADDR lowest_pdr_addr = 0;
|
2001-09-05 10:02:44 +08:00
|
|
|
|
int last_symtab_ended = 0;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
if (pst->readin)
|
|
|
|
|
return;
|
|
|
|
|
pst->readin = 1;
|
|
|
|
|
|
|
|
|
|
/* Read in all partial symbtabs on which this one is dependent.
|
|
|
|
|
NOTE that we do have circular dependencies, sigh. We solved
|
|
|
|
|
that by setting pst->readin before this point. */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < pst->number_of_dependencies; i++)
|
|
|
|
|
if (!pst->dependencies[i]->readin)
|
|
|
|
|
{
|
|
|
|
|
/* Inform about additional files to be read in. */
|
|
|
|
|
if (info_verbose)
|
|
|
|
|
{
|
|
|
|
|
fputs_filtered (" ", gdb_stdout);
|
|
|
|
|
wrap_here ("");
|
|
|
|
|
fputs_filtered ("and ", gdb_stdout);
|
|
|
|
|
wrap_here ("");
|
|
|
|
|
printf_filtered ("%s...",
|
|
|
|
|
pst->dependencies[i]->filename);
|
|
|
|
|
wrap_here (""); /* Flush output */
|
|
|
|
|
gdb_flush (gdb_stdout);
|
|
|
|
|
}
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* We only pass the filename for debug purposes. */
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
psymtab_to_symtab_1 (objfile, pst->dependencies[i],
|
1999-04-16 09:35:26 +08:00
|
|
|
|
pst->dependencies[i]->filename);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Do nothing if this is a dummy psymtab. */
|
|
|
|
|
|
|
|
|
|
if (pst->n_global_syms == 0 && pst->n_static_syms == 0
|
2002-09-19 04:47:39 +08:00
|
|
|
|
&& pst->textlow == 0 && pst->texthigh == 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Now read the symbols for this symtab. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
cur_bfd = CUR_BFD (pst);
|
|
|
|
|
debug_swap = DEBUG_SWAP (pst);
|
|
|
|
|
debug_info = DEBUG_INFO (pst);
|
|
|
|
|
pending_list = PENDING_LIST (pst);
|
|
|
|
|
external_sym_size = debug_swap->external_sym_size;
|
|
|
|
|
external_pdr_size = debug_swap->external_pdr_size;
|
|
|
|
|
swap_sym_in = debug_swap->swap_sym_in;
|
|
|
|
|
swap_pdr_in = debug_swap->swap_pdr_in;
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
mdebugread_objfile = objfile;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cur_fd = FDR_IDX (pst);
|
|
|
|
|
fh = ((cur_fd == -1)
|
|
|
|
|
? (FDR *) NULL
|
|
|
|
|
: debug_info->fdr + cur_fd);
|
|
|
|
|
cur_fdr = fh;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* See comment in parse_partial_symbols about the @stabs sentinel. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
processing_gcc_compilation = 0;
|
|
|
|
|
if (fh != (FDR *) NULL && fh->csym >= 2)
|
|
|
|
|
{
|
|
|
|
|
SYMR sh;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
((char *) debug_info->external_sym
|
|
|
|
|
+ (fh->isymBase + 1) * external_sym_size),
|
|
|
|
|
&sh);
|
2004-01-18 09:22:57 +08:00
|
|
|
|
if (strcmp (debug_info->ss + fh->issBase + sh.iss,
|
|
|
|
|
stabs_symbol) == 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* We indicate that this is a GCC compilation so that certain
|
|
|
|
|
features will be enabled in stabsread/dbxread. */
|
|
|
|
|
processing_gcc_compilation = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (processing_gcc_compilation != 0)
|
|
|
|
|
{
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* This symbol table contains stabs-in-ecoff entries. */
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse local symbols first. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2011-06-15 02:53:14 +08:00
|
|
|
|
mdebugread_objfile = NULL;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++)
|
|
|
|
|
{
|
|
|
|
|
SYMR sh;
|
|
|
|
|
char *name;
|
|
|
|
|
CORE_ADDR valu;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd,
|
|
|
|
|
(((char *) debug_info->external_sym)
|
|
|
|
|
+ (fh->isymBase + cur_sdx) * external_sym_size),
|
|
|
|
|
&sh);
|
|
|
|
|
name = debug_info->ss + fh->issBase + sh.iss;
|
|
|
|
|
valu = sh.value;
|
|
|
|
|
/* XXX This is a hack. It will go away! */
|
|
|
|
|
if (ECOFF_IS_STAB (&sh) || (name[0] == '#'))
|
|
|
|
|
{
|
|
|
|
|
int type_code = ECOFF_UNMARK_STAB (sh.index);
|
|
|
|
|
|
|
|
|
|
/* We should never get non N_STAB symbols here, but they
|
1999-07-08 04:19:36 +08:00
|
|
|
|
should be harmless, so keep process_one_symbol from
|
|
|
|
|
complaining about them. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (type_code & N_STAB)
|
|
|
|
|
{
|
2001-09-05 10:02:44 +08:00
|
|
|
|
/* If we found a trailing N_SO with no name, process
|
|
|
|
|
it here instead of in process_one_symbol, so we
|
|
|
|
|
can keep a handle to its symtab. The symtab
|
|
|
|
|
would otherwise be ended twice, once in
|
2011-01-09 11:20:33 +08:00
|
|
|
|
process_one_symbol, and once after this loop. */
|
2001-09-05 10:02:44 +08:00
|
|
|
|
if (type_code == N_SO
|
2013-01-22 02:05:13 +08:00
|
|
|
|
&& get_last_source_file ()
|
2001-09-05 10:02:44 +08:00
|
|
|
|
&& previous_stab_code != (unsigned char) N_SO
|
|
|
|
|
&& *name == '\000')
|
|
|
|
|
{
|
|
|
|
|
valu += ANOFFSET (pst->section_offsets,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2001-09-05 10:02:44 +08:00
|
|
|
|
previous_stab_code = N_SO;
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
st = end_symtab (valu, objfile,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2001-09-05 10:02:44 +08:00
|
|
|
|
end_stabs ();
|
|
|
|
|
last_symtab_ended = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
last_symtab_ended = 0;
|
|
|
|
|
process_one_symbol (type_code, 0, valu, name,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
pst->section_offsets, objfile);
|
2001-09-05 10:02:44 +08:00
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
/* Similarly a hack. */
|
|
|
|
|
else if (name[0] == '#')
|
|
|
|
|
{
|
|
|
|
|
process_one_symbol (N_SLINE, 0, valu, name,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
pst->section_offsets, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
if (type_code == N_FUN)
|
|
|
|
|
{
|
|
|
|
|
/* Make up special symbol to contain
|
2011-01-09 11:20:33 +08:00
|
|
|
|
procedure specific info. */
|
2004-10-31 10:59:21 +08:00
|
|
|
|
struct mdebug_extra_func_info *e =
|
2010-05-16 08:18:02 +08:00
|
|
|
|
((struct mdebug_extra_func_info *)
|
2011-06-15 02:53:14 +08:00
|
|
|
|
obstack_alloc (&mdebugread_objfile->objfile_obstack,
|
2010-05-16 08:18:02 +08:00
|
|
|
|
sizeof (struct mdebug_extra_func_info)));
|
2004-10-31 10:59:21 +08:00
|
|
|
|
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2004-10-31 10:59:21 +08:00
|
|
|
|
memset (e, 0, sizeof (struct mdebug_extra_func_info));
|
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
|
|
|
|
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_void;
|
2009-01-13 19:52:43 +08:00
|
|
|
|
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
e->pdr.framereg = -1;
|
|
|
|
|
add_symbol_to_list (s, &local_symbols);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (sh.st == stLabel)
|
|
|
|
|
{
|
|
|
|
|
if (sh.index == indexNil)
|
|
|
|
|
{
|
|
|
|
|
/* This is what the gcc2_compiled and __gnu_compiled_*
|
|
|
|
|
show up as. So don't complain. */
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Handle encoded stab line number. */
|
2011-01-06 06:22:53 +08:00
|
|
|
|
valu += ANOFFSET (pst->section_offsets,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2009-06-18 02:41:50 +08:00
|
|
|
|
record_line (current_subfile, sh.index,
|
|
|
|
|
gdbarch_addr_bits_remove (gdbarch, valu));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (sh.st == stProc || sh.st == stStaticProc
|
|
|
|
|
|| sh.st == stStatic || sh.st == stEnd)
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* These are generated by gcc-2.x, do not complain. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
;
|
|
|
|
|
else
|
2011-01-06 06:22:53 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
|
|
|
|
_("unknown stabs symbol %s"), name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
2001-09-05 10:02:44 +08:00
|
|
|
|
|
|
|
|
|
if (! last_symtab_ended)
|
|
|
|
|
{
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
st = end_symtab (pst->texthigh, objfile,
|
|
|
|
|
SECT_OFF_TEXT (objfile));
|
2001-09-05 10:02:44 +08:00
|
|
|
|
end_stabs ();
|
|
|
|
|
}
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* There used to be a call to sort_blocks here, but this should not
|
1999-07-08 04:19:36 +08:00
|
|
|
|
be necessary for stabs symtabs. And as sort_blocks modifies the
|
|
|
|
|
start address of the GLOBAL_BLOCK to the FIRST_LOCAL_BLOCK,
|
|
|
|
|
it did the wrong thing if the first procedure in a file was
|
|
|
|
|
generated via asm statements. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Fill in procedure info next. */
|
|
|
|
|
if (fh->cpd > 0)
|
|
|
|
|
{
|
|
|
|
|
PDR *pr_block;
|
|
|
|
|
struct cleanup *old_chain;
|
|
|
|
|
char *pdr_ptr;
|
|
|
|
|
char *pdr_end;
|
|
|
|
|
PDR *pdr_in;
|
|
|
|
|
PDR *pdr_in_end;
|
|
|
|
|
|
|
|
|
|
pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
|
2000-12-15 09:01:51 +08:00
|
|
|
|
old_chain = make_cleanup (xfree, pr_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
pdr_ptr = ((char *) debug_info->external_pdr
|
|
|
|
|
+ fh->ipdFirst * external_pdr_size);
|
|
|
|
|
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
|
|
|
|
|
pdr_in = pr_block;
|
|
|
|
|
for (;
|
|
|
|
|
pdr_ptr < pdr_end;
|
|
|
|
|
pdr_ptr += external_pdr_size, pdr_in++)
|
|
|
|
|
{
|
|
|
|
|
(*swap_pdr_in) (cur_bfd, pdr_ptr, pdr_in);
|
|
|
|
|
|
|
|
|
|
/* Determine lowest PDR address, the PDRs are not always
|
1999-07-08 04:19:36 +08:00
|
|
|
|
sorted. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (pdr_in == pr_block)
|
|
|
|
|
lowest_pdr_addr = pdr_in->adr;
|
|
|
|
|
else if (pdr_in->adr < lowest_pdr_addr)
|
|
|
|
|
lowest_pdr_addr = pdr_in->adr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pdr_in = pr_block;
|
|
|
|
|
pdr_in_end = pdr_in + fh->cpd;
|
|
|
|
|
for (; pdr_in < pdr_in_end; pdr_in++)
|
|
|
|
|
parse_procedure (pdr_in, st, pst);
|
|
|
|
|
|
|
|
|
|
do_cleanups (old_chain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* This symbol table contains ordinary ecoff entries. */
|
|
|
|
|
|
2011-04-04 23:11:19 +08:00
|
|
|
|
int maxlines, size;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
EXTR *ext_ptr;
|
|
|
|
|
|
|
|
|
|
if (fh == 0)
|
|
|
|
|
{
|
|
|
|
|
maxlines = 0;
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
st = new_symtab ("unknown", 0, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
maxlines = 2 * fh->cline;
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
st = new_symtab (pst->filename, maxlines, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* The proper language was already determined when building
|
|
|
|
|
the psymtab, use it. */
|
|
|
|
|
st->language = PST_PRIVATE (pst)->pst_language;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
psymtab_language = st->language;
|
|
|
|
|
|
|
|
|
|
lines = LINETABLE (st);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Get a new lexical context. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
push_parse_stack ();
|
|
|
|
|
top_stack->cur_st = st;
|
|
|
|
|
top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (st),
|
|
|
|
|
STATIC_BLOCK);
|
2002-09-19 04:47:39 +08:00
|
|
|
|
BLOCK_START (top_stack->cur_block) = pst->textlow;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
BLOCK_END (top_stack->cur_block) = 0;
|
|
|
|
|
top_stack->blocktype = stFile;
|
|
|
|
|
top_stack->cur_type = 0;
|
|
|
|
|
top_stack->procadr = 0;
|
|
|
|
|
top_stack->numargs = 0;
|
|
|
|
|
found_ecoff_debugging_info = 0;
|
|
|
|
|
|
|
|
|
|
if (fh)
|
|
|
|
|
{
|
|
|
|
|
char *sym_ptr;
|
|
|
|
|
char *sym_end;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse local symbols first. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
sym_ptr = ((char *) debug_info->external_sym
|
|
|
|
|
+ fh->isymBase * external_sym_size);
|
|
|
|
|
sym_end = sym_ptr + fh->csym * external_sym_size;
|
|
|
|
|
while (sym_ptr < sym_end)
|
|
|
|
|
{
|
|
|
|
|
SYMR sh;
|
|
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
(*swap_sym_in) (cur_bfd, sym_ptr, &sh);
|
|
|
|
|
c = parse_symbol (&sh,
|
|
|
|
|
debug_info->external_aux + fh->iauxBase,
|
2011-01-06 06:22:53 +08:00
|
|
|
|
sym_ptr, fh->fBigendian,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
pst->section_offsets, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
sym_ptr += c * external_sym_size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Linenumbers. At the end, check if we can save memory.
|
|
|
|
|
parse_lines has to look ahead an arbitrary number of PDR
|
|
|
|
|
structures, so we swap them all first. */
|
|
|
|
|
if (fh->cpd > 0)
|
|
|
|
|
{
|
|
|
|
|
PDR *pr_block;
|
|
|
|
|
struct cleanup *old_chain;
|
|
|
|
|
char *pdr_ptr;
|
|
|
|
|
char *pdr_end;
|
|
|
|
|
PDR *pdr_in;
|
|
|
|
|
PDR *pdr_in_end;
|
|
|
|
|
|
|
|
|
|
pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
|
|
|
|
|
|
2000-12-15 09:01:51 +08:00
|
|
|
|
old_chain = make_cleanup (xfree, pr_block);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
pdr_ptr = ((char *) debug_info->external_pdr
|
|
|
|
|
+ fh->ipdFirst * external_pdr_size);
|
|
|
|
|
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
|
|
|
|
|
pdr_in = pr_block;
|
|
|
|
|
for (;
|
|
|
|
|
pdr_ptr < pdr_end;
|
|
|
|
|
pdr_ptr += external_pdr_size, pdr_in++)
|
|
|
|
|
{
|
|
|
|
|
(*swap_pdr_in) (cur_bfd, pdr_ptr, pdr_in);
|
|
|
|
|
|
|
|
|
|
/* Determine lowest PDR address, the PDRs are not always
|
|
|
|
|
sorted. */
|
|
|
|
|
if (pdr_in == pr_block)
|
|
|
|
|
lowest_pdr_addr = pdr_in->adr;
|
|
|
|
|
else if (pdr_in->adr < lowest_pdr_addr)
|
|
|
|
|
lowest_pdr_addr = pdr_in->adr;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
|
parse_lines (fh, pr_block, lines, maxlines,
|
|
|
|
|
pst, lowest_pdr_addr);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (lines->nitems < fh->cline)
|
|
|
|
|
lines = shrink_linetable (lines);
|
|
|
|
|
|
|
|
|
|
/* Fill in procedure info next. */
|
|
|
|
|
pdr_in = pr_block;
|
|
|
|
|
pdr_in_end = pdr_in + fh->cpd;
|
|
|
|
|
for (; pdr_in < pdr_in_end; pdr_in++)
|
|
|
|
|
parse_procedure (pdr_in, 0, pst);
|
|
|
|
|
|
|
|
|
|
do_cleanups (old_chain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-04 23:11:19 +08:00
|
|
|
|
size = lines->nitems;
|
|
|
|
|
if (size > 1)
|
|
|
|
|
--size;
|
2011-06-15 02:53:14 +08:00
|
|
|
|
LINETABLE (st) = obstack_copy (&mdebugread_objfile->objfile_obstack,
|
2011-04-04 23:11:19 +08:00
|
|
|
|
lines,
|
|
|
|
|
(sizeof (struct linetable)
|
|
|
|
|
+ size * sizeof (lines->item)));
|
|
|
|
|
xfree (lines);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* .. and our share of externals.
|
2011-01-09 11:20:33 +08:00
|
|
|
|
XXX use the global list to speed up things here. How?
|
|
|
|
|
FIXME, Maybe quit once we have found the right number of ext's? */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
top_stack->cur_st = st;
|
2011-01-06 06:22:53 +08:00
|
|
|
|
top_stack->cur_block
|
|
|
|
|
= BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
|
|
|
|
|
GLOBAL_BLOCK);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
top_stack->blocktype = stFile;
|
|
|
|
|
|
|
|
|
|
ext_ptr = PST_PRIVATE (pst)->extern_tab;
|
|
|
|
|
for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
|
2011-01-06 06:22:53 +08:00
|
|
|
|
parse_external (ext_ptr, fh->fBigendian,
|
* dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
(read_ofile_symtab): Add 'objfile' argument.
* dwarf2read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
argument.
(parse_procedure, parse_partial_symbols): Update.
(psymtab_to_symtab_1): Add 'objfile' argument.
* psympriv.h (struct partial_symtab) <objfile>: Remove.
<read_symtab>: Add 'objfile' argument.
(sort_pst_symbols, discard_psymtab): Update.
* psymtab.c (partial_map_expand_apply): Update.
(find_pc_sect_psymtab_closer): Add 'objfile' argument.
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
(find_pc_sect_psymbol): Add 'objfile' argument.
(lookup_symbol_aux_psymtabs): Update.
(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
Add 'objfile' argument.
(find_last_source_symtab_from_partial, dump_psymtab)
(dump_psymtabs_for_objfile, read_symtabs_for_function)
(expand_partial_symbol_tables, read_psymtabs_with_filename)
(find_symbol_file_from_partial, map_matching_symbols_psymtab)
(expand_symtabs_matching_via_partial): Update.
(sort_pst_symbols): Add 'objfile' argument.
(allocate_psymtab): Update.
(discard_psymtab): Add 'objfile' argument.
(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
* stabsread.h (end_psymtab): Update.
* xcoffread.c (this_symtab_objfile): New global.
(process_linenos, enter_line_range, xcoff_next_symbol_text):
Update.
(read_xcoff_symtab): Add 'objfile' argument.
(read_symbol, read_symbol_lineno): Update.
(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
(xcoff_end_psymtab): Add 'objfile' argument.
(scan_xcoff_symtab): Update.
2012-12-13 01:03:03 +08:00
|
|
|
|
pst->section_offsets, objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* If there are undefined symbols, tell the user.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
The alpha has an undefined symbol for every symbol that is
|
|
|
|
|
from a shared library, so tell the user only if verbose is on. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (info_verbose && n_undef_symbols)
|
|
|
|
|
{
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 08:39:24 +08:00
|
|
|
|
printf_filtered (_("File %s contains %d unresolved references:"),
|
gdb/
* ada-lang.c (user_select_syms): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* breakpoint.c (print_breakpoint_location, resolve_sal_pc): Likewise.
(clear_command): New variable sal_fullname, initialize it. Replace
compare_filenames_for_search by filename_cmp with sal_fullname.
(say_where, update_static_tracepoint): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* cli/cli-cmds.c (edit_command, list_command, ambiguous_line_spec):
Likewise.
* dwarf2read.c: Include source.h.
(fixup_go_packaging): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* linespec.c (add_sal_to_sals): Rename variable filename to fullname.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(create_sals_line_offset, convert_linespec_to_sals): New variable
fullname, initialize it, replace symtab->filename reference by the
variable.
* linux-fork.c: Include source.h.
(info_checkpoints_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* macroscope.c (sal_macro_scope): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* mdebugread.c: Include source.h.
(psymtab_to_symtab_1): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(mi_cmd_file_list_exec_source_files): Likewise.
* printcmd.c: Include source.h.
(build_address_symbolic): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* psymtab.c (partial_map_symtabs_matching_filename)
(read_psymtabs_with_fullname): Call compare_filenames_for_search also
with psymtab_to_fullname.
* python/py-symtab.c (stpy_str): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(stpy_get_filename): New variable filename, initialize it, use instead
of symtab->filename refererences.
(salpy_str): Make variable filename const char *. Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
* skip.c: Include source.h and filenames.h.
(skip_file_command): Remove const from the symtab variable. Replace
symtab->filename refererences by symtab_to_fullname call.
(function_name_is_marked_for_skip): New variables searched_for_fullname
and fullname. Use them to search also with symtab's fullname.
* source.c (find_source_lines): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(print_source_lines_base): New variable filename, use it instead of
symtab->filename. Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(line_info, forward_search_command): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
(reverse_search_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls. New variable filename for it.
* stack.c (frame_info): Likewise.
* symmisc.c: Include source.h.
(dump_objfile, dump_symtab_1, maintenance_print_symbols)
(maintenance_info_symtabs): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* symtab.c (iterate_over_some_symtabs): Call
compare_filenames_for_search also with symtab_to_fullname.
(lookup_symbol_aux_quick, basic_lookup_transparent_type_quick): Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
(find_line_symtab): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(file_matches): Replace filename_cmp by compare_filenames_for_search.
(print_symbol_info): Make the last parameter const char *. New
variable s_filename. Use it in the function.
(symtab_symbol_info): Make the last_filename variable const char *.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(rbreak_command): New variable fullname. Use it. Replace
symtab->filename refererence by symtab_to_filename_for_display call.
* tracepoint.c (set_traceframe_context, trace_find_line_command)
(print_one_static_tracepoint_marker): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* tui/tui-source.c (tui_set_source_content): New variables filename and
s_filename. Replace symtab->filename refererences by this variable.
Replace other symtab->filename refererences by
symtab_to_filename_for_display calls.
2013-02-04 00:13:31 +08:00
|
|
|
|
symtab_to_filename_for_display (st),
|
|
|
|
|
n_undef_symbols);
|
2011-01-06 06:22:53 +08:00
|
|
|
|
printf_filtered ("\n\t%4d variables\n\t%4d "
|
|
|
|
|
"procedures\n\t%4d labels\n",
|
1999-04-16 09:35:26 +08:00
|
|
|
|
n_undef_vars, n_undef_procs, n_undef_labels);
|
|
|
|
|
n_undef_symbols = n_undef_labels = n_undef_vars = n_undef_procs = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
pop_parse_stack ();
|
|
|
|
|
|
2013-11-09 02:43:23 +08:00
|
|
|
|
set_symtab_primary (st, 1);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
sort_blocks (st);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now link the psymtab and the symtab. */
|
|
|
|
|
pst->symtab = st;
|
|
|
|
|
|
2011-06-15 02:53:14 +08:00
|
|
|
|
mdebugread_objfile = NULL;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Ancillary parsing procedures. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
/* Return 1 if the symbol pointed to by SH has a cross reference
|
|
|
|
|
to an opaque aggregate type, else 0. */
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-30 09:48:28 +08:00
|
|
|
|
has_opaque_xref (FDR *fh, SYMR *sh)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
TIR tir;
|
|
|
|
|
union aux_ext *ax;
|
|
|
|
|
RNDXR rn[1];
|
|
|
|
|
unsigned int rf;
|
|
|
|
|
|
|
|
|
|
if (sh->index == indexNil)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
ax = debug_info->external_aux + fh->iauxBase + sh->index;
|
|
|
|
|
(*debug_swap->swap_tir_in) (fh->fBigendian, &ax->a_ti, &tir);
|
|
|
|
|
if (tir.bt != btStruct && tir.bt != btUnion && tir.bt != btEnum)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
ax++;
|
|
|
|
|
(*debug_swap->swap_rndx_in) (fh->fBigendian, &ax->a_rndx, rn);
|
|
|
|
|
if (rn->rfd == 0xfff)
|
|
|
|
|
rf = AUX_GET_ISYM (fh->fBigendian, ax + 1);
|
|
|
|
|
else
|
|
|
|
|
rf = rn->rfd;
|
|
|
|
|
if (rf != -1)
|
|
|
|
|
return 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Lookup the type at relative index RN. Return it in TPP
|
|
|
|
|
if found and in any event come up with its name PNAME.
|
|
|
|
|
BIGEND says whether aux symbols are big-endian or not (from fh->fBigendian).
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Return value says how many aux symbols we ate. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int
|
2011-01-06 06:22:53 +08:00
|
|
|
|
cross_ref (int fd, union aux_ext *ax, struct type **tpp,
|
|
|
|
|
enum type_code type_code,
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Use to alloc new type if none is found. */
|
2000-07-30 09:48:28 +08:00
|
|
|
|
char **pname, int bigend, char *sym_name)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
RNDXR rn[1];
|
|
|
|
|
unsigned int rf;
|
|
|
|
|
int result = 1;
|
|
|
|
|
FDR *fh;
|
|
|
|
|
char *esh;
|
|
|
|
|
SYMR sh;
|
|
|
|
|
int xref_fd;
|
|
|
|
|
struct mdebug_pending *pend;
|
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
|
*tpp = (struct type *) NULL;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Escape index means 'the next one'. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (rn->rfd == 0xfff)
|
|
|
|
|
{
|
|
|
|
|
result++;
|
|
|
|
|
rf = AUX_GET_ISYM (bigend, ax + 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rf = rn->rfd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* mips cc uses a rf of -1 for opaque struct definitions.
|
|
|
|
|
Set TYPE_FLAG_STUB for these types so that check_typedef will
|
|
|
|
|
resolve them if the struct gets defined in another compilation unit. */
|
|
|
|
|
if (rf == -1)
|
|
|
|
|
{
|
|
|
|
|
*pname = "<undefined>";
|
2011-01-06 06:22:53 +08:00
|
|
|
|
*tpp = init_type (type_code, 0, TYPE_FLAG_STUB,
|
2011-06-15 02:53:14 +08:00
|
|
|
|
(char *) NULL, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* mips cc uses an escaped rn->index of 0 for struct return types
|
2011-01-09 11:20:33 +08:00
|
|
|
|
of procedures that were compiled without -g. These will always remain
|
1999-04-16 09:35:26 +08:00
|
|
|
|
undefined. */
|
|
|
|
|
if (rn->rfd == 0xfff && rn->index == 0)
|
|
|
|
|
{
|
|
|
|
|
*pname = "<undefined>";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find the relative file descriptor and the symbol in it. */
|
|
|
|
|
fh = get_rfd (fd, rf);
|
|
|
|
|
xref_fd = fh - debug_info->fdr;
|
|
|
|
|
|
|
|
|
|
if (rn->index >= fh->csym)
|
|
|
|
|
{
|
|
|
|
|
/* File indirect entry is corrupt. */
|
|
|
|
|
*pname = "<illegal>";
|
2002-12-17 08:39:08 +08:00
|
|
|
|
bad_rfd_entry_complaint (sym_name, xref_fd, rn->index);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we have processed this symbol then we left a forwarding
|
|
|
|
|
pointer to the type in the pending list. If not, we`ll put
|
|
|
|
|
it in a list of pending types, to be processed later when
|
|
|
|
|
the file will be. In any event, we collect the name for the
|
|
|
|
|
type here. */
|
|
|
|
|
|
|
|
|
|
esh = ((char *) debug_info->external_sym
|
|
|
|
|
+ ((fh->isymBase + rn->index)
|
|
|
|
|
* debug_swap->external_sym_size));
|
|
|
|
|
(*debug_swap->swap_sym_in) (cur_bfd, esh, &sh);
|
|
|
|
|
|
|
|
|
|
/* Make sure that this type of cross reference can be handled. */
|
|
|
|
|
if ((sh.sc != scInfo
|
|
|
|
|
|| (sh.st != stBlock && sh.st != stTypedef && sh.st != stIndirect
|
|
|
|
|
&& sh.st != stStruct && sh.st != stUnion
|
|
|
|
|
&& sh.st != stEnum))
|
1999-07-08 04:19:36 +08:00
|
|
|
|
&& (sh.st != stBlock || !SC_IS_COMMON (sh.sc)))
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* File indirect entry is corrupt. */
|
|
|
|
|
*pname = "<illegal>";
|
2002-12-17 08:39:08 +08:00
|
|
|
|
bad_rfd_entry_complaint (sym_name, xref_fd, rn->index);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*pname = debug_info->ss + fh->issBase + sh.iss;
|
|
|
|
|
|
|
|
|
|
pend = is_pending_symbol (fh, esh);
|
|
|
|
|
if (pend)
|
|
|
|
|
*tpp = pend->t;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* We have not yet seen this type. */
|
|
|
|
|
|
|
|
|
|
if ((sh.iss == 0 && sh.st == stTypedef) || sh.st == stIndirect)
|
|
|
|
|
{
|
|
|
|
|
TIR tir;
|
|
|
|
|
|
|
|
|
|
/* alpha cc puts out a stTypedef with a sh.iss of zero for
|
|
|
|
|
two cases:
|
|
|
|
|
a) forward declarations of structs/unions/enums which are not
|
1999-07-08 04:19:36 +08:00
|
|
|
|
defined in this compilation unit.
|
2011-01-09 11:20:33 +08:00
|
|
|
|
For these the type will be void. This is a bad design decision
|
1999-07-08 04:19:36 +08:00
|
|
|
|
as cross referencing across compilation units is impossible
|
|
|
|
|
due to the missing name.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
b) forward declarations of structs/unions/enums/typedefs which
|
1999-07-08 04:19:36 +08:00
|
|
|
|
are defined later in this file or in another file in the same
|
2011-01-09 11:20:33 +08:00
|
|
|
|
compilation unit. Irix5 cc uses a stIndirect symbol for this.
|
1999-07-08 04:19:36 +08:00
|
|
|
|
Simply cross reference those again to get the true type.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
The forward references are not entered in the pending list and
|
|
|
|
|
in the symbol table. */
|
|
|
|
|
|
|
|
|
|
(*debug_swap->swap_tir_in) (bigend,
|
|
|
|
|
&(debug_info->external_aux
|
|
|
|
|
+ fh->iauxBase + sh.index)->a_ti,
|
|
|
|
|
&tir);
|
|
|
|
|
if (tir.tq0 != tqNil)
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("illegal tq0 in forward typedef for %s"), sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
switch (tir.bt)
|
|
|
|
|
{
|
|
|
|
|
case btVoid:
|
|
|
|
|
*tpp = init_type (type_code, 0, 0, (char *) NULL,
|
2011-06-15 02:53:14 +08:00
|
|
|
|
mdebugread_objfile);
|
1999-07-08 04:19:36 +08:00
|
|
|
|
*pname = "<undefined>";
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btStruct:
|
|
|
|
|
case btUnion:
|
|
|
|
|
case btEnum:
|
|
|
|
|
cross_ref (xref_fd,
|
|
|
|
|
(debug_info->external_aux
|
|
|
|
|
+ fh->iauxBase + sh.index + 1),
|
|
|
|
|
tpp, type_code, pname,
|
|
|
|
|
fh->fBigendian, sym_name);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case btTypedef:
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Follow a forward typedef. This might recursively
|
1999-07-08 04:19:36 +08:00
|
|
|
|
call cross_ref till we get a non typedef'ed type.
|
|
|
|
|
FIXME: This is not correct behaviour, but gdb currently
|
2011-01-09 11:20:33 +08:00
|
|
|
|
cannot handle typedefs without type copying. Type
|
1999-07-08 04:19:36 +08:00
|
|
|
|
copying is impossible as we might have mutual forward
|
|
|
|
|
references between two files and the copied type would not
|
|
|
|
|
get filled in when we later parse its definition. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
*tpp = parse_type (xref_fd,
|
|
|
|
|
debug_info->external_aux + fh->iauxBase,
|
|
|
|
|
sh.index,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(int *) NULL,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fh->fBigendian,
|
|
|
|
|
debug_info->ss + fh->issBase + sh.iss);
|
|
|
|
|
add_pending (fh, esh, *tpp);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2002-12-17 08:39:08 +08:00
|
|
|
|
complaint (&symfile_complaints,
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
internal_error.
* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
* interps.c, language.c, linespec.c, linux-nat.c: Update.
* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-12 02:13:55 +08:00
|
|
|
|
_("illegal bt %d in forward typedef for %s"), tir.bt,
|
2002-12-17 08:39:08 +08:00
|
|
|
|
sym_name);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
*tpp = init_type (type_code, 0, 0, (char *) NULL,
|
2011-06-15 02:53:14 +08:00
|
|
|
|
mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else if (sh.st == stTypedef)
|
|
|
|
|
{
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Parse the type for a normal typedef. This might recursively call
|
1999-04-16 09:35:26 +08:00
|
|
|
|
cross_ref till we get a non typedef'ed type.
|
|
|
|
|
FIXME: This is not correct behaviour, but gdb currently
|
2011-01-09 11:20:33 +08:00
|
|
|
|
cannot handle typedefs without type copying. But type copying is
|
1999-04-16 09:35:26 +08:00
|
|
|
|
impossible as we might have mutual forward references between
|
|
|
|
|
two files and the copied type would not get filled in when
|
|
|
|
|
we later parse its definition. */
|
|
|
|
|
*tpp = parse_type (xref_fd,
|
|
|
|
|
debug_info->external_aux + fh->iauxBase,
|
|
|
|
|
sh.index,
|
1999-07-08 04:19:36 +08:00
|
|
|
|
(int *) NULL,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
fh->fBigendian,
|
|
|
|
|
debug_info->ss + fh->issBase + sh.iss);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Cross reference to a struct/union/enum which is defined
|
|
|
|
|
in another file in the same compilation unit but that file
|
|
|
|
|
has not been parsed yet.
|
|
|
|
|
Initialize the type only, it will be filled in when
|
|
|
|
|
it's definition is parsed. */
|
2011-06-15 02:53:14 +08:00
|
|
|
|
*tpp = init_type (type_code, 0, 0, (char *) NULL, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
add_pending (fh, esh, *tpp);
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* We used one auxent normally, two if we got a "next one" rf. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Quick&dirty lookup procedure, to avoid the MI ones that require
|
2011-01-09 11:20:33 +08:00
|
|
|
|
keeping the symtab sorted. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct symbol *
|
constify struct block in some places
This makes some spots in gdb, particularly general_symbol_info, use a
"const struct block", then fixes the fallout.
The justification is that, ordinarily, blocks ought to be readonly.
Note though that we can't add "const" in the blockvector due to block
relocation. This can be done once blocks are made independent of the
program space.
2014-06-18 Tom Tromey <tromey@redhat.com>
* varobj.c (varobj_create): Update.
* valops.c (value_of_this): Update.
* tracepoint.c (add_local_symbols, scope_info): Update.
* symtab.h (struct general_symbol_info) <block>: Now const.
* symtab.c (skip_prologue_sal)
(default_make_symbol_completion_list_break_on)
(skip_prologue_using_sal): Update.
* stack.h (iterate_over_block_locals)
(iterate_over_block_local_vars): Update.
* stack.c (print_frame_args): Update.
(iterate_over_block_locals, iterate_over_block_local_vars): Make
parameter const.
(get_selected_block): Make return type const.
* python/py-frame.c (frapy_block): Update.
* python/py-block.c (gdbpy_block_for_pc): Update.
* p-exp.y (%union) <bval>: Now const.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (mylookup_symbol, parse_procedure): Update.
* m2-exp.y (%union) <bval>: Now const.
* linespec.c (get_current_search_block): Make return type const.
(create_sals_line_offset, find_label_symbols): Update.
* inline-frame.c (inline_frame_sniffer, skip_inline_frames):
Update.
(block_starting_point_at): Make "block" const.
* infrun.c (insert_exception_resume_breakpoint): Make "b" const.
(check_exception_resume): Update.
* guile/scm-frame.c (gdbscm_frame_block): Update.
* guile/scm-block.c (gdbscm_lookup_block): Update.
* frame.h (get_frame_block): Update.
(get_selected_block): Make return type const.
* frame.c (frame_id_inner): Update.
* f-valprint.c (info_common_command_for_block)
(info_common_command): Update.
* dwarf2loc.c (dwarf2_find_location_expression)
(dwarf_expr_frame_base, dwarf2_compile_expr_to_ax)
(locexpr_describe_location_piece): Update.
* c-exp.y (%union) <bval>: Now const.
* breakpoint.c (resolve_sal_pc): Update.
* blockframe.c (get_frame_block):Make return type const.
(get_pc_function_start, get_frame_function, find_pc_sect_function)
(block_innermost_frame): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(block_for_pc, block_for_pc_sect): Update.
* block.c (blockvector_for_pc_sect, blockvector_for_pc): Make
'pblock' const.
(block_for_pc_sect, block_for_pc): Make return type const.
* ax-gdb.c (gen_expr): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* ada-lang.c (ada_read_renaming_var_value): Make 'block' const.
(ada_make_symbol_completion_list, ada_add_exceptions_from_frame)
(ada_read_var_value): Update.
* ada-exp.y (struct name_info) <block>: Now const.
(%union): Likewise.
(block_lookup): Constify.
2013-03-12 23:51:37 +08:00
|
|
|
|
mylookup_symbol (char *name, const struct block *block,
|
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
|
|
|
|
domain_enum domain, enum address_class class)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
* tracepoint.c (scope_info): Update.
* symtab.c (lookup_block_symbol, iterate_over_symbols)
(find_pc_sect_symtab, search_symbols)
(default_make_symbol_completion_list_break_on)
(make_file_symbol_completion_list): Update.
* symmisc.c (dump_symtab_1): Update.
* stack.c (print_frame_args, iterate_over_block_locals)
(print_frame_labels, iterate_over_block_arg_vars): Update.
* python/py-block.c (block_object) <dict>: Remove.
<block>: New field.
<iter>: Change type.
(blpy_iter): Update.
(blpy_block_syms_iternext): Update.
* psymtab.c (map_block): Use block iterators.
* objfiles.c (objfile_relocate1): Use ALL_DICT_SYMBOLS.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (parse_symbol, mylookup_symbol): Update.
* infrun.c (check_exception_resume): Update.
* cp-support.c (make_symbol_overload_list_block): Update.
* coffread.c (patch_opaque_types): Update.
* buildsym.c (finish_block, end_symtab): Use ALL_DICT_SYMBOLS.
* block.h (struct block_iterator): New.
(block_iterator_first, block_iterator_next, block_iter_name_first)
(block_iter_name_next, block_iter_match_first)
(block_iter_match_next): Declare.
(ALL_BLOCK_SYMBOLS): Redefine.
* block.c (block_iterator_first, block_iterator_next)
(block_iter_name_first, block_iter_name_next)
(block_iter_match_first, block_iter_match_next): New functions.
* ada-lang.c (ada_add_block_symbols)
(ada_make_symbol_completion_list): Use block iterator.
2012-05-11 03:50:09 +08:00
|
|
|
|
struct block_iterator iter;
|
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 inc;
|
2001-10-13 07:51:30 +08:00
|
|
|
|
struct symbol *sym;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
inc = name[0];
|
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 (block, iter, sym)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
2008-08-22 02:14:39 +08:00
|
|
|
|
if (SYMBOL_LINKAGE_NAME (sym)[0] == inc
|
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
|
|
|
|
&& SYMBOL_DOMAIN (sym) == domain
|
1999-04-16 09:35:26 +08:00
|
|
|
|
&& SYMBOL_CLASS (sym) == class
|
* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
2008-08-22 02:14:39 +08:00
|
|
|
|
&& strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return sym;
|
|
|
|
|
}
|
2001-10-13 07:51:30 +08:00
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
|
block = BLOCK_SUPERBLOCK (block);
|
|
|
|
|
if (block)
|
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
|
|
|
|
return mylookup_symbol (name, block, domain, class);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
/* Add a new symbol S to a block B. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2008-05-28 04:24:51 +08:00
|
|
|
|
add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2008-05-28 04:24:51 +08:00
|
|
|
|
SYMBOL_SYMTAB (s) = symtab;
|
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_add_symbol (BLOCK_DICT (b), s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Add a new block B to a symtab S. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
add_block (struct block *b, struct symtab *s)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
/* Cast away "const", but that's ok because we're building the
|
|
|
|
|
symtab and blockvector here. */
|
|
|
|
|
struct blockvector *bv = (struct blockvector *) BLOCKVECTOR (s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2002-03-20 03:00:04 +08:00
|
|
|
|
bv = (struct blockvector *) xrealloc ((void *) bv,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(sizeof (struct blockvector)
|
|
|
|
|
+ BLOCKVECTOR_NBLOCKS (bv)
|
|
|
|
|
* sizeof (bv->block)));
|
|
|
|
|
if (bv != BLOCKVECTOR (s))
|
|
|
|
|
BLOCKVECTOR (s) = bv;
|
|
|
|
|
|
|
|
|
|
BLOCKVECTOR_BLOCK (bv, BLOCKVECTOR_NBLOCKS (bv)++) = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add a new linenumber entry (LINENO,ADR) to a linevector LT.
|
|
|
|
|
MIPS' linenumber encoding might need more than one byte
|
|
|
|
|
to describe it, LAST is used to detect these continuation lines.
|
|
|
|
|
|
|
|
|
|
Combining lines with the same line number seems like a bad idea.
|
|
|
|
|
E.g: There could be a line number entry with the same line number after the
|
|
|
|
|
prologue and GDB should not ignore it (this is a better way to find
|
|
|
|
|
a prologue than mips_skip_prologue).
|
|
|
|
|
But due to the compressed line table format there are line number entries
|
|
|
|
|
for the same line which are needed to bridge the gap to the next
|
2011-01-09 11:20:33 +08:00
|
|
|
|
line number entry. These entries have a bogus address info with them
|
1999-04-16 09:35:26 +08:00
|
|
|
|
and we are unable to tell them from intended duplicate line number
|
|
|
|
|
entries.
|
|
|
|
|
This is another reason why -ggdb debugging format is preferable. */
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-30 09:48:28 +08:00
|
|
|
|
add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* DEC c89 sometimes produces zero linenos which confuse gdb.
|
2011-01-09 11:20:33 +08:00
|
|
|
|
Change them to something sensible. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
if (lineno == 0)
|
|
|
|
|
lineno = 1;
|
|
|
|
|
if (last == 0)
|
2011-01-09 11:20:33 +08:00
|
|
|
|
last = -2; /* Make sure we record first line. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
if (last == lineno) /* Skip continuation lines. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return lineno;
|
|
|
|
|
|
|
|
|
|
lt->item[lt->nitems].line = lineno;
|
|
|
|
|
lt->item[lt->nitems++].pc = adr << 2;
|
|
|
|
|
return lineno;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Sorting and reordering procedures. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Blocks with a smaller low bound should come first. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static int
|
2002-03-20 03:00:04 +08:00
|
|
|
|
compare_blocks (const void *arg1, const void *arg2)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2004-01-18 11:42:28 +08:00
|
|
|
|
LONGEST addr_diff;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
struct block **b1 = (struct block **) arg1;
|
|
|
|
|
struct block **b2 = (struct block **) arg2;
|
|
|
|
|
|
|
|
|
|
addr_diff = (BLOCK_START ((*b1))) - (BLOCK_START ((*b2)));
|
|
|
|
|
if (addr_diff == 0)
|
|
|
|
|
return (BLOCK_END ((*b2))) - (BLOCK_END ((*b1)));
|
|
|
|
|
return addr_diff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Sort the blocks of a symtab S.
|
|
|
|
|
Reorder the blocks in the blockvector by code-address,
|
2011-01-09 11:20:33 +08:00
|
|
|
|
as required by some MI search routines. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
sort_blocks (struct symtab *s)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
/* We have to cast away const here, but this is ok because we're
|
|
|
|
|
constructing the blockvector in this code. */
|
|
|
|
|
struct blockvector *bv = (struct blockvector *) BLOCKVECTOR (s);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2012-01-19 20:51:04 +08:00
|
|
|
|
if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
/* Cosmetic */
|
|
|
|
|
if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) == 0)
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) = 0;
|
|
|
|
|
if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) == 0)
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* This is very unfortunate: normally all functions are compiled in
|
|
|
|
|
* the order they are found, but if the file is compiled -O3 things
|
|
|
|
|
* are very different. It would be nice to find a reliable test
|
|
|
|
|
* to detect -O3 images in advance.
|
|
|
|
|
*/
|
2012-01-19 20:51:04 +08:00
|
|
|
|
if (BLOCKVECTOR_NBLOCKS (bv) > FIRST_LOCAL_BLOCK + 1)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
qsort (&BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK),
|
|
|
|
|
BLOCKVECTOR_NBLOCKS (bv) - FIRST_LOCAL_BLOCK,
|
|
|
|
|
sizeof (struct block *),
|
|
|
|
|
compare_blocks);
|
|
|
|
|
|
|
|
|
|
{
|
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
|
|
|
|
CORE_ADDR high = 0;
|
|
|
|
|
int i, j = BLOCKVECTOR_NBLOCKS (bv);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
for (i = FIRST_LOCAL_BLOCK; i < j; i++)
|
|
|
|
|
if (high < BLOCK_END (BLOCKVECTOR_BLOCK (bv, i)))
|
|
|
|
|
high = BLOCK_END (BLOCKVECTOR_BLOCK (bv, i));
|
|
|
|
|
BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) = high;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK));
|
|
|
|
|
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
|
|
|
|
|
BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
|
|
|
|
|
BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
|
|
|
|
|
BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Constructor/restructor/destructor procedures. */
|
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
|
|
|
|
/* Allocate a new symtab for NAME. Needs an estimate of how many
|
2011-01-09 11:20:33 +08:00
|
|
|
|
linenumbers MAXLINES we'll put in it. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct symtab *
|
2010-10-02 04:26:11 +08:00
|
|
|
|
new_symtab (const char *name, int maxlines, struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct symtab *s = allocate_symtab (name, objfile);
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
struct blockvector *bv;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
LINETABLE (s) = new_linetable (maxlines);
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* All symtabs must have at least two blocks. */
|
constify some blockvector APIs
Generally, the blockvector ought to be readonly. So, this patch makes
the blockvector const in the symtab, and also changes various
blockvector APIs to be const.
This patch has a couple of spots that cast away const. I consider
these to be ok because they occur in mdebugread and are used while
constructing the blockvector. I have added comments at these spots.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-11 03:11:19 +08:00
|
|
|
|
bv = new_bvect (2);
|
|
|
|
|
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK);
|
|
|
|
|
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK);
|
|
|
|
|
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
|
|
|
|
|
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
|
|
|
|
BLOCKVECTOR (s) = bv;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2009-11-06 03:53:04 +08:00
|
|
|
|
s->debugformat = "ECOFF";
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return (s);
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Allocate a new partial_symtab NAME. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct partial_symtab *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
new_psymtab (char *name, struct objfile *objfile)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct partial_symtab *psymtab;
|
|
|
|
|
|
|
|
|
|
psymtab = allocate_psymtab (name, objfile);
|
1999-09-09 08:02:17 +08:00
|
|
|
|
psymtab->section_offsets = objfile->section_offsets;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Keep a backpointer to the file's symbols. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2010-03-11 02:27:00 +08:00
|
|
|
|
psymtab->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
|
|
|
|
|
sizeof (struct symloc));
|
2002-03-20 03:00:04 +08:00
|
|
|
|
memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
|
1999-04-16 09:35:26 +08:00
|
|
|
|
CUR_BFD (psymtab) = cur_bfd;
|
|
|
|
|
DEBUG_SWAP (psymtab) = debug_swap;
|
|
|
|
|
DEBUG_INFO (psymtab) = debug_info;
|
|
|
|
|
PENDING_LIST (psymtab) = pending_list;
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* The way to turn this into a symtab is to call... */
|
2013-01-18 11:09:42 +08:00
|
|
|
|
psymtab->read_symtab = mdebug_read_symtab;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return (psymtab);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Allocate a linetable array of the given SIZE. Since the struct
|
|
|
|
|
already includes one item, we subtract one when calculating the
|
|
|
|
|
proper size to allocate. */
|
|
|
|
|
|
|
|
|
|
static struct linetable *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
new_linetable (int size)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct linetable *l;
|
|
|
|
|
|
2011-04-04 23:11:19 +08:00
|
|
|
|
if (size > 1)
|
|
|
|
|
--size;
|
|
|
|
|
size = size * sizeof (l->item) + sizeof (struct linetable);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
l = (struct linetable *) xmalloc (size);
|
|
|
|
|
l->nitems = 0;
|
|
|
|
|
return l;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Oops, too big. Shrink it. This was important with the 2.4 linetables,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
I am not so sure about the 3.4 ones.
|
|
|
|
|
|
|
|
|
|
Since the struct linetable already includes one item, we subtract one when
|
|
|
|
|
calculating the proper size to allocate. */
|
|
|
|
|
|
|
|
|
|
static struct linetable *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
shrink_linetable (struct linetable *lt)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2002-03-20 03:00:04 +08:00
|
|
|
|
return (struct linetable *) xrealloc ((void *) lt,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
(sizeof (struct linetable)
|
|
|
|
|
+ ((lt->nitems - 1)
|
|
|
|
|
* sizeof (lt->item))));
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Allocate and zero a new blockvector of NBLOCKS blocks. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct blockvector *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
new_bvect (int nblocks)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct blockvector *bv;
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
|
|
size = sizeof (struct blockvector) + nblocks * sizeof (struct block *);
|
|
|
|
|
bv = (struct blockvector *) xzalloc (size);
|
|
|
|
|
|
|
|
|
|
BLOCKVECTOR_NBLOCKS (bv) = nblocks;
|
|
|
|
|
|
|
|
|
|
return bv;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
/* Allocate and zero a new block, and set its BLOCK_DICT. If function
|
|
|
|
|
is non-zero, assume the block is associated to a function, and make
|
|
|
|
|
sure that the symbols are stored linearly; otherwise, store them
|
|
|
|
|
hashed. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct 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
|
|
|
|
new_block (enum block_type type)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2003-09-12 07:43:56 +08:00
|
|
|
|
/* FIXME: carlton/2003-09-11: This should use allocate_block to
|
|
|
|
|
allocate the block. Which, in turn, suggests that the block
|
|
|
|
|
should be allocated on an obstack. */
|
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 *retval = xzalloc (sizeof (struct block));
|
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
|
|
|
|
if (type == FUNCTION_BLOCK)
|
|
|
|
|
BLOCK_DICT (retval) = dict_create_linear_expandable ();
|
|
|
|
|
else
|
|
|
|
|
BLOCK_DICT (retval) = dict_create_hashed_expandable ();
|
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
|
|
|
|
return retval;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Create a new symbol with printname NAME. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct symbol *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
new_symbol (char *name)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
2013-04-09 03:48:30 +08:00
|
|
|
|
struct symbol *s = allocate_symbol (mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
2013-04-09 03:56:03 +08:00
|
|
|
|
SYMBOL_SET_LANGUAGE (s, psymtab_language,
|
|
|
|
|
&mdebugread_objfile->objfile_obstack);
|
2011-06-15 02:53:14 +08:00
|
|
|
|
SYMBOL_SET_NAMES (s, name, strlen (name), 1, mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-09 11:20:33 +08:00
|
|
|
|
/* Create a new type with printname NAME. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
static struct type *
|
2000-07-30 09:48:28 +08:00
|
|
|
|
new_type (char *name)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
struct type *t;
|
|
|
|
|
|
2011-06-15 02:53:14 +08:00
|
|
|
|
t = alloc_type (mdebugread_objfile);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
TYPE_NAME (t) = name;
|
2010-01-12 13:49:00 +08:00
|
|
|
|
INIT_CPLUS_SPECIFIC (t);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
return t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read ECOFF debugging information from a BFD section. This is
|
|
|
|
|
called from elfread.c. It parses the section into a
|
|
|
|
|
ecoff_debug_info struct, and then lets the rest of the file handle
|
|
|
|
|
it as normal. */
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
elfmdebug_build_psymtabs (struct objfile *objfile,
|
|
|
|
|
const struct ecoff_debug_swap *swap, asection *sec)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
|
|
|
|
bfd *abfd = objfile->obfd;
|
|
|
|
|
struct ecoff_debug_info *info;
|
2003-02-21 02:31:14 +08:00
|
|
|
|
struct cleanup *back_to;
|
|
|
|
|
|
|
|
|
|
/* FIXME: It's not clear whether we should be getting minimal symbol
|
|
|
|
|
information from .mdebug in an ELF file, or whether we will.
|
|
|
|
|
Re-initialize the minimal symbol reader in case we do. */
|
|
|
|
|
|
|
|
|
|
init_minimal_symbol_collection ();
|
|
|
|
|
back_to = make_cleanup_discard_minimal_symbols ();
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
info = ((struct ecoff_debug_info *)
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-08 02:29:54 +08:00
|
|
|
|
obstack_alloc (&objfile->objfile_obstack,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
sizeof (struct ecoff_debug_info)));
|
|
|
|
|
|
|
|
|
|
if (!(*swap->read_debug_info) (abfd, sec, info))
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 12:06:14 +08:00
|
|
|
|
error (_("Error reading ECOFF debugging information: %s"),
|
1999-04-16 09:35:26 +08:00
|
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
|
|
1999-09-09 08:02:17 +08:00
|
|
|
|
mdebug_build_psymtabs (objfile, swap, info);
|
2003-02-21 02:31:14 +08:00
|
|
|
|
|
|
|
|
|
install_minimal_symbols (objfile);
|
|
|
|
|
do_cleanups (back_to);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2000-07-30 09:48:28 +08:00
|
|
|
|
_initialize_mdebugread (void)
|
1999-04-16 09:35:26 +08:00
|
|
|
|
{
|
ChangeLog:
* mdebugread.c (mdebug_type_void, mdebug_type_char, mdebug_type_short,
mdebug_type_int, mdebug_type_int_32, mdebug_type_int_64,
mdebug_type_long_32, mdebug_type_long_64, mdebug_type_long_long_64,
mdebug_type_unsigned_char, mdebug_type_unsigned_short,
mdebug_type_unsigned_int_32, mdebug_type_unsigned_int_64,
mdebug_type_unsigned_long_32, mdebug_type_unsigned_long_64,
mdebug_type_unsigned_long_long_64, mdebug_type_adr_32,
mdebug_type_adr_64, mdebug_type_float, mdebug_type_double,
mdebug_type_complex, mdebug_type_double_complex,
mdebug_type_fixed_dec, mdebug_type_float_dec, mdebug_type_string):
Remove.
(basic_type_data): New global variable.
(basic_type): New function.
(parse_type): Remove static basic type map map_bt. Call basic_type
to get basic types instead of using mdebug_type_ variables.
(parse_symbol): Use builtin types instead of mdebug_type_ variables.
(upgrade_type): Likewise.
(parse_procedure): Likewise.
(psymtab_to_symtab_1): Likewise.
(_initialize_mdebugread): Do not initialize mdebug_type_ variables.
Initialize basic_type_data.
include/coff/ChangeLog:
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
btAdr64, btInt64, btUInt64): New defines.
2009-06-04 02:08:14 +08:00
|
|
|
|
basic_type_data = register_objfile_data ();
|
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
PR symtab/8421:
* coffread.c (coff_register_index): New global.
(process_coff_symbol, coff_read_enum_type): Set
SYMBOL_ACLASS_INDEX.
(_initialize_coffread): Initialize new global.
* dwarf2loc.c (locexpr_find_frame_base_location)
(dwarf2_block_frame_base_locexpr_funcs)
(loclist_find_frame_base_location)
(dwarf2_block_frame_base_loclist_funcs): New.
(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
(dwarf2_block_frame_base_loclist_funcs): New.
* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
globals.
(read_func_scope): Update.
(fixup_go_packaging, mark_common_block_symbol_computed)
(var_decode_location, new_symbol_full, dwarf2_const_value):
Set SYMBOL_ACLASS_INDEX.
(dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument.
(_initialize_dwarf2_read): Initialize new globals.
* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
globals.
(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
(_initialize_mdebugread): Initialize new globals.
* psympriv.h (struct partial_symbol) <aclass>: Update comment.
* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
(stab_register_index, stab_regparm_index): New globals.
(define_symbol, read_enum_type, common_block_end): Set
SYMBOL_ACLASS_INDEX.
(_initialize_stabsread): Initialize new globals.
* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
globals.
(MAX_SYMBOL_IMPLS): New define.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl)
(initialize_ordinary_address_classes): New functions.
(_initialize_symtab): Call initialize_ordinary_address_classes.
* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
(struct symbol_impl): New.
(SYMBOL_ACLASS_BITS): New define.
(struct symbol) <aclass, ops>: Remove fields.
<aclass_index>: New field.
(symbol_impls): Declare.
(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
(register_symbol_computed_impl, register_symbol_block_impl)
(register_symbol_register_impl): Declare.
(struct symbol_computed_ops): Add location_has_loclist.
(struct symbol_block_ops): New.
(SYMBOL_BLOCK_OPS): New.
* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-21 02:33:05 +08:00
|
|
|
|
|
|
|
|
|
mdebug_register_index
|
|
|
|
|
= register_symbol_register_impl (LOC_REGISTER, &mdebug_register_funcs);
|
|
|
|
|
mdebug_regparm_index
|
|
|
|
|
= register_symbol_register_impl (LOC_REGPARM_ADDR, &mdebug_register_funcs);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
}
|