(builtin_type_f_void): Remove macro.
* gdbtypes.c (builtin_type_void): New global variable.
(_initialize_gdbtypes): Initialize it.
* gnu-v3-abi.c (build_gdb_vtable_type): Do not call
lookup_pointer_type or lookup_function_type on builtin_type_void.
* printcmd.c (set_next_address): Likewise.
* objc-lang.c (value_nsstring): Likewise.
* mt-tdep.c (mt_copro_register_type): Likewise.
* xtensa-tdep.c (xtensa_register_type): Likewise.
* symfile.c (syms_from_objfile): Remove special handling
of builtin_type_void and builtin_type_char.
+2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (builtin_type_void): Remove macro, add declaration.
+ (builtin_type_f_void): Remove macro.
+ * gdbtypes.c (builtin_type_void): New global variable.
+ (_initialize_gdbtypes): Initialize it.
+
+ * gnu-v3-abi.c (build_gdb_vtable_type): Do not call
+ lookup_pointer_type or lookup_function_type on builtin_type_void.
+ * printcmd.c (set_next_address): Likewise.
+ * objc-lang.c (value_nsstring): Likewise.
+ * mt-tdep.c (mt_copro_register_type): Likewise.
+ * xtensa-tdep.c (xtensa_register_type): Likewise.
+
+ * symfile.c (syms_from_objfile): Remove special handling
+ of builtin_type_void and builtin_type_char.
+
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
* eval.c (evaluate_subexp_standard): Use exp->gdbarch types instead
struct type *builtin_type_ia64_spill;
struct type *builtin_type_ia64_quad;
+/* Platform-neutral void type. */
+struct type *builtin_type_void;
+
int opaque_type_resolution = 1;
static void
builtin_type_ia64_quad =
build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad);
+ builtin_type_void =
+ init_type (TYPE_CODE_VOID, 1,
+ 0,
+ "void", (struct objfile *) NULL);
+
add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\
Set debugging of C++ overloading."), _("\
Show debugging of C++ overloading."), _("\
(builtin_type (current_gdbarch)->builtin_core_addr)
#define builtin_type_true_char \
(builtin_type (current_gdbarch)->builtin_true_char)
-#define builtin_type_void \
- (builtin_type (current_gdbarch)->builtin_void)
#define builtin_type_char \
(builtin_type (current_gdbarch)->builtin_char)
#define builtin_type_short \
extern struct type *builtin_type_ia64_spill;
extern struct type *builtin_type_ia64_quad;
+/* Platform-neutral void type. Never attempt to construct a pointer
+ or reference type to this, because those cannot be platform-neutral.
+ You must use builtin_type (...)->builtin_void in those cases. */
+extern struct type *builtin_type_void;
+
/* This type represents a type that was unrecognized in symbol
read-in. */
-
extern struct type *builtin_type_error;
(builtin_f_type (current_gdbarch)->builtin_complex_s16)
#define builtin_type_f_complex_s32 \
(builtin_f_type (current_gdbarch)->builtin_complex_s32)
-#define builtin_type_f_void \
- (builtin_f_type (current_gdbarch)->builtin_void)
/* RTTI for C++ */
int offset;
struct type *void_ptr_type
- = lookup_pointer_type (builtin_type_void);
+ = builtin_type (arch)->builtin_data_ptr;
struct type *ptr_to_void_fn_type
- = lookup_pointer_type (lookup_function_type (builtin_type_void));
+ = builtin_type (arch)->builtin_func_ptr;
/* ARCH can't give us the true ptrdiff_t type, so we guess. */
struct type *ptrdiff_type
static struct type *
mt_register_type (struct gdbarch *arch, int regnum)
{
- static struct type *void_func_ptr = NULL;
- static struct type *void_ptr = NULL;
- static struct type *copro_type;
+ static struct type *copro_type = NULL;
if (regnum >= 0 && regnum < MT_NUM_REGS + MT_NUM_PSEUDO_REGS)
{
- if (void_func_ptr == NULL)
+ if (copro_type == NULL)
{
struct type *temp;
-
- void_ptr = lookup_pointer_type (builtin_type_void);
- void_func_ptr =
- lookup_pointer_type (lookup_function_type (builtin_type_void));
temp = create_range_type (NULL, builtin_type_unsigned_int, 0, 1);
copro_type = create_array_type (NULL, builtin_type_int16, temp);
}
case MT_PC_REGNUM:
case MT_RA_REGNUM:
case MT_IRA_REGNUM:
- return void_func_ptr;
+ return builtin_type (arch)->builtin_func_ptr;
case MT_SP_REGNUM:
case MT_FP_REGNUM:
- return void_ptr;
+ return builtin_type (arch)->builtin_data_ptr;
case MT_COPRO_REGNUM:
case MT_COPRO_PSEUDOREG_REGNUM:
return copro_type;
if (sym == NULL)
sym = lookup_struct_typedef("NXString", 0, 1);
if (sym == NULL)
- type = lookup_pointer_type(builtin_type_void);
+ type = builtin_type_void_data_ptr;
else
type = lookup_pointer_type(SYMBOL_TYPE (sym));
/* Make address available to the user as $_. */
set_internalvar (lookup_internalvar ("_"),
- value_from_pointer (lookup_pointer_type (builtin_type_void),
- addr));
+ value_from_pointer (builtin_type_void_data_ptr, addr));
}
/* Optionally print address ADDR symbolically as <SYMBOL+OFFSET> on STREAM,
(*objfile->sf->sym_read) (objfile, mainline);
- /* Don't allow char * to have a typename (else would get caddr_t).
- Ditto void *. FIXME: Check whether this is now done by all the
- symbol readers themselves (many of them now do), and if so remove
- it from here. */
-
- TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
- TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
-
/* Mark the objfile has having had initial symbol read attempted. Note
that this does not mean we found any symbols... */
if (regnum == gdbarch_pc_regnum (gdbarch)
|| regnum == gdbarch_tdep (gdbarch)->a0_base + 1)
- return lookup_pointer_type (builtin_type_void);
+ return builtin_type (gdbarch)->builtin_data_ptr;
/* Return the stored type for all other registers. */
else if (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch)