old-cross-binutils/gdb/mipsread.c

159 lines
4.4 KiB
C
Raw Normal View History

1991-03-28 16:26:26 +00:00
/* Read a symbol table in MIPS' format (Third-Eye).
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993 Free Software
Foundation, Inc.
Contributed by Alessandro Forin (af@cs.cmu.edu) at CMU. Major work
by Per Bothner, John Gilmore and Ian Lance Taylor at Cygnus Support.
1991-03-28 16:26:26 +00:00
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
1991-03-28 16:26:26 +00:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
1991-03-28 16:26:26 +00:00
This program is distributed in the hope that it will be useful,
1991-03-28 16:26:26 +00:00
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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Read symbols from an ECOFF file. Most of the work is done in
mdebugread.c. */
1991-03-28 16:26:26 +00:00
#include "defs.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
#include "stabsread.h"
#include "gdb-stabs.h"
#include "coff/internal.h"
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
#include "coff/ecoff.h"
#include "libcoff.h" /* Private BFD COFF information. */
#include "libecoff.h" /* Private BFD ECOFF information. */
static void
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
mipscoff_new_init PARAMS ((struct objfile *));
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
static void
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
mipscoff_symfile_init PARAMS ((struct objfile *));
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
static void
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
mipscoff_symfile_read PARAMS ((struct objfile *, struct section_offsets *,
int));
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
static void
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
mipscoff_symfile_finish PARAMS ((struct objfile *));
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
static struct section_offsets *
mipscoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Initialize anything that needs initializing when a completely new
symbol file is specified (not just adding some symbols from another
file, e.g. a shared library). */
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
extern CORE_ADDR sigtramp_address;
1991-03-28 16:26:26 +00:00
static void
Create and use macros for iterating on symtabs, psymtabs, msymbols. * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. (patch_opaque_types): Avoid dummy args and result. * objfiles.c (have_partial_symbols, have_full_symbols, have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. (iterate_over_objfiles, iterate_over_symtabs, iterate_over_psymtabs): Remove, clunky and slow. * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, ALL_PSYMTABS, and ALL_MSYMBOLS macros. * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, dump_objfile): Remove dummy args and results. Move filename comparisons to callers. (printsyms_command, printpsyms_command, printmsyms_command, printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, list_symbols, make_symbol_completion_list): Replace explicit iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. Eliminate Dijkstra flag crap, break out of loops with gotos. (lookup_symtab_1): Protect '/' tests from short filenames. (cplus_mangled_symbol): Move inline into lookup_symbol. * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. (relocate_minimal_symbol): Move inline to vmap_symtab. (vmap_symtab): Replace iteration with ALL_OBJFILES, iterate_over_msymbols with ALL_MSYMBOLS. Misc cleanup prior to release. * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. * mipsread.c: Add prototypes for all static functions. * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, dump_blockvector, dump_block, dump_addrchass, dump_namespace, dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd unused copy! * buildsym.c (define_symbol): Handle global register variables (from Pierre Willard). Complain if register numbers are too large.
1992-03-29 23:17:36 +00:00
mipscoff_new_init (ignore)
struct objfile *ignore;
1991-03-28 16:26:26 +00:00
{
sigtramp_address = 0;
stabsread_new_init ();
buildsym_new_init ();
1991-03-28 16:26:26 +00:00
}
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Initialize to read a symbol file (nothing to do). */
static void
* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (coff_symfile_finish): Add function, prototype, and add to the xxxx_sym_fns struct for each file type. Also reformat the xxxx_sym_fns vector to a standard format and add comments. * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read): Pass pointer to struct objfile rather than pointer to sym_fns. Change references inside each function accordingly. Allocate any symbol file specific info in the per-objfile memory region. * dbxread.c (free_and_init_header_files): Break function into free_header_files(), called from dbx_symfile_finish(), and init_header_files(), called from dbx_new_init(). * dbxread.c (dbx_new_init): Move deallocation things to new dbx_symfile_finish function. * elfread.c (elf_new_init): Call buildsym_new_init(). * objfiles.c (free_objfile): Call the appropriate symfile_finish() routine for the objfile before deallocating other stuff. * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg. * symfile.h: Move struct sym_fns to before struct objfile def. Add sym_finish function pointer and change prototypes of other function pointers to reflect passing struct objfile pointer rather than struct sym_fns pointer. * symfile.c: Remove now obsolete symtab_fns pointer. * symfile.c (symfile_init): Renamed to find_sym_fns, and now only locates the correct sym_fns struct for the given objfile. * symfile.c (syms_from_objfile, symbol_file_add): Restructured for better support of mapped symbol tables. * symfile.c (symbol_file_command): Remove obsolete code using symfile_fns. * symfile.h: Remove duplicate declarations for symfile_objfile, entry_point, and object_files. * target.c (target_info): Compare symfile_objfile to NULL. * xcoffread.c (aixcoff_new_init): Move deallocation stuff to aixcoff_symfile_finish().
1992-03-19 21:57:15 +00:00
mipscoff_symfile_init (objfile)
struct objfile *objfile;
1991-03-28 16:26:26 +00:00
{
}
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Read a symbol file from a file. */
static void
mipscoff_symfile_read (objfile, section_offsets, mainline)
* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (coff_symfile_finish): Add function, prototype, and add to the xxxx_sym_fns struct for each file type. Also reformat the xxxx_sym_fns vector to a standard format and add comments. * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read): Pass pointer to struct objfile rather than pointer to sym_fns. Change references inside each function accordingly. Allocate any symbol file specific info in the per-objfile memory region. * dbxread.c (free_and_init_header_files): Break function into free_header_files(), called from dbx_symfile_finish(), and init_header_files(), called from dbx_new_init(). * dbxread.c (dbx_new_init): Move deallocation things to new dbx_symfile_finish function. * elfread.c (elf_new_init): Call buildsym_new_init(). * objfiles.c (free_objfile): Call the appropriate symfile_finish() routine for the objfile before deallocating other stuff. * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg. * symfile.h: Move struct sym_fns to before struct objfile def. Add sym_finish function pointer and change prototypes of other function pointers to reflect passing struct objfile pointer rather than struct sym_fns pointer. * symfile.c: Remove now obsolete symtab_fns pointer. * symfile.c (symfile_init): Renamed to find_sym_fns, and now only locates the correct sym_fns struct for the given objfile. * symfile.c (syms_from_objfile, symbol_file_add): Restructured for better support of mapped symbol tables. * symfile.c (symbol_file_command): Remove obsolete code using symfile_fns. * symfile.h: Remove duplicate declarations for symfile_objfile, entry_point, and object_files. * target.c (target_info): Compare symfile_objfile to NULL. * xcoffread.c (aixcoff_new_init): Move deallocation stuff to aixcoff_symfile_finish().
1992-03-19 21:57:15 +00:00
struct objfile *objfile;
struct section_offsets *section_offsets;
1991-03-28 16:26:26 +00:00
int mainline;
{
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
bfd *abfd = objfile->obfd;
struct cleanup * back_to;
init_minimal_symbol_collection ();
back_to = make_cleanup (discard_minimal_symbols, 0);
1991-03-28 16:26:26 +00:00
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
if (ecoff_slurp_symbolic_info (abfd) == false)
error ("Error reading symbol table: %s", bfd_errmsg (bfd_error));
mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
&ecoff_data (abfd)->debug_info, section_offsets);
1991-03-28 16:26:26 +00:00
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
1991-03-28 16:26:26 +00:00
* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (coff_symfile_finish): Add function, prototype, and add to the xxxx_sym_fns struct for each file type. Also reformat the xxxx_sym_fns vector to a standard format and add comments. * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read): Pass pointer to struct objfile rather than pointer to sym_fns. Change references inside each function accordingly. Allocate any symbol file specific info in the per-objfile memory region. * dbxread.c (free_and_init_header_files): Break function into free_header_files(), called from dbx_symfile_finish(), and init_header_files(), called from dbx_new_init(). * dbxread.c (dbx_new_init): Move deallocation things to new dbx_symfile_finish function. * elfread.c (elf_new_init): Call buildsym_new_init(). * objfiles.c (free_objfile): Call the appropriate symfile_finish() routine for the objfile before deallocating other stuff. * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg. * symfile.h: Move struct sym_fns to before struct objfile def. Add sym_finish function pointer and change prototypes of other function pointers to reflect passing struct objfile pointer rather than struct sym_fns pointer. * symfile.c: Remove now obsolete symtab_fns pointer. * symfile.c (symfile_init): Renamed to find_sym_fns, and now only locates the correct sym_fns struct for the given objfile. * symfile.c (syms_from_objfile, symbol_file_add): Restructured for better support of mapped symbol tables. * symfile.c (symbol_file_command): Remove obsolete code using symfile_fns. * symfile.h: Remove duplicate declarations for symfile_objfile, entry_point, and object_files. * target.c (target_info): Compare symfile_objfile to NULL. * xcoffread.c (aixcoff_new_init): Move deallocation stuff to aixcoff_symfile_finish().
1992-03-19 21:57:15 +00:00
install_minimal_symbols (objfile);
do_cleanups (back_to);
1991-03-28 16:26:26 +00:00
}
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Perform any local cleanups required when we are done with a
particular objfile. */
* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (coff_symfile_finish): Add function, prototype, and add to the xxxx_sym_fns struct for each file type. Also reformat the xxxx_sym_fns vector to a standard format and add comments. * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read): Pass pointer to struct objfile rather than pointer to sym_fns. Change references inside each function accordingly. Allocate any symbol file specific info in the per-objfile memory region. * dbxread.c (free_and_init_header_files): Break function into free_header_files(), called from dbx_symfile_finish(), and init_header_files(), called from dbx_new_init(). * dbxread.c (dbx_new_init): Move deallocation things to new dbx_symfile_finish function. * elfread.c (elf_new_init): Call buildsym_new_init(). * objfiles.c (free_objfile): Call the appropriate symfile_finish() routine for the objfile before deallocating other stuff. * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg. * symfile.h: Move struct sym_fns to before struct objfile def. Add sym_finish function pointer and change prototypes of other function pointers to reflect passing struct objfile pointer rather than struct sym_fns pointer. * symfile.c: Remove now obsolete symtab_fns pointer. * symfile.c (symfile_init): Renamed to find_sym_fns, and now only locates the correct sym_fns struct for the given objfile. * symfile.c (syms_from_objfile, symbol_file_add): Restructured for better support of mapped symbol tables. * symfile.c (symbol_file_command): Remove obsolete code using symfile_fns. * symfile.h: Remove duplicate declarations for symfile_objfile, entry_point, and object_files. * target.c (target_info): Compare symfile_objfile to NULL. * xcoffread.c (aixcoff_new_init): Move deallocation stuff to aixcoff_symfile_finish().
1992-03-19 21:57:15 +00:00
static void
mipscoff_symfile_finish (objfile)
struct objfile *objfile;
{
1991-03-28 16:26:26 +00:00
}
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Fake up identical offsets for all sections. */
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
static struct section_offsets *
mipscoff_symfile_offsets (objfile, addr)
struct objfile *objfile;
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
CORE_ADDR addr;
1991-03-28 16:26:26 +00:00
{
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
struct section_offsets *section_offsets;
int i;
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
objfile->num_sections = SECT_OFF_MAX;
section_offsets = ((struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack,
(sizeof (struct section_offsets)
+ (sizeof (section_offsets->offsets)
* (SECT_OFF_MAX - 1)))));
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
for (i = 0; i < SECT_OFF_MAX; i++)
ANOFFSET (section_offsets, i) = addr;
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
return section_offsets;
1991-03-28 16:26:26 +00:00
}
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
/* Initialization */
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
static struct sym_fns ecoff_sym_fns =
{
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
bfd_target_ecoff_flavour,
mipscoff_new_init, /* sym_new_init: init anything gbl to entire symtab */
mipscoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
mipscoff_symfile_read, /* sym_read: read a symbol file into symtab */
mipscoff_symfile_finish, /* sym_finish: finished with file, cleanup */
mipscoff_symfile_offsets, /* sym_offsets: dummy FIXME til implem sym reloc */
NULL /* next: pointer to next struct sym_fns */
};
1991-03-28 16:26:26 +00:00
Added Irix 5 support. * configure.in (mips-sgi-irix5*): New host and target. Use irix5 for both. * config/mips/irix5.mh, config/mips/irix5.mt, config/mips/xm-irix5.h, config/mips/nm-irix5.h, config/mips/tm-irix5.h, irix5-nat.c: New files for Irix 5 support. * mdebugread.c: New file, split out of mipsread.c. Added elfmdebug_build_psymtabs routine. Added some checks on external symbols. Changed code to keep ecoff_debug_info and ecoff_debug_swap structs in the psymtab and in global pointers rather than retrieving them from the bfd. Also changed to keep the pending list with the psymtab rather than the objfile (each psymtab for a single objfile points to the same pending list). * mipsread.c: Bulk of file moved into mdebugread.c, leaving just the sym_fns. * Makefile.in (SFILES): Added mdebugread.c. (OBS): Added mdebugread.o. (mdebugread.o): New target. * symfile.h: Declare mdebug_build_psymtabs and elfmdebug_build_psymtabs. * elfread.c (struct elfinfo): Added mdebugsect field. (elf_locate_sections): Remember location of .mdebug section. (elf_symfile_read): Call elfmdebug_build_psymtabs on .mdebug section. * infrun.c (AT_FUNCTION_START): Set to 0 if not already defined. (wait_for_inferior): Use AT_FUNCTION_START if it is defined to see if PC is at the start of a function. * mips-tdep.c (read_next_frame_reg): Use SIGFRAME_REG_SIZE, and give it a default definition. (mips_skip_prologue): Skip instructions which initialize $gp register. (in_sigtramp): New procedure, moved in from mipsread.c. * config/mips/tm-mips.h: Declare in_sigtramp.
1993-12-06 17:31:05 +00:00
void
_initialize_mipsread ()
1991-03-28 16:26:26 +00:00
{
add_symtab_fns (&ecoff_sym_fns);
1991-03-28 16:26:26 +00:00
}