Rename objfile_type to builtin_type

This renames objfile_type to be an overload of builtin_type, in
preparation for their unification.

Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-03-11 09:39:58 -07:00
parent 426e5b66a7
commit a8ed3dde83
13 changed files with 82 additions and 82 deletions

View File

@@ -1779,7 +1779,7 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
*dim = 0; *dim = 0;
base_type = decode_type (cs, new_c_type, aux, objfile); base_type = decode_type (cs, new_c_type, aux, objfile);
index_type = objfile_type (objfile)->builtin_int; index_type = builtin_type (objfile)->builtin_int;
type_allocator alloc (objfile); type_allocator alloc (objfile);
range_type range_type
= create_static_range_type (alloc, index_type, 0, n - 1); = create_static_range_type (alloc, index_type, 0, n - 1);
@@ -1846,39 +1846,39 @@ decode_base_type (struct coff_symbol *cs,
{ {
case T_NULL: case T_NULL:
/* Shows up with "void (*foo)();" structure members. */ /* Shows up with "void (*foo)();" structure members. */
return objfile_type (objfile)->builtin_void; return builtin_type (objfile)->builtin_void;
#ifdef T_VOID #ifdef T_VOID
case T_VOID: case T_VOID:
/* Intel 960 COFF has this symbol and meaning. */ /* Intel 960 COFF has this symbol and meaning. */
return objfile_type (objfile)->builtin_void; return builtin_type (objfile)->builtin_void;
#endif #endif
case T_CHAR: case T_CHAR:
return objfile_type (objfile)->builtin_char; return builtin_type (objfile)->builtin_char;
case T_SHORT: case T_SHORT:
return objfile_type (objfile)->builtin_short; return builtin_type (objfile)->builtin_short;
case T_INT: case T_INT:
return objfile_type (objfile)->builtin_int; return builtin_type (objfile)->builtin_int;
case T_LONG: case T_LONG:
if (cs->c_sclass == C_FIELD if (cs->c_sclass == C_FIELD
&& aux->x_sym.x_misc.x_lnsz.x_size && aux->x_sym.x_misc.x_lnsz.x_size
> gdbarch_long_bit (gdbarch)) > gdbarch_long_bit (gdbarch))
return objfile_type (objfile)->builtin_long_long; return builtin_type (objfile)->builtin_long_long;
else else
return objfile_type (objfile)->builtin_long; return builtin_type (objfile)->builtin_long;
case T_FLOAT: case T_FLOAT:
return objfile_type (objfile)->builtin_float; return builtin_type (objfile)->builtin_float;
case T_DOUBLE: case T_DOUBLE:
return objfile_type (objfile)->builtin_double; return builtin_type (objfile)->builtin_double;
case T_LNGDBL: case T_LNGDBL:
return objfile_type (objfile)->builtin_long_double; return builtin_type (objfile)->builtin_long_double;
case T_STRUCT: case T_STRUCT:
if (cs->c_naux != 1) if (cs->c_naux != 1)
@@ -1947,24 +1947,24 @@ decode_base_type (struct coff_symbol *cs,
break; break;
case T_UCHAR: case T_UCHAR:
return objfile_type (objfile)->builtin_unsigned_char; return builtin_type (objfile)->builtin_unsigned_char;
case T_USHORT: case T_USHORT:
return objfile_type (objfile)->builtin_unsigned_short; return builtin_type (objfile)->builtin_unsigned_short;
case T_UINT: case T_UINT:
return objfile_type (objfile)->builtin_unsigned_int; return builtin_type (objfile)->builtin_unsigned_int;
case T_ULONG: case T_ULONG:
if (cs->c_sclass == C_FIELD if (cs->c_sclass == C_FIELD
&& aux->x_sym.x_misc.x_lnsz.x_size && aux->x_sym.x_misc.x_lnsz.x_size
> gdbarch_long_bit (gdbarch)) > gdbarch_long_bit (gdbarch))
return objfile_type (objfile)->builtin_unsigned_long_long; return builtin_type (objfile)->builtin_unsigned_long_long;
else else
return objfile_type (objfile)->builtin_unsigned_long; return builtin_type (objfile)->builtin_unsigned_long;
} }
complaint (_("Unexpected type for symbol %s"), cs->c_name); complaint (_("Unexpected type for symbol %s"), cs->c_name);
return objfile_type (objfile)->builtin_void; return builtin_type (objfile)->builtin_void;
} }
/* This page contains subroutines of read_type. */ /* This page contains subroutines of read_type. */

View File

@@ -279,12 +279,12 @@ convert_symbol_bmsym (compile_c_instance *context,
case mst_text: case mst_text:
case mst_file_text: case mst_file_text:
case mst_solib_trampoline: case mst_solib_trampoline:
type = objfile_type (objfile)->nodebug_text_symbol; type = builtin_type (objfile)->nodebug_text_symbol;
kind = GCC_C_SYMBOL_FUNCTION; kind = GCC_C_SYMBOL_FUNCTION;
break; break;
case mst_text_gnu_ifunc: case mst_text_gnu_ifunc:
type = objfile_type (objfile)->nodebug_text_gnu_ifunc_symbol; type = builtin_type (objfile)->nodebug_text_gnu_ifunc_symbol;
kind = GCC_C_SYMBOL_FUNCTION; kind = GCC_C_SYMBOL_FUNCTION;
addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr); addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
break; break;
@@ -293,17 +293,17 @@ convert_symbol_bmsym (compile_c_instance *context,
case mst_file_data: case mst_file_data:
case mst_bss: case mst_bss:
case mst_file_bss: case mst_file_bss:
type = objfile_type (objfile)->nodebug_data_symbol; type = builtin_type (objfile)->nodebug_data_symbol;
kind = GCC_C_SYMBOL_VARIABLE; kind = GCC_C_SYMBOL_VARIABLE;
break; break;
case mst_slot_got_plt: case mst_slot_got_plt:
type = objfile_type (objfile)->nodebug_got_plt_symbol; type = builtin_type (objfile)->nodebug_got_plt_symbol;
kind = GCC_C_SYMBOL_FUNCTION; kind = GCC_C_SYMBOL_FUNCTION;
break; break;
default: default:
type = objfile_type (objfile)->nodebug_unknown_symbol; type = builtin_type (objfile)->nodebug_unknown_symbol;
kind = GCC_C_SYMBOL_VARIABLE; kind = GCC_C_SYMBOL_VARIABLE;
break; break;
} }

View File

@@ -291,14 +291,14 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
case mst_text: case mst_text:
case mst_file_text: case mst_file_text:
case mst_solib_trampoline: case mst_solib_trampoline:
type = objfile_type (objfile)->nodebug_text_symbol; type = builtin_type (objfile)->nodebug_text_symbol;
kind = GCC_CP_SYMBOL_FUNCTION; kind = GCC_CP_SYMBOL_FUNCTION;
break; break;
case mst_text_gnu_ifunc: case mst_text_gnu_ifunc:
/* nodebug_text_gnu_ifunc_symbol would cause: /* nodebug_text_gnu_ifunc_symbol would cause:
function return type cannot be function */ function return type cannot be function */
type = objfile_type (objfile)->nodebug_text_symbol; type = builtin_type (objfile)->nodebug_text_symbol;
kind = GCC_CP_SYMBOL_FUNCTION; kind = GCC_CP_SYMBOL_FUNCTION;
addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr); addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
break; break;
@@ -307,17 +307,17 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
case mst_file_data: case mst_file_data:
case mst_bss: case mst_bss:
case mst_file_bss: case mst_file_bss:
type = objfile_type (objfile)->nodebug_data_symbol; type = builtin_type (objfile)->nodebug_data_symbol;
kind = GCC_CP_SYMBOL_VARIABLE; kind = GCC_CP_SYMBOL_VARIABLE;
break; break;
case mst_slot_got_plt: case mst_slot_got_plt:
type = objfile_type (objfile)->nodebug_got_plt_symbol; type = builtin_type (objfile)->nodebug_got_plt_symbol;
kind = GCC_CP_SYMBOL_FUNCTION; kind = GCC_CP_SYMBOL_FUNCTION;
break; break;
default: default:
type = objfile_type (objfile)->nodebug_unknown_symbol; type = builtin_type (objfile)->nodebug_unknown_symbol;
kind = GCC_CP_SYMBOL_VARIABLE; kind = GCC_CP_SYMBOL_VARIABLE;
break; break;
} }

View File

@@ -410,7 +410,7 @@ ctf_add_member_cb (const char *name,
if (t == nullptr) if (t == nullptr)
{ {
complaint (_("ctf_add_member_cb: %s has NO type (%ld)"), name, tid); complaint (_("ctf_add_member_cb: %s has NO type (%ld)"), name, tid);
t = objfile_type (ccp->of)->builtin_error; t = builtin_type (ccp->of)->builtin_error;
set_tid_type (ccp->of, tid, t); set_tid_type (ccp->of, tid, t);
} }
} }
@@ -501,7 +501,7 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid)
break; break;
case CTF_K_CONST: case CTF_K_CONST:
if (sym->type ()->code () == TYPE_CODE_VOID) if (sym->type ()->code () == TYPE_CODE_VOID)
sym->set_type (objfile_type (objfile)->builtin_int); sym->set_type (builtin_type (objfile)->builtin_int);
break; break;
case CTF_K_TYPEDEF: case CTF_K_TYPEDEF:
case CTF_K_INTEGER: case CTF_K_INTEGER:
@@ -717,7 +717,7 @@ read_func_kind_type (struct ctf_context *ccp, ctf_id_t tid)
type->set_fields type->set_fields
((struct field *) TYPE_ZALLOC (type, argc * sizeof (struct field))); ((struct field *) TYPE_ZALLOC (type, argc * sizeof (struct field)));
struct type *void_type = objfile_type (of)->builtin_void; struct type *void_type = builtin_type (of)->builtin_void;
/* If failed to find the argument type, fill it with void_type. */ /* If failed to find the argument type, fill it with void_type. */
for (int iparam = 0; iparam < argc; iparam++) for (int iparam = 0; iparam < argc; iparam++)
{ {
@@ -829,7 +829,7 @@ read_array_type (struct ctf_context *ccp, ctf_id_t tid)
idx_type = fetch_tid_type (ccp, ar.ctr_index); idx_type = fetch_tid_type (ccp, ar.ctr_index);
if (idx_type == nullptr) if (idx_type == nullptr)
idx_type = objfile_type (objfile)->builtin_int; idx_type = builtin_type (objfile)->builtin_int;
type_allocator alloc (objfile); type_allocator alloc (objfile);
range_type = create_static_range_type (alloc, idx_type, 0, ar.ctr_nelems - 1); range_type = create_static_range_type (alloc, idx_type, 0, ar.ctr_nelems - 1);
@@ -863,7 +863,7 @@ read_const_type (struct ctf_context *ccp, ctf_id_t tid, ctf_id_t btid)
if (base_type == nullptr) if (base_type == nullptr)
{ {
complaint (_("read_const_type: NULL base type (%ld)"), btid); complaint (_("read_const_type: NULL base type (%ld)"), btid);
base_type = objfile_type (objfile)->builtin_error; base_type = builtin_type (objfile)->builtin_error;
} }
} }
cv_type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0); cv_type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0);
@@ -887,7 +887,7 @@ read_volatile_type (struct ctf_context *ccp, ctf_id_t tid, ctf_id_t btid)
if (base_type == nullptr) if (base_type == nullptr)
{ {
complaint (_("read_volatile_type: NULL base type (%ld)"), btid); complaint (_("read_volatile_type: NULL base type (%ld)"), btid);
base_type = objfile_type (objfile)->builtin_error; base_type = builtin_type (objfile)->builtin_error;
} }
} }
@@ -913,7 +913,7 @@ read_restrict_type (struct ctf_context *ccp, ctf_id_t tid, ctf_id_t btid)
if (base_type == nullptr) if (base_type == nullptr)
{ {
complaint (_("read_restrict_type: NULL base type (%ld)"), btid); complaint (_("read_restrict_type: NULL base type (%ld)"), btid);
base_type = objfile_type (objfile)->builtin_error; base_type = builtin_type (objfile)->builtin_error;
} }
} }
cv_type = make_restrict_type (base_type); cv_type = make_restrict_type (base_type);
@@ -959,7 +959,7 @@ read_pointer_type (struct ctf_context *ccp, ctf_id_t tid, ctf_id_t btid)
if (target_type == nullptr) if (target_type == nullptr)
{ {
complaint (_("read_pointer_type: NULL target type (%ld)"), btid); complaint (_("read_pointer_type: NULL target type (%ld)"), btid);
target_type = objfile_type (ccp->of)->builtin_error; target_type = builtin_type (ccp->of)->builtin_error;
} }
} }
@@ -1167,7 +1167,7 @@ ctf_add_var_cb (const char *name, ctf_id_t id, void *arg)
if (type == nullptr) if (type == nullptr)
{ {
complaint (_("ctf_add_var_cb: %s has NO type (%ld)"), name, id); complaint (_("ctf_add_var_cb: %s has NO type (%ld)"), name, id);
type = objfile_type (ccp->of)->builtin_error; type = builtin_type (ccp->of)->builtin_error;
} }
sym = new (&ccp->of->objfile_obstack) symbol; sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++); OBJSTAT (ccp->of, n_syms++);

View File

@@ -107,7 +107,7 @@ struct type *
dwarf2_cu::addr_type () const dwarf2_cu::addr_type () const
{ {
struct objfile *objfile = this->per_objfile->objfile; struct objfile *objfile = this->per_objfile->objfile;
struct type *void_type = objfile_type (objfile)->builtin_void; struct type *void_type = builtin_type (objfile)->builtin_void;
struct type *addr_type = lookup_pointer_type (void_type); struct type *addr_type = lookup_pointer_type (void_type);
int addr_size = this->per_cu->addr_size (); int addr_size = this->per_cu->addr_size ();

View File

@@ -13655,7 +13655,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
arrays with unspecified length. */ arrays with unspecified length. */
if (die->child == NULL) if (die->child == NULL)
{ {
index_type = objfile_type (objfile)->builtin_int; index_type = builtin_type (objfile)->builtin_int;
type_allocator alloc (objfile); type_allocator alloc (objfile);
range_type = create_static_range_type (alloc, index_type, 0, -1); range_type = create_static_range_type (alloc, index_type, 0, -1);
type = create_array_type_with_stride (alloc, element_type, range_type, type = create_array_type_with_stride (alloc, element_type, range_type,
@@ -14006,7 +14006,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
} }
} }
sym = new_symbol (die, objfile_type (objfile)->builtin_void, cu); sym = new_symbol (die, builtin_type (objfile)->builtin_void, cu);
sym->set_value_common_block (common_block); sym->set_value_common_block (common_block);
} }
} }
@@ -14499,7 +14499,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
length = 1; length = 1;
} }
index_type = objfile_type (objfile)->builtin_int; index_type = builtin_type (objfile)->builtin_int;
type_allocator alloc (objfile); type_allocator alloc (objfile);
if (length_is_constant) if (length_is_constant)
range_type = create_static_range_type (alloc, index_type, 1, length); range_type = create_static_range_type (alloc, index_type, 1, length);
@@ -14604,7 +14604,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
if (die->child != NULL) if (die->child != NULL)
{ {
struct type *void_type = objfile_type (objfile)->builtin_void; struct type *void_type = builtin_type (objfile)->builtin_void;
struct die_info *child_die; struct die_info *child_die;
int nparams, iparams; int nparams, iparams;
@@ -15039,7 +15039,7 @@ dwarf2_init_integer_type (struct dwarf2_cu *cu, struct objfile *objfile,
at least versions 14, 17, and 18. */ at least versions 14, 17, and 18. */
if (bits == 0 && producer_is_icc (cu) && name != nullptr if (bits == 0 && producer_is_icc (cu) && name != nullptr
&& strcmp (name, "void") == 0) && strcmp (name, "void") == 0)
type = objfile_type (objfile)->builtin_void; type = builtin_type (objfile)->builtin_void;
else else
{ {
type_allocator alloc (objfile); type_allocator alloc (objfile);
@@ -18882,7 +18882,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
} }
else else
sym->set_aclass_index (LOC_OPTIMIZED_OUT); sym->set_aclass_index (LOC_OPTIMIZED_OUT);
sym->set_type (objfile_type (objfile)->builtin_core_addr); sym->set_type (builtin_type (objfile)->builtin_core_addr);
sym->set_domain (LABEL_DOMAIN); sym->set_domain (LABEL_DOMAIN);
add_symbol_to_list (sym, cu->list_in_scope); add_symbol_to_list (sym, cu->list_in_scope);
break; break;
@@ -18925,7 +18925,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
variables with missing type entries. Change the variables with missing type entries. Change the
misleading `void' type to something sensible. */ misleading `void' type to something sensible. */
if (sym->type ()->code () == TYPE_CODE_VOID) if (sym->type ()->code () == TYPE_CODE_VOID)
sym->set_type (objfile_type (objfile)->builtin_int); sym->set_type (builtin_type (objfile)->builtin_int);
attr = dwarf2_attr (die, DW_AT_const_value, cu); attr = dwarf2_attr (die, DW_AT_const_value, cu);
/* In the case of DW_TAG_member, we should only be called for /* In the case of DW_TAG_member, we should only be called for
@@ -19392,7 +19392,7 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
{ {
struct objfile *objfile = cu->per_objfile->objfile; struct objfile *objfile = cu->per_objfile->objfile;
/* A missing DW_AT_type represents a void type. */ /* A missing DW_AT_type represents a void type. */
return objfile_type (objfile)->builtin_void; return builtin_type (objfile)->builtin_void;
} }
return lookup_die_type (die, type_attr, cu); return lookup_die_type (die, type_attr, cu);

View File

@@ -6084,7 +6084,7 @@ static const registry<objfile>::key<struct objfile_type,
objfile_type_data; objfile_type_data;
const struct objfile_type * const struct objfile_type *
objfile_type (struct objfile *objfile) builtin_type (struct objfile *objfile)
{ {
struct gdbarch *gdbarch; struct gdbarch *gdbarch;
struct objfile_type *objfile_type = objfile_type_data.get (objfile); struct objfile_type *objfile_type = objfile_type_data.get (objfile);

View File

@@ -2144,7 +2144,7 @@ struct objfile_type
/* * Return the type table for the specified objfile. */ /* * Return the type table for the specified objfile. */
extern const struct objfile_type *objfile_type (struct objfile *objfile); extern const struct objfile_type *builtin_type (struct objfile *objfile);
/* Explicit floating-point formats. See "floatformat.h". */ /* Explicit floating-point formats. See "floatformat.h". */
extern const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN]; extern const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN];

View File

@@ -570,7 +570,7 @@ add_data_symbol (SYMR *sh, union aux_ext *ax, int bigend,
/* Type could be missing if file is compiled without debugging info. */ /* Type could be missing if file is compiled without debugging info. */
if (SC_IS_UNDEF (sh->sc) if (SC_IS_UNDEF (sh->sc)
|| sh->sc == scNil || sh->index == indexNil) || sh->sc == scNil || sh->index == indexNil)
s->set_type (objfile_type (objfile)->nodebug_data_symbol); s->set_type (builtin_type (objfile)->nodebug_data_symbol);
else else
s->set_type (parse_type (cur_fd, ax, sh->index, 0, bigend, name)); s->set_type (parse_type (cur_fd, ax, sh->index, 0, bigend, name));
/* Value of a data symbol is its memory address. */ /* Value of a data symbol is its memory address. */
@@ -715,7 +715,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s->set_aclass_index (LOC_LABEL); /* but not misused. */ s->set_aclass_index (LOC_LABEL); /* but not misused. */
s->set_section_index (section_index); s->set_section_index (section_index);
s->set_value_address (sh->value); s->set_value_address (sh->value);
s->set_type (objfile_type (objfile)->builtin_int); s->set_type (builtin_type (objfile)->builtin_int);
add_symbol (s, top_stack->cur_st, top_stack->cur_block); add_symbol (s, top_stack->cur_st, top_stack->cur_block);
break; break;
@@ -758,7 +758,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s->set_section_index (section_index); s->set_section_index (section_index);
/* Type of the return value. */ /* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
t = objfile_type (objfile)->builtin_int; t = builtin_type (objfile)->builtin_int;
else else
{ {
t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name); t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
@@ -1167,7 +1167,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
s->set_domain (LABEL_DOMAIN); s->set_domain (LABEL_DOMAIN);
s->set_aclass_index (LOC_CONST); s->set_aclass_index (LOC_CONST);
s->set_type (objfile_type (mdebugread_objfile)->builtin_void); s->set_type (builtin_type (mdebugread_objfile)->builtin_void);
e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack, e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
mdebug_extra_func_info); mdebug_extra_func_info);
s->set_value_bytes ((gdb_byte *) e); s->set_value_bytes ((gdb_byte *) e);
@@ -1391,12 +1391,12 @@ basic_type (int bt, struct objfile *objfile)
switch (bt) switch (bt)
{ {
case btNil: case btNil:
tp = objfile_type (objfile)->builtin_void; tp = builtin_type (objfile)->builtin_void;
break; break;
case btAdr: case btAdr:
tp = init_pointer_type (alloc, 32, "adr_32", tp = init_pointer_type (alloc, 32, "adr_32",
objfile_type (objfile)->builtin_void); builtin_type (objfile)->builtin_void);
break; break;
case btChar: case btChar:
@@ -1470,7 +1470,7 @@ basic_type (int bt, struct objfile *objfile)
break; break;
case btVoid: case btVoid:
tp = objfile_type (objfile)->builtin_void; tp = builtin_type (objfile)->builtin_void;
break; break;
case btLong64: case btLong64:
@@ -1491,7 +1491,7 @@ basic_type (int bt, struct objfile *objfile)
case btAdr64: case btAdr64:
tp = init_pointer_type (alloc, 64, "adr_64", tp = init_pointer_type (alloc, 64, "adr_64",
objfile_type (objfile)->builtin_void); builtin_type (objfile)->builtin_void);
break; break;
case btInt64: case btInt64:
@@ -1851,7 +1851,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
{ {
complaint (_("illegal array index type for %s, assuming int"), complaint (_("illegal array index type for %s, assuming int"),
sym_name); sym_name);
indx = objfile_type (mdebugread_objfile)->builtin_int; indx = builtin_type (mdebugread_objfile)->builtin_int;
} }
/* Get the bounds, and create the array type. */ /* Get the bounds, and create the array type. */
@@ -2003,7 +2003,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
SYMBOL_CLASS (s) = LOC_BLOCK; SYMBOL_CLASS (s) = LOC_BLOCK;
/* Don't know its type, hope int is ok. */ /* Don't know its type, hope int is ok. */
s->type () s->type ()
= lookup_function_type (objfile_type (pst->objfile)->builtin_int); = lookup_function_type (builtin_type (pst->objfile)->builtin_int);
add_symbol (s, top_stack->cur_st, top_stack->cur_block); add_symbol (s, top_stack->cur_st, top_stack->cur_block);
/* Won't have symbols for this one. */ /* Won't have symbols for this one. */
b = new_block (2); b = new_block (2);
@@ -2057,7 +2057,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
if (processing_gcc_compilation == 0 if (processing_gcc_compilation == 0
&& found_ecoff_debugging_info == 0 && found_ecoff_debugging_info == 0
&& s->type ()->target_type ()->code () == TYPE_CODE_VOID) && s->type ()->target_type ()->code () == TYPE_CODE_VOID)
s->set_type (objfile_type (mdebugread_objfile)->nodebug_text_symbol); s->set_type (builtin_type (mdebugread_objfile)->nodebug_text_symbol);
} }
/* Parse the external symbol ES. Just call parse_symbol() after /* Parse the external symbol ES. Just call parse_symbol() after
@@ -3972,7 +3972,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
s->set_domain (LABEL_DOMAIN); s->set_domain (LABEL_DOMAIN);
s->set_aclass_index (LOC_CONST); s->set_aclass_index (LOC_CONST);
s->set_type (objfile_type (objfile)->builtin_void); s->set_type (builtin_type (objfile)->builtin_void);
s->set_value_bytes ((gdb_byte *) e); s->set_value_bytes ((gdb_byte *) e);
e->pdr.framereg = -1; e->pdr.framereg = -1;
add_symbol_to_list (s, get_local_symbols ()); add_symbol_to_list (s, get_local_symbols ());

View File

@@ -1314,8 +1314,8 @@ objfile_int_type (struct objfile *of, int size_in_bytes, bool unsigned_p)
/* Helper macro to examine the various builtin types. */ /* Helper macro to examine the various builtin types. */
#define TRY_TYPE(F) \ #define TRY_TYPE(F) \
int_type = (unsigned_p \ int_type = (unsigned_p \
? objfile_type (of)->builtin_unsigned_ ## F \ ? builtin_type (of)->builtin_unsigned_ ## F \
: objfile_type (of)->builtin_ ## F); \ : builtin_type (of)->builtin_ ## F); \
if (int_type != NULL && int_type->length () == size_in_bytes) \ if (int_type != NULL && int_type->length () == size_in_bytes) \
return int_type return int_type

View File

@@ -142,7 +142,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
/* Skip translation if caller does not need the address. */ /* Skip translation if caller does not need the address. */
if (address_p != NULL) if (address_p != NULL)
*address_p = target_translate_tls_address (objfile, addr); *address_p = target_translate_tls_address (objfile, addr);
return objfile_type (objfile)->nodebug_tls_symbol; return builtin_type (objfile)->nodebug_tls_symbol;
} }
if (address_p != NULL) if (address_p != NULL)
@@ -153,22 +153,22 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
case mst_text: case mst_text:
case mst_file_text: case mst_file_text:
case mst_solib_trampoline: case mst_solib_trampoline:
return objfile_type (objfile)->nodebug_text_symbol; return builtin_type (objfile)->nodebug_text_symbol;
case mst_text_gnu_ifunc: case mst_text_gnu_ifunc:
return objfile_type (objfile)->nodebug_text_gnu_ifunc_symbol; return builtin_type (objfile)->nodebug_text_gnu_ifunc_symbol;
case mst_data: case mst_data:
case mst_file_data: case mst_file_data:
case mst_bss: case mst_bss:
case mst_file_bss: case mst_file_bss:
return objfile_type (objfile)->nodebug_data_symbol; return builtin_type (objfile)->nodebug_data_symbol;
case mst_slot_got_plt: case mst_slot_got_plt:
return objfile_type (objfile)->nodebug_got_plt_symbol; return builtin_type (objfile)->nodebug_got_plt_symbol;
default: default:
return objfile_type (objfile)->nodebug_unknown_symbol; return builtin_type (objfile)->nodebug_unknown_symbol;
} }
} }

View File

@@ -311,7 +311,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
warning (_("GDB internal error: bad real_filenum")); warning (_("GDB internal error: bad real_filenum"));
error_return: error_return:
temp_type = objfile_type (objfile)->builtin_error; temp_type = builtin_type (objfile)->builtin_error;
return &temp_type; return &temp_type;
} }
@@ -798,7 +798,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
gdb_byte *dbl_valu; gdb_byte *dbl_valu;
struct type *dbl_type; struct type *dbl_type;
dbl_type = objfile_type (objfile)->builtin_double; dbl_type = builtin_type (objfile)->builtin_double;
dbl_valu dbl_valu
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack, = (gdb_byte *) obstack_alloc (&objfile->objfile_obstack,
dbl_type->length ()); dbl_type->length ());
@@ -819,7 +819,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
types; other languages probably should have at least types; other languages probably should have at least
unsigned as well as signed constants. */ unsigned as well as signed constants. */
sym->set_type (objfile_type (objfile)->builtin_long); sym->set_type (builtin_type (objfile)->builtin_long);
sym->set_value_longest (atoi (p)); sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST); sym->set_aclass_index (LOC_CONST);
} }
@@ -827,7 +827,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
case 'c': case 'c':
{ {
sym->set_type (objfile_type (objfile)->builtin_char); sym->set_type (builtin_type (objfile)->builtin_char);
sym->set_value_longest (atoi (p)); sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST); sym->set_aclass_index (LOC_CONST);
} }
@@ -880,10 +880,10 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
type_allocator alloc (objfile); type_allocator alloc (objfile);
range_type range_type
= create_static_range_type (alloc, = create_static_range_type (alloc,
objfile_type (objfile)->builtin_int, builtin_type (objfile)->builtin_int,
0, ind); 0, ind);
sym->set_type sym->set_type
(create_array_type (alloc, objfile_type (objfile)->builtin_char, (create_array_type (alloc, builtin_type (objfile)->builtin_char,
range_type)); range_type));
string_value string_value
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack, ind + 1); = (gdb_byte *) obstack_alloc (&objfile->objfile_obstack, ind + 1);
@@ -1002,7 +1002,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
it back into builtin_int here. it back into builtin_int here.
FIXME: Do we need a new builtin_promoted_int_arg ? */ FIXME: Do we need a new builtin_promoted_int_arg ? */
if (ptype->code () == TYPE_CODE_VOID) if (ptype->code () == TYPE_CODE_VOID)
ptype = objfile_type (objfile)->builtin_int; ptype = builtin_type (objfile)->builtin_int;
ftype->field (nparams).set_type (ptype); ftype->field (nparams).set_type (ptype);
TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0; TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
} }
@@ -1094,8 +1094,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
{ {
sym->set_type sym->set_type
(sym->type ()->is_unsigned () (sym->type ()->is_unsigned ()
? objfile_type (objfile)->builtin_unsigned_int ? builtin_type (objfile)->builtin_unsigned_int
: objfile_type (objfile)->builtin_int); : builtin_type (objfile)->builtin_int);
} }
break; break;
} }
@@ -1462,7 +1462,7 @@ error_type (const char **pp, struct objfile *objfile)
break; break;
} }
} }
return objfile_type (objfile)->builtin_error; return builtin_type (objfile)->builtin_error;
} }
@@ -2063,7 +2063,7 @@ rs6000_builtin_type (int typenum, struct objfile *objfile)
if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED) if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED)
{ {
complaint (_("Unknown builtin type %d"), typenum); complaint (_("Unknown builtin type %d"), typenum);
return objfile_type (objfile)->builtin_error; return builtin_type (objfile)->builtin_error;
} }
if (!negative_types) if (!negative_types)
@@ -4172,7 +4172,7 @@ read_range_type (const char **pp, int typenums[2], int type_size,
handle_true_range: handle_true_range:
if (self_subrange) if (self_subrange)
index_type = objfile_type (objfile)->builtin_int; index_type = builtin_type (objfile)->builtin_int;
else else
index_type = *dbx_lookup_type (rangenums, objfile); index_type = *dbx_lookup_type (rangenums, objfile);
if (index_type == NULL) if (index_type == NULL)
@@ -4182,7 +4182,7 @@ handle_true_range:
complaint (_("base type %d of range type is not defined"), rangenums[1]); complaint (_("base type %d of range type is not defined"), rangenums[1]);
index_type = objfile_type (objfile)->builtin_int; index_type = builtin_type (objfile)->builtin_int;
} }
result_type result_type

View File

@@ -1486,7 +1486,7 @@ process_xcoff_symbol (struct xcoff_symbol *cs, struct objfile *objfile)
patch_block_stabs (), unless the file was compiled without -g. */ patch_block_stabs (), unless the file was compiled without -g. */
sym->set_linkage_name (SYMNAME_ALLOC (name, symname_alloced)); sym->set_linkage_name (SYMNAME_ALLOC (name, symname_alloced));
sym->set_type (objfile_type (objfile)->nodebug_text_symbol); sym->set_type (builtin_type (objfile)->nodebug_text_symbol);
sym->set_aclass_index (LOC_BLOCK); sym->set_aclass_index (LOC_BLOCK);
sym2 = new (&objfile->objfile_obstack) symbol (*sym); sym2 = new (&objfile->objfile_obstack) symbol (*sym);
@@ -1499,7 +1499,7 @@ process_xcoff_symbol (struct xcoff_symbol *cs, struct objfile *objfile)
else else
{ {
/* In case we can't figure out the type, provide default. */ /* In case we can't figure out the type, provide default. */
sym->set_type (objfile_type (objfile)->nodebug_data_symbol); sym->set_type (builtin_type (objfile)->nodebug_data_symbol);
switch (cs->c_sclass) switch (cs->c_sclass)
{ {