/* Read a symbol table in ECOFF format (Third-Eye).
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 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
static int
parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
- struct section_offsets *section_offsets, struct objfile *objfile)
+ const section_offsets §ion_offsets, struct objfile *objfile)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
The value of a stBlock symbol is the displacement from the
procedure address. */
if (sh->st != stEnd && sh->st != stBlock)
- sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
+ sh->value += section_offsets[SECT_OFF_TEXT (objfile)];
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
- sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
+ sh->value += section_offsets[SECT_OFF_DATA (objfile)];
break;
case scBss:
case scSBss:
- sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
+ sh->value += section_offsets[SECT_OFF_BSS (objfile)];
break;
}
/* All functions in C++ have prototypes. For C we don't have enough
information in the debug info. */
- if (SYMBOL_LANGUAGE (s) == language_cplus)
+ if (s->language () == language_cplus)
TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
/* Create and enter a new lexical context. */
- b = new_block (FUNCTION_BLOCK, SYMBOL_LANGUAGE (s));
+ b = new_block (FUNCTION_BLOCK, s->language ());
SYMBOL_BLOCK_VALUE (s) = b;
BLOCK_FUNCTION (b) = s;
BLOCK_START (b) = BLOCK_END (b) = sh->value;
/* GDB expects the absolute function start address for the
procedure descriptor in e->pdr.adr.
As the address in the procedure descriptor is usually relative,
- we would have to relocate e->pdr.adr with cur_fdr->adr and
- ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)).
+ we would have to relocate e->pdr.adr with cur_fdr->adr.
Unfortunately cur_fdr->adr and e->pdr.adr are both absolute
in shared libraries on some systems, and on other systems
e->pdr.adr is sometimes offset by a bogus value.
This routine clobbers top_stack->cur_block and ->cur_st. */
-static void parse_external (EXTR *, int, struct section_offsets *,
- struct objfile *);
-
static void
-parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
+parse_external (EXTR *es, int bigend, const section_offsets §ion_offsets,
struct objfile *objfile)
{
union aux_ext *ax;
struct linetable *lines;
CORE_ADDR lowest_pdr_addr = 0;
int last_symtab_ended = 0;
- struct section_offsets *section_offsets = objfile->section_offsets;
+ const section_offsets §ion_offsets = objfile->section_offsets;
if (pst->readin)
return;
&& previous_stab_code != (unsigned char) N_SO
&& *name == '\000')
{
- valu += ANOFFSET (section_offsets,
- SECT_OFF_TEXT (objfile));
+ valu += section_offsets[SECT_OFF_TEXT (objfile)];
previous_stab_code = N_SO;
cust = end_symtab (valu, SECT_OFF_TEXT (objfile));
end_stabs ();
else
{
/* Handle encoded stab line number. */
- valu += ANOFFSET (section_offsets,
- SECT_OFF_TEXT (objfile));
+ valu += section_offsets[SECT_OFF_TEXT (objfile)];
record_line (get_current_subfile (), sh.index,
gdbarch_addr_bits_remove (gdbarch, valu));
}
{
struct symbol *s = allocate_symbol (mdebugread_objfile);
- SYMBOL_SET_LANGUAGE (s, psymtab_language,
- &mdebugread_objfile->objfile_obstack);
- SYMBOL_SET_NAMES (s, name, true, mdebugread_objfile);
+ s->set_language (psymtab_language, &mdebugread_objfile->objfile_obstack);
+ s->compute_and_set_names (name, true, mdebugread_objfile->per_bfd);
return s;
}