1991-03-28 16:26:26 +00:00
|
|
|
/* Read a symbol table in MIPS' format (Third-Eye).
|
1993-03-22 20:22:54 +00:00
|
|
|
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.
|
|
|
|
|
1991-07-09 02:08:13 +00:00
|
|
|
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
|
1991-07-09 02:08:13 +00:00
|
|
|
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
|
|
|
|
1991-07-09 02:08:13 +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
|
1991-07-09 02:08:13 +00:00
|
|
|
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
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
/* Read symbols from an ECOFF file. Most of the work is done in
|
|
|
|
mdebugread.c. */
|
1992-03-03 23:26:26 +00:00
|
|
|
|
1991-03-28 16:26:26 +00:00
|
|
|
#include "defs.h"
|
|
|
|
#include "symtab.h"
|
|
|
|
#include "symfile.h"
|
1992-03-21 01:56:01 +00:00
|
|
|
#include "objfiles.h"
|
1991-12-23 23:16:58 +00:00
|
|
|
#include "buildsym.h"
|
1992-10-15 08:36:30 +00:00
|
|
|
#include "stabsread.h"
|
|
|
|
#include "gdb-stabs.h"
|
|
|
|
|
1993-03-22 20:22:54 +00:00
|
|
|
#include "coff/internal.h"
|
1993-12-06 17:31:05 +00:00
|
|
|
#include "coff/ecoff.h"
|
1993-03-22 20:22:54 +00:00
|
|
|
#include "libcoff.h" /* Private BFD COFF information. */
|
|
|
|
#include "libecoff.h" /* Private BFD ECOFF information. */
|
|
|
|
|
1992-03-03 23:26:26 +00:00
|
|
|
static void
|
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
|
|
|
|
1992-03-03 23:26:26 +00:00
|
|
|
static void
|
1993-12-06 17:31:05 +00:00
|
|
|
mipscoff_symfile_init PARAMS ((struct objfile *));
|
1992-01-28 02:57:37 +00:00
|
|
|
|
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
|
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
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
extern CORE_ADDR sigtramp_address;
|
1991-03-28 16:26:26 +00:00
|
|
|
|
1992-04-03 03:55:42 +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
|
|
|
{
|
1993-07-08 03:34:04 +00:00
|
|
|
sigtramp_address = 0;
|
1993-03-28 19:28:26 +00:00
|
|
|
stabsread_new_init ();
|
|
|
|
buildsym_new_init ();
|
1991-03-28 16:26:26 +00:00
|
|
|
}
|
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
/* Initialize to read a symbol file (nothing to do). */
|
|
|
|
|
1992-04-03 03:55:42 +00:00
|
|
|
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
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
/* Read a symbol file from a file. */
|
|
|
|
|
1992-04-03 03:55:42 +00:00
|
|
|
static void
|
1992-10-15 08:36:30 +00:00
|
|
|
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;
|
1992-10-15 08:36:30 +00:00
|
|
|
struct section_offsets *section_offsets;
|
1991-03-28 16:26:26 +00:00
|
|
|
int mainline;
|
|
|
|
{
|
1993-12-06 17:31:05 +00:00
|
|
|
bfd *abfd = objfile->obfd;
|
1993-08-20 05:12:14 +00:00
|
|
|
struct cleanup * back_to;
|
|
|
|
|
* xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP.
* minsyms.c (install_minimal_symbols): Add bunches to any
existing minsyms in the objfile. Avoid extra mallocation
by working directly in the obstack. Remove ignored `mainline' parm.
* coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h,
xcoffread.c: Change all callers.
* FIXME: We should be able to eliminate MAINLINE from all the
symbol readers now, with a small bit of work.
* valops.c, value.h: Lint.
* remote-vx.c: Add missing break; statement. Bugfix by
Michael Sclafani, <sclafani@src.dec.com>.
1992-02-22 08:17:01 +00:00
|
|
|
init_minimal_symbol_collection ();
|
1993-08-20 05:12:14 +00:00
|
|
|
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. */
|
|
|
|
|
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
|
|
|
|
* xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP.
* minsyms.c (install_minimal_symbols): Add bunches to any
existing minsyms in the objfile. Avoid extra mallocation
by working directly in the obstack. Remove ignored `mainline' parm.
* coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h,
xcoffread.c: Change all callers.
* FIXME: We should be able to eliminate MAINLINE from all the
symbol readers now, with a small bit of work.
* valops.c, value.h: Lint.
* remote-vx.c: Add missing break; statement. Bugfix by
Michael Sclafani, <sclafani@src.dec.com>.
1992-02-22 08:17:01 +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);
|
1993-08-20 05:12:14 +00:00
|
|
|
|
|
|
|
do_cleanups (back_to);
|
1991-03-28 16:26:26 +00:00
|
|
|
}
|
1992-04-12 06:40:04 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
/* Fake up identical offsets for all sections. */
|
1991-03-28 16:26:26 +00:00
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
static struct section_offsets *
|
|
|
|
mipscoff_symfile_offsets (objfile, addr)
|
1993-02-04 19:37:37 +00:00
|
|
|
struct objfile *objfile;
|
1993-12-06 17:31:05 +00:00
|
|
|
CORE_ADDR addr;
|
1991-03-28 16:26:26 +00:00
|
|
|
{
|
1993-12-06 17:31:05 +00:00
|
|
|
struct section_offsets *section_offsets;
|
|
|
|
int i;
|
1991-03-28 16:26:26 +00:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
return section_offsets;
|
1991-03-28 16:26:26 +00:00
|
|
|
}
|
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
/* Initialization */
|
1991-03-28 16:26:26 +00:00
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
static struct sym_fns ecoff_sym_fns =
|
1993-02-04 19:37:37 +00:00
|
|
|
{
|
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 */
|
1993-09-01 12:10:55 +00:00
|
|
|
};
|
1991-03-28 16:26:26 +00:00
|
|
|
|
1993-12-06 17:31:05 +00:00
|
|
|
void
|
|
|
|
_initialize_mipsread ()
|
1991-03-28 16:26:26 +00:00
|
|
|
{
|
1993-02-04 19:37:37 +00:00
|
|
|
add_symtab_fns (&ecoff_sym_fns);
|
1991-03-28 16:26:26 +00:00
|
|
|
}
|