init_header_files ();
/* Make sure all the FDR information is swapped in. */
- if (info->fdr == (FDR *) NULL)
+ if (info->fdr == NULL)
{
char *fdr_src;
char *fdr_end;
objfile->name);
printf_unfiltered (_("You should compile with -g2 or "
"-g3 for best debugging support.\n"));
- gdb_flush (gdb_stdout);
}
#endif
}
long svalue = sh->value;
int bitsize;
- if (ext_sh == (char *) NULL)
+ if (ext_sh == NULL)
name = debug_info->ssext + sh->iss;
else
name = debug_info->ss + cur_fdr->issBase + sh->iss;
/* Create a new type or use the pending type. */
pend = is_pending_symbol (cur_fdr, ext_sh);
- if (pend == (struct mdebug_pending *) NULL)
+ if (pend == NULL)
{
t = new_type (NULL);
add_pending (cur_fdr, ext_sh, t);
enum_sym = allocate_symbol (mdebugread_objfile);
SYMBOL_SET_LINKAGE_NAME
(enum_sym,
- (char *) obstack_copy0 (&mdebugread_objfile->objfile_obstack,
- f->name, strlen (f->name)));
+ obstack_strdup (&mdebugread_objfile->objfile_obstack,
+ f->name));
SYMBOL_ACLASS_INDEX (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
/* Parse the type or use the pending type. */
pend = is_pending_symbol (cur_fdr, ext_sh);
- if (pend == (struct mdebug_pending *) NULL)
+ if (pend == NULL)
{
- t = parse_type (cur_fd, ax, sh->index, (int *) NULL, bigend, name);
+ t = parse_type (cur_fd, ax, sh->index, NULL, bigend, name);
add_pending (cur_fdr, ext_sh, t);
}
else
/* Basic types. */
-static const struct objfile_data *basic_type_data;
+static const struct objfile_key<struct type *,
+ gdb::noop_deleter<struct type *>>
+ basic_type_data;
static struct type *
basic_type (int bt, struct objfile *objfile)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct type **map_bt
- = (struct type **) objfile_data (objfile, basic_type_data);
+ struct type **map_bt = basic_type_data.get (objfile);
struct type *tp;
if (bt >= btMax)
{
map_bt = OBSTACK_CALLOC (&objfile->objfile_obstack,
btMax, struct type *);
- set_objfile_data (objfile, basic_type_data, map_bt);
+ basic_type_data.set (objfile, map_bt);
}
if (map_bt[bt])
int width = AUX_GET_WIDTH (bigend, ax);
/* Inhibit core dumps if TIR is corrupted. */
- if (bs == (int *) NULL)
+ if (bs == NULL)
{
/* Alpha cc -migrate encodes char and unsigned char types
as short and unsigned short types with a field width of 8.
xref_fh = get_rfd (fd, rf);
xref_fd = xref_fh - debug_info->fdr;
tp = parse_type (xref_fd, debug_info->external_aux + xref_fh->iauxBase,
- rn->index, (int *) NULL, xref_fh->fBigendian, sym_name);
+ rn->index, NULL, xref_fh->fBigendian, sym_name);
}
/* All these types really point to some (common) MIPS type
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
- if (tp == (struct type *) NULL)
+ if (tp == NULL)
tp = init_type (mdebugread_objfile, type_code, 0, NULL);
/* DEC c89 produces cross references to qualified aggregate types,
else if (TYPE_NAME (tp) == NULL
|| strcmp (TYPE_NAME (tp), name) != 0)
TYPE_NAME (tp)
- = ((const char *)
- obstack_copy0 (&mdebugread_objfile->objfile_obstack,
- name, strlen (name)));
+ = obstack_strdup (&mdebugread_objfile->objfile_obstack, name);
}
}
/* Try to cross reference this type, build new type on failure. */
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
- if (tp == (struct type *) NULL)
+ if (tp == NULL)
tp = init_type (mdebugread_objfile, type_code, 0, NULL);
/* Make sure that TYPE_CODE(tp) has an expected type code.
if (TYPE_NAME (tp) == NULL
|| strcmp (TYPE_NAME (tp), name) != 0)
TYPE_NAME (tp)
- = ((const char *)
- obstack_copy0 (&mdebugread_objfile->objfile_obstack,
- name, strlen (name)));
+ = obstack_strdup (&mdebugread_objfile->objfile_obstack, name);
}
}
if (t->bt == btTypedef)
/* 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)
+ if (tp == NULL)
{
complaint (_("unable to cross ref btTypedef for %s"), sym_name);
tp = basic_type (btInt, mdebugread_objfile);
indx = parse_type (fh - debug_info->fdr,
debug_info->external_aux + fh->iauxBase,
- id, (int *) NULL, bigend, sym_name);
+ id, NULL, bigend, sym_name);
/* The bounds type should be an integer type, but might be anything
else due to corrupt aux entries. */
ax++;
rf = AUX_GET_WIDTH (bigend, ax); /* bit size of array element */
- range = create_static_range_type ((struct type *) NULL, indx,
- lower, upper);
+ range = create_static_range_type (NULL, indx, lower, upper);
- t = create_array_type ((struct type *) NULL, *tpp, range);
+ t = create_array_type (NULL, *tpp, range);
/* We used to fill in the supplied array element bitsize
here if the TYPE_LENGTH of the target type was zero.
/* Note that the case of a symbol with indexNil must be handled
anyways by parse_symbol(). */
- parse_symbol (&es->asym, ax, (char *) NULL,
+ parse_symbol (&es->asym, ax, NULL,
bigend, section_offsets, objfile);
break;
default:
the text section (and fh->adr) really starts at zero. */
text_sect = bfd_get_section_by_name (cur_bfd, ".text");
if (text_sect != NULL
- && (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
+ && (bfd_section_flags (text_sect) & SEC_RELOC))
relocatable = 1;
extern_tab = XOBNEWVEC (&objfile->objfile_obstack, EXTR, hdr->iextMax);
namestring = gdbarch_static_transform_name
(gdbarch, namestring);
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
/* The addresses in these entries are reported
to be wrong. See the code that reads 'G's
for symtabs. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
STRUCT_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring,
- p - namestring, 1,
+ p - namestring, true,
VAR_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
if (p != namestring) /* a name is there, not
just :T... */
{
- add_psymbol_to_list (namestring, p - namestring, 1,
- VAR_DOMAIN, LOC_TYPEDEF,
+ add_psymbol_to_list (namestring, p - namestring,
+ true, VAR_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
/* Note that the value doesn't matter for
enum constants in psymtabs, just in
symtabs. */
- add_psymbol_to_list (p, q - p, 1,
+ add_psymbol_to_list (p, q - p, true,
VAR_DOMAIN, LOC_CONST,
-1,
psymbol_placement::STATIC,
continue;
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
function_outside_compilation_unit_complaint
(copy.c_str ());
}
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
function_outside_compilation_unit_complaint
(copy.c_str ());
}
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
symbol table, and the MAIN__ symbol via the minimal
symbol table. */
if (sh.st == stProc)
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::GLOBAL,
sh.value, psymtab_language, objfile);
else
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::STATIC,
&& sh.iss != 0
&& sh.index != cur_sdx + 2)
{
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
continue;
}
/* Use this gdb symbol. */
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, theclass, section,
psymbol_placement::STATIC,
sh.value, psymtab_language, objfile);
break;
}
char *sym_name = debug_info->ssext + psh->iss;
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, theclass,
section,
psymbol_placement::GLOBAL,
fh = f_idx + debug_info->fdr;
pst = fdr_to_pst[f_idx].pst;
- if (pst == (struct partial_symtab *) NULL)
+ if (pst == NULL)
continue;
/* This should catch stabs-in-ecoff. */
continue;
/* Do not add to dependeny list if psymtab was empty. */
- if (fdr_to_pst[rh].pst == (struct partial_symtab *) NULL)
+ if (fdr_to_pst[rh].pst == NULL)
continue;
pst->dependencies[pst->number_of_dependencies++]
= fdr_to_pst[rh].pst;
/* Note that the value doesn't matter for enum constants
in psymtabs, just in symtabs. */
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (name, strlen (name), true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC, 0,
psymtab_language, objfile);
mdebugread_objfile = objfile;
cur_fd = FDR_IDX (pst);
fh = ((cur_fd == -1)
- ? (FDR *) NULL
+ ? NULL
: debug_info->fdr + cur_fd);
cur_fdr = fh;
/* See comment in parse_partial_symbols about the @stabs sentinel. */
processing_gcc_compilation = 0;
- if (fh != (FDR *) NULL && fh->csym >= 2)
+ if (fh != NULL && fh->csym >= 2)
{
SYMR sh;
*tpp = parse_type (xref_fd,
debug_info->external_aux + fh->iauxBase,
sh.index,
- (int *) NULL,
+ NULL,
fh->fBigendian,
debug_info->ss + fh->issBase + sh.iss);
add_pending (fh, esh, *tpp);
*tpp = parse_type (xref_fd,
debug_info->external_aux + fh->iauxBase,
sh.index,
- (int *) NULL,
+ NULL,
fh->fBigendian,
debug_info->ss + fh->issBase + sh.iss);
}
void
_initialize_mdebugread (void)
{
- basic_type_data = register_objfile_data ();
-
mdebug_register_index
= register_symbol_register_impl (LOC_REGISTER, &mdebug_register_funcs);
mdebug_regparm_index