Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor
Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
We use this define in order to know whether we should override a
symbol's ECOFF section with its ELF section. This is necessary in
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
We use this define in order to know whether we should override a
symbol's ECOFF section with its ELF section. This is necessary in
- complaint (&symfile_complaints,
- _("guessed tag type of %s incorrectly"), arg1);
+ complaint (_("guessed tag type of %s incorrectly"), arg1);
- complaint (&symfile_complaints, _("bad rfd entry for %s: file %d, index %d"),
+ complaint (_("bad rfd entry for %s: file %d, index %d"),
/* Forward declarations. */
static int upgrade_type (int, struct type **, int, union aux_ext *,
/* Forward declarations. */
static int upgrade_type (int, struct type **, int, union aux_ext *,
static int has_opaque_xref (FDR *, SYMR *);
static int cross_ref (int, union aux_ext *, struct type **, enum type_code,
static int has_opaque_xref (FDR *, SYMR *);
static int cross_ref (int, union aux_ext *, struct type **, enum type_code,
static struct type *new_type (char *);
enum block_type { FUNCTION_BLOCK, NON_FUNCTION_BLOCK };
static struct type *new_type (char *);
enum block_type { FUNCTION_BLOCK, NON_FUNCTION_BLOCK };
static struct blockvector *new_bvect (int);
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
static struct blockvector *new_bvect (int);
static struct type *parse_type (int, union aux_ext *, unsigned int, int *,
domain_enum, enum address_class);
static void sort_blocks (struct symtab *);
domain_enum, enum address_class);
static void sort_blocks (struct symtab *);
static void psymtab_to_symtab_1 (struct objfile *objfile,
struct partial_symtab *, const char *);
static void psymtab_to_symtab_1 (struct objfile *objfile,
struct partial_symtab *, const char *);
static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
CORE_ADDR);
static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
CORE_ADDR);
\f
/* Exported procedure: Builds a symtab from the partial symtab SELF.
Restores the environment in effect when SELF was created, delegates
\f
/* Exported procedure: Builds a symtab from the partial symtab SELF.
Restores the environment in effect when SELF was created, delegates
-mdebug_build_psymtabs (struct objfile *objfile,
+mdebug_build_psymtabs (minimal_symbol_reader &reader,
+ struct objfile *objfile,
const struct ecoff_debug_swap *swap,
struct ecoff_debug_info *info)
{
const struct ecoff_debug_swap *swap,
struct ecoff_debug_info *info)
{
- info->fdr = (FDR *) obstack_alloc (&objfile->objfile_obstack,
- (info->symbolic_header.ifdMax
- * sizeof (FDR)));
+ info->fdr = (FDR *) XOBNEWVEC (&objfile->objfile_obstack, FDR,
+ info->symbolic_header.ifdMax);
- p = ((struct mdebug_pending *)
- obstack_alloc (&mdebugread_objfile->objfile_obstack,
- sizeof (struct mdebug_pending)));
+ p = XOBNEW (&mdebugread_objfile->objfile_obstack, mdebug_pending);
- complaint (&symfile_complaints,
- _("bad register number %d (max %d) in symbol %s"),
+ complaint (_("bad register number %d (max %d) in symbol %s"),
static void
add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend,
struct symbol *s, int aclass_index, struct block *b,
static void
add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend,
struct symbol *s, int aclass_index, struct block *b,
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
- complaint (&symfile_complaints,
- _("unknown symbol type 0x%x"), sh->st);
+ complaint (_("unknown symbol type 0x%x"), sh->st);
(.Fxx or .xxfake or empty) for unnamed struct/union/enums.
Alpha cc puts out an sh->iss of zero for those. */
if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
(.Fxx or .xxfake or empty) for unnamed struct/union/enums.
Alpha cc puts out an sh->iss of zero for those. */
if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
BLOCK_START (b) = sh->value + top_stack->procadr;
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
top_stack->cur_block = b;
BLOCK_START (b) = sh->value + top_stack->procadr;
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
top_stack->cur_block = b;
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->builtin_void;
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
SYMBOL_TYPE (s) = objfile_type (mdebugread_objfile)->builtin_void;
- e = ((struct mdebug_extra_func_info *)
- obstack_alloc (&mdebugread_objfile->objfile_obstack,
- sizeof (struct mdebug_extra_func_info)));
- memset (e, 0, sizeof (struct mdebug_extra_func_info));
+ e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
+ mdebug_extra_func_info);
- complaint (&symfile_complaints,
- _("stEnd with storage class %d not handled"), sh->sc);
+ complaint (_("stEnd with storage class %d not handled"), sh->sc);
case btChar:
tp = init_integer_type (objfile, 8, 0, "char");
case btChar:
tp = init_integer_type (objfile, 8, 0, "char");
- tp = init_type (objfile, TYPE_CODE_STRING, 1, "string");
+ tp = init_type (objfile, TYPE_CODE_STRING, TARGET_CHAR_BIT, "string");
static struct type *
parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
static struct type *
parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
- complaint (&symfile_complaints,
- _("can't handle TIR fBitfield for %s"),
+ complaint (_("can't handle TIR fBitfield for %s"),
- complaint (&symfile_complaints,
- _("unable to cross ref btIndirect for %s"), sym_name);
+ complaint (_("unable to cross ref btIndirect for %s"), sym_name);
return basic_type (btInt, mdebugread_objfile);
}
xref_fh = get_rfd (fd, rf);
return basic_type (btInt, mdebugread_objfile);
}
xref_fh = get_rfd (fd, rf);
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
/* Do not set the tag name if it is a compiler generated tag name
(.Fxx or .xxfake or empty) for unnamed struct/union/enums. */
if (name[0] == '.' || name[0] == '\0')
/* Do not set the tag name if it is a compiler generated tag name
(.Fxx or .xxfake or empty) for unnamed struct/union/enums. */
if (name[0] == '.' || name[0] == '\0')
- TYPE_TAG_NAME (tp) = NULL;
- else if (TYPE_TAG_NAME (tp) == NULL
- || strcmp (TYPE_TAG_NAME (tp), name) != 0)
- TYPE_TAG_NAME (tp)
+ TYPE_NAME (tp) = NULL;
+ else if (TYPE_NAME (tp) == NULL
+ || strcmp (TYPE_NAME (tp), name) != 0)
+ TYPE_NAME (tp)
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
/* Try to cross reference this type, it should succeed. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
if (tp == (struct type *) NULL)
{
/* Try to cross reference this type, it should succeed. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
if (tp == (struct type *) NULL)
{
- complaint (&symfile_complaints,
- _("unable to cross ref btTypedef for %s"), sym_name);
+ complaint (_("unable to cross ref btTypedef for %s"), sym_name);
- complaint (&symfile_complaints,
- _("illegal TIR continued for %s"), sym_name);
+ complaint (_("illegal TIR continued for %s"), sym_name);
static int
upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
static int
upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
- complaint (&symfile_complaints,
- _("illegal array index type for %s, assuming int"),
+ complaint (_("illegal array index type for %s, assuming int"),
- complaint (&symfile_complaints,
- _("can't handle PDR for static proc at 0x%lx"),
+ complaint (_("can't handle PDR for static proc at 0x%lx"),
- complaint (&symfile_complaints, _("PDR for %s, but no symbol"), sh_name);
+ complaint (_("PDR for %s, but no symbol"), sh_name);
- complaint (&symfile_complaints,
- _("guessed size of linetable for %s incorrectly"),
+ complaint (_("guessed size of linetable for %s incorrectly"),
-record_minimal_symbol (const char *name, const CORE_ADDR address,
+record_minimal_symbol (minimal_symbol_reader &reader,
+ const char *name, const CORE_ADDR address,
- prim_record_minimal_symbol_and_info (name, address, ms_type,
- section, objfile);
+ reader.record_with_info (name, address, ms_type, section);
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
/* Index within current psymtab dependency list. */
struct partial_symtab **dependency_list;
int dependencies_used, dependencies_allocated;
/* Index within current psymtab dependency list. */
struct partial_symtab **dependency_list;
int dependencies_used, dependencies_allocated;
- extern_tab = (EXTR *) obstack_alloc (&objfile->objfile_obstack,
- sizeof (EXTR) * hdr->iextMax);
+ extern_tab = XOBNEWVEC (&objfile->objfile_obstack, EXTR, hdr->iextMax);
/* Allocate the map FDR -> PST.
Minor hack: -O3 images might claim some global data belongs
to FDR -1. We`ll go along with that. */
/* Allocate the map FDR -> PST.
Minor hack: -O3 images might claim some global data belongs
to FDR -1. We`ll go along with that. */
- fdr_to_pst = XCNEWVEC (struct pst_map, hdr->ifdMax + 1);
- old_chain = make_cleanup (xfree, fdr_to_pst);
+ gdb::def_vector<struct pst_map> fdr_to_pst_holder (hdr->ifdMax + 1);
+ fdr_to_pst = fdr_to_pst_holder.data ();
- pending_list =
- ((struct mdebug_pending **)
- obstack_alloc (&objfile->objfile_obstack,
- hdr->ifdMax * sizeof (struct mdebug_pending *)));
+ pending_list = XOBNEWVEC (&objfile->objfile_obstack, mdebug_pending *,
+ hdr->ifdMax);
ext_out = (char *) debug_info->external_ext;
ext_out_end = ext_out + hdr->iextMax * external_ext_size;
ext_out = (char *) debug_info->external_ext;
ext_out_end = ext_out + hdr->iextMax * external_ext_size;
for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
(*swap_ext_in) (cur_bfd, ext_out, ext_in);
/* Pass 1 over external syms: Presize and partition the list. */
for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
(*swap_ext_in) (cur_bfd, ext_out, ext_in);
/* Pass 1 over external syms: Presize and partition the list. */
- complaint (&symfile_complaints,
- _("bad ifd for external symbol: %d (max %ld)"),
+ complaint (_("bad ifd for external symbol: %d (max %ld)"),
ext_in->ifd, hdr->ifdMax);
continue;
}
if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
{
ext_in->ifd, hdr->ifdMax);
continue;
}
if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
{
- complaint (&symfile_complaints,
- _("bad iss for external symbol: %ld (max %ld)"),
+ complaint (_("bad iss for external symbol: %ld (max %ld)"),
- record_minimal_symbol (name, svalue, ms_type, ext_in->asym.sc,
+ record_minimal_symbol (reader, name, svalue, ms_type, ext_in->asym.sc,
- objfile->global_psymbols.next,
- objfile->static_psymbols.next);
- pst->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
- sizeof (struct symloc));
+ objfile->global_psymbols,
+ objfile->static_psymbols);
+ pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc);
/* For stabs-in-ecoff files, the second symbol must be @stab.
This symbol is emitted by mips-tfile to signal that the
/* For stabs-in-ecoff files, the second symbol must be @stab.
This symbol is emitted by mips-tfile to signal that the
- record_minimal_symbol (namestring, sh.value,
+ record_minimal_symbol (reader, namestring, sh.value,
- && (pst->textlow == 0 || procaddr < pst->textlow))
- pst->textlow = procaddr;
- if (high > pst->texthigh)
- pst->texthigh = high;
+ && (pst->text_low () == 0
+ || procaddr < pst->text_low ()))
+ pst->set_text_low (procaddr);
+ if (high > pst->text_high ())
+ pst->set_text_high (high);
- record_minimal_symbol (namestring, sh.value,
+ record_minimal_symbol (reader, namestring, sh.value,
/* FIXME! Shouldn't this use cases for bss,
then have the default be abs? */
namestring = debug_info->ss + fh->issBase + sh.iss;
/* FIXME! Shouldn't this use cases for bss,
then have the default be abs? */
namestring = debug_info->ss + fh->issBase + sh.iss;
- record_minimal_symbol (namestring, sh.value,
+ record_minimal_symbol (reader, namestring, sh.value,
/* Standard, external, non-debugger, symbols. */
/* Standard, external, non-debugger, symbols. */
- complaint (&symfile_complaints,
- _("unknown symbol descriptor `%c'"), p[1]);
+ complaint (_("unknown symbol descriptor `%c'"), p[1]);
- symbol table. dbx_end_psymtab will set
- pst->texthigh to the proper value, which is
- necessary if a module compiled without
+ symbol table. dbx_end_psymtab will set the
+ high text address of PST to the proper value,
+ which is necessary if a module compiled without
default:
/* If we haven't found it yet, ignore it. It's
probably some new type we don't know about yet. */
default:
/* If we haven't found it yet, ignore it. It's
probably some new type we don't know about yet. */
- complaint (&symfile_complaints,
- _("unknown symbol type %s"),
+ complaint (_("unknown symbol type %s"),
- prim_record_minimal_symbol_and_info (name, minsym_value,
- mst_file_text,
- SECT_OFF_TEXT (objfile),
- objfile);
+ reader.record_with_info (name, minsym_value,
+ mst_file_text,
+ SECT_OFF_TEXT (objfile));
- complaint (&symfile_complaints,
- _("bad proc end in aux found from symbol %s"),
+ complaint (_("bad proc end in aux found from symbol %s"),
- && (pst->textlow == 0 || procaddr < pst->textlow))
- pst->textlow = procaddr;
+ && (pst->text_low () == 0
+ || procaddr < pst->text_low ()))
+ pst->set_text_low (procaddr);
- prim_record_minimal_symbol_and_info (name, minsym_value,
- mst_file_data,
- SECT_OFF_DATA (objfile),
- objfile);
+ reader.record_with_info (name, minsym_value,
+ mst_file_data,
+ SECT_OFF_DATA (objfile));
- prim_record_minimal_symbol_and_info (name, minsym_value,
- mst_file_bss,
- SECT_OFF_BSS (objfile),
- objfile);
+ reader.record_with_info (name, minsym_value,
+ mst_file_bss,
+ SECT_OFF_BSS (objfile));
- complaint (&symfile_complaints,
- _("bad aux index at block symbol %s"), name);
+ complaint (_("bad aux index at block symbol %s"), name);
default:
/* Both complaints are valid: one gives symbol name,
the other the offending symbol type. */
default:
/* Both complaints are valid: one gives symbol name,
the other the offending symbol type. */
fdr_to_pst[f_idx].pst
= dbx_end_psymtab (objfile, save_pst,
psymtab_include_list, includes_used,
fdr_to_pst[f_idx].pst
= dbx_end_psymtab (objfile, save_pst,
psymtab_include_list, includes_used,
&& !(objfile->flags & OBJF_REORDERED))
{
ALL_OBJFILE_PSYMTABS (objfile, pst)
{
if (save_pst != pst
&& !(objfile->flags & OBJF_REORDERED))
{
ALL_OBJFILE_PSYMTABS (objfile, pst)
{
if (save_pst != pst
- && save_pst->textlow >= pst->textlow
- && save_pst->textlow < pst->texthigh
- && save_pst->texthigh > pst->texthigh)
+ && save_pst->text_low () >= pst->text_low ()
+ && save_pst->text_low () < pst->text_high ()
+ && save_pst->text_high () > pst->text_high ())
/* Skip the first file indirect entry as it is a self dependency for
source files or a reverse .h -> .c dependency for header files. */
pst->number_of_dependencies = 0;
/* Skip the first file indirect entry as it is a self dependency for
source files or a reverse .h -> .c dependency for header files. */
pst->number_of_dependencies = 0;
- pst->dependencies =
- ((struct partial_symtab **)
- obstack_alloc (&objfile->objfile_obstack,
- ((fh->crfd - 1)
- * sizeof (struct partial_symtab *))));
+ pst->dependencies = XOBNEWVEC (&objfile->objfile_obstack,
+ partial_symtab *, (fh->crfd - 1));
&& objfile->psymtabs->n_global_syms == 0
&& objfile->psymtabs->n_static_syms == 0)
objfile->psymtabs = NULL;
&& objfile->psymtabs->n_global_syms == 0
&& objfile->psymtabs->n_static_syms == 0)
objfile->psymtabs = NULL;
/* We should never get non N_STAB symbols here, but they
should be harmless, so keep process_one_symbol from
/* We should never get non N_STAB symbols here, but they
should be harmless, so keep process_one_symbol from
{
last_symtab_ended = 0;
process_one_symbol (type_code, 0, valu, name,
{
last_symtab_ended = 0;
process_one_symbol (type_code, 0, valu, name,
}
}
/* Similarly a hack. */
else if (name[0] == '#')
{
process_one_symbol (N_SLINE, 0, valu, name,
}
}
/* Similarly a hack. */
else if (name[0] == '#')
{
process_one_symbol (N_SLINE, 0, valu, name,
- struct mdebug_extra_func_info *e =
- ((struct mdebug_extra_func_info *)
- obstack_alloc (&mdebugread_objfile->objfile_obstack,
- sizeof (struct mdebug_extra_func_info)));
+ mdebug_extra_func_info *e
+ = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
+ mdebug_extra_func_info);
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_void;
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
e->pdr.framereg = -1;
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_ACLASS_INDEX (s) = LOC_CONST;
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_void;
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
e->pdr.framereg = -1;
/* Handle encoded stab line number. */
valu += ANOFFSET (section_offsets,
SECT_OFF_TEXT (objfile));
/* Handle encoded stab line number. */
valu += ANOFFSET (section_offsets,
SECT_OFF_TEXT (objfile));
- complaint (&symfile_complaints,
- _("unknown stabs symbol %s"), name);
+ complaint (_("unknown stabs symbol %s"), name);
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
lowest_pdr_addr = pdr_in->adr;
else if (pdr_in->adr < lowest_pdr_addr)
lowest_pdr_addr = pdr_in->adr;
}
lowest_pdr_addr = pdr_in->adr;
else if (pdr_in->adr < lowest_pdr_addr)
lowest_pdr_addr = pdr_in->adr;
}
pdr_in_end = pdr_in + fh->cpd;
for (; pdr_in < pdr_in_end; pdr_in++)
parse_procedure (pdr_in, cust, pst);
pdr_in_end = pdr_in + fh->cpd;
for (; pdr_in < pdr_in_end; pdr_in++)
parse_procedure (pdr_in, cust, pst);
top_stack->cur_st = COMPUNIT_FILETABS (cust);
top_stack->cur_block
= BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
top_stack->cur_st = COMPUNIT_FILETABS (cust);
top_stack->cur_block
= BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
pdr_ptr = ((char *) debug_info->external_pdr
+ fh->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
lowest_pdr_addr = pdr_in->adr;
else if (pdr_in->adr < lowest_pdr_addr)
lowest_pdr_addr = pdr_in->adr;
}
lowest_pdr_addr = pdr_in->adr;
else if (pdr_in->adr < lowest_pdr_addr)
lowest_pdr_addr = pdr_in->adr;
}
- parse_lines (fh, pr_block, lines, maxlines,
+ parse_lines (fh, pr_block.data (), lines, maxlines,
pst, lowest_pdr_addr);
if (lines->nitems < fh->cline)
lines = shrink_linetable (lines);
/* Fill in procedure info next. */
pst, lowest_pdr_addr);
if (lines->nitems < fh->cline)
lines = shrink_linetable (lines);
/* Fill in procedure info next. */
pdr_in_end = pdr_in + fh->cpd;
for (; pdr_in < pdr_in_end; pdr_in++)
parse_procedure (pdr_in, NULL, pst);
pdr_in_end = pdr_in + fh->cpd;
for (; pdr_in < pdr_in_end; pdr_in++)
parse_procedure (pdr_in, NULL, pst);
cross_ref (int fd, union aux_ext *ax, struct type **tpp,
enum type_code type_code,
/* Use to alloc new type if none is found. */
cross_ref (int fd, union aux_ext *ax, struct type **tpp,
enum type_code type_code,
/* Use to alloc new type if none is found. */
- complaint (&symfile_complaints,
- _("illegal tq0 in forward typedef for %s"), sym_name);
+ complaint (_("illegal tq0 in forward typedef for %s"), sym_name);
- complaint (&symfile_complaints,
- _("illegal bt %d in forward typedef for %s"), tir.bt,
+ complaint (_("illegal bt %d in forward typedef for %s"), tir.bt,
sym_name);
*tpp = init_type (mdebugread_objfile, type_code, 0, NULL);
break;
sym_name);
*tpp = init_type (mdebugread_objfile, type_code, 0, NULL);
break;
domain_enum domain, enum address_class theclass)
{
struct block_iterator iter;
domain_enum domain, enum address_class theclass)
{
struct block_iterator iter;
add_compunit_symtab_to_objfile (cust);
symtab = allocate_symtab (cust, name);
SYMTAB_LINETABLE (symtab) = new_linetable (maxlines);
add_compunit_symtab_to_objfile (cust);
symtab = allocate_symtab (cust, name);
SYMTAB_LINETABLE (symtab) = new_linetable (maxlines);
- BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK);
- BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK);
+ BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK, lang);
+ BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK, lang);
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
COMPUNIT_BLOCKVECTOR (cust) = bv;
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
COMPUNIT_BLOCKVECTOR (cust) = bv;
- psymtab->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
- sizeof (struct symloc));
- memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
+ psymtab->read_symtab_private
+ = OBSTACK_ZALLOC (&objfile->objfile_obstack, symloc);
CUR_BFD (psymtab) = cur_bfd;
DEBUG_SWAP (psymtab) = debug_swap;
DEBUG_INFO (psymtab) = debug_info;
CUR_BFD (psymtab) = cur_bfd;
DEBUG_SWAP (psymtab) = debug_swap;
DEBUG_INFO (psymtab) = debug_info;
-/* Allocate and zero a new block, and set its BLOCK_DICT. If function
- is non-zero, assume the block is associated to a function, and make
- sure that the symbols are stored linearly; otherwise, store them
- hashed. */
+/* Allocate and zero a new block of language LANGUAGE, and set its
+ BLOCK_DICT. If function is non-zero, assume the block is
+ associated to a function, and make sure that the symbols are stored
+ linearly; otherwise, store them hashed. */
{
/* FIXME: carlton/2003-09-11: This should use allocate_block to
allocate the block. Which, in turn, suggests that the block
{
/* FIXME: carlton/2003-09-11: This should use allocate_block to
allocate the block. Which, in turn, suggests that the block
/* FIXME: It's not clear whether we should be getting minimal symbol
information from .mdebug in an ELF file, or whether we will.
Re-initialize the minimal symbol reader in case we do. */
/* FIXME: It's not clear whether we should be getting minimal symbol
information from .mdebug in an ELF file, or whether we will.
Re-initialize the minimal symbol reader in case we do. */
- info = ((struct ecoff_debug_info *)
- obstack_alloc (&objfile->objfile_obstack,
- sizeof (struct ecoff_debug_info)));
+ info = XOBNEW (&objfile->objfile_obstack, ecoff_debug_info);
if (!(*swap->read_debug_info) (abfd, sec, info))
error (_("Error reading ECOFF debugging information: %s"),
bfd_errmsg (bfd_get_error ()));
if (!(*swap->read_debug_info) (abfd, sec, info))
error (_("Error reading ECOFF debugging information: %s"),
bfd_errmsg (bfd_get_error ()));
- mdebug_build_psymtabs (objfile, swap, info);
+ mdebug_build_psymtabs (reader, objfile, swap, info);