diff options
Diffstat (limited to 'gdb/mdebugread.c')
-rw-r--r-- | gdb/mdebugread.c | 72 |
1 files changed, 47 insertions, 25 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index ab4d509..5bb15c2 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1,6 +1,6 @@ /* Read a symbol table in ECOFF format (Third-Eye). - Copyright (C) 1986-2024 Free Software Foundation, Inc. + Copyright (C) 1986-2025 Free Software Foundation, Inc. Original version contributed by Alessandro Forin (af@cs.cmu.edu) at CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor @@ -329,7 +329,7 @@ fdr_name (FDR *f) /* Read in and parse the symtab of the file OBJFILE. Symbols from different sections are relocated via the SECTION_OFFSETS. */ -void +static void mdebug_build_psymtabs (minimal_symbol_reader &reader, struct objfile *objfile, const struct ecoff_debug_swap *swap, @@ -413,7 +413,7 @@ static struct parse_stack struct type *cur_type; /* Type we parse fields for. */ int cur_field; /* Field number in cur_type. */ - CORE_ADDR procadr; /* Start addres of this procedure. */ + CORE_ADDR procadr; /* Start address of this procedure. */ int numargs; /* Its argument count. */ } @@ -1119,7 +1119,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case_stBlock_code: found_ecoff_debugging_info = 1; - /* Beginnning of (code) block. Value of symbol + /* Beginning of (code) block. Value of symbol is the displacement from procedure start. */ push_parse_stack (); @@ -1319,7 +1319,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, consequence of GDB's type management; CC and GCC (at least through version 2.4) both output variables of either type char * or caddr_t with the type - refering to the stTypedef symbol for caddr_t. If a future + referring to the stTypedef symbol for caddr_t. If a future compiler cleans this up it GDB is not ready for it yet, but if it becomes ready we somehow need to disable this check (without breaking the PCC/GCC2.4 @@ -2122,7 +2122,7 @@ parse_external (EXTR *es, int bigend, const section_offsets §ion_offsets, /* There is no need to parse the external procedure symbols. If they are from objects compiled without -g, their index will be indexNil, and the symbol definition from the minimal symbol - is preferrable (yielding a function returning int instead of int). + is preferable (yielding a function returning int instead of int). If the index points to a local procedure symbol, the local symbol already provides the correct type. Note that the index of the external procedure symbol points @@ -2488,7 +2488,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, switch (ext_in->asym.st) { case stProc: - /* Beginnning of Procedure */ + /* Beginning of Procedure */ break; case stStaticProc: /* Load time only static procs */ @@ -2522,14 +2522,14 @@ parse_partial_symbols (minimal_symbol_reader &reader, /* On certain platforms, some extra label symbols can be generated by the linker. One possible usage for this kind - of symbols is to represent the address of the begining of a + of symbols is to represent the address of the beginning of a given section. For instance, on Tru64 5.1, the address of the _ftext label is the start address of the .text section. The storage class of these symbols is usually directly related to the section to which the symbol refers. For instance, on Tru64 5.1, the storage class for the _fdata - label is scData, refering to the .data section. + label is scData, referring to the .data section. It is actually possible that the section associated to the storage class of the label does not exist. On True64 5.1 @@ -2671,7 +2671,10 @@ parse_partial_symbols (minimal_symbol_reader &reader, &sh); if (strcmp (debug_info->ss + fh->issBase + sh.iss, stabs_symbol) == 0) - processing_gcc_compilation = 2; + { + processing_gcc_compilation = 2; + stabs_deprecated_warning (); + } } if (processing_gcc_compilation != 0) @@ -2892,7 +2895,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, const char *basename; /* A zero value is probably an indication for the - SunPRO 3.0 compiler. dbx_end_psymtab explicitly tests + SunPRO 3.0 compiler. stabs_end_psymtab explicitly tests for zero, so don't relocate it. */ if (sh.value == 0 @@ -2935,7 +2938,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, name SOs. */ /* Some other compilers (C++ ones in particular) emit - useless SOs for non-existant .c files. We ignore + useless SOs for non-existent .c files. We ignore all subsequent SOs that immediately follow the first. */ @@ -3297,7 +3300,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, case N_ENDM: /* Solaris 2 end of module, finish current partial - symbol table. dbx_end_psymtab will set the + symbol table. stabs_end_psymtab will set the high text address of PST to the proper value, which is necessary if a module compiled without debugging info follows this module. */ @@ -3368,7 +3371,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, char *sym_name; enum address_class theclass; unrelocated_addr minsym_value; - short section = -1; + int section = -1; (*swap_sym_in) (cur_bfd, ((char *) debug_info->external_sym @@ -3616,7 +3619,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, enum address_class theclass; SYMR *psh; CORE_ADDR svalue; - short section; + int section; gdb_assert (ext_ptr->ifd == f_idx); @@ -3686,14 +3689,14 @@ parse_partial_symbols (minimal_symbol_reader &reader, } } - /* Link pst to FDR. dbx_end_psymtab returns NULL if the psymtab was + /* Link pst to FDR. stabs_end_psymtab returns NULL if the psymtab was empty and put on the free list. */ fdr_to_pst[f_idx].pst - = dbx_end_psymtab (objfile, partial_symtabs, save_pst, - psymtab_include_list, includes_used, - -1, save_pst->unrelocated_text_high (), - dependency_list, dependencies_used, - textlow_not_set); + = stabs_end_psymtab (objfile, partial_symtabs, save_pst, + psymtab_include_list, includes_used, + -1, save_pst->unrelocated_text_high (), + dependency_list, dependencies_used, + textlow_not_set); includes_used = 0; dependencies_used = 0; } @@ -4401,7 +4404,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, case btTypedef: /* Follow a forward typedef. This might recursively call cross_ref till we get a non typedef'ed type. - FIXME: This is not correct behaviour, but gdb currently + FIXME: This is not correct behavior, but gdb currently cannot handle typedefs without type copying. Type copying is impossible as we might have mutual forward references between two files and the copied type would not @@ -4427,7 +4430,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, { /* Parse the type for a normal typedef. This might recursively call cross_ref till we get a non typedef'ed type. - FIXME: This is not correct behaviour, but gdb currently + FIXME: This is not correct behavior, but gdb currently cannot handle typedefs without type copying. But type copying is impossible as we might have mutual forward references between two files and the copied type would not get filled in when @@ -4789,9 +4792,28 @@ elfmdebug_build_psymtabs (struct objfile *objfile, reader.install (); } -void _initialize_mdebugread (); +/* see mdebugread.h. */ + void -_initialize_mdebugread () +mipsmdebug_build_psymtabs (struct objfile *objfile, + const struct ecoff_debug_swap *swap, + struct ecoff_debug_info *info) +{ + bfd *abfd = objfile->obfd.get (); + + minimal_symbol_reader reader (objfile); + + if (!(*swap->read_debug_info) (abfd, nullptr, + info)) + error (_("Error reading ECOFF debugging information: %s"), + bfd_errmsg (bfd_get_error ())); + + mdebug_build_psymtabs (reader, objfile, swap, info); + + reader.install (); +} + +INIT_GDB_FILE (mdebugread) { mdebug_register_index = register_symbol_register_impl (LOC_REGISTER, &mdebug_register_funcs); |