+2017-09-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.c (init_type): Change incoming argument from
+ length-in-bytes to length-in-bits. Assert length is a
+ multiple of TARGET_CHAR_BITS.
+ (arch_type, arch_flags_type): Likewise.
+ (init_integer_type): Update call to init_type.
+ (init_character_type): Likewise.
+ (init_boolean_type): Likewise.
+ (init_float_type): Likewise.
+ (init_decfloat_type): Likewise.
+ (init_complex_type): Likewise.
+ (init_pointer_type): Likewise.
+ (objfile_type): Likewise.
+ (arch_integer_type): Update call to arch_type.
+ (arch_character_type): Likewise.
+ (arch_boolean_type): Likewise.
+ (arch_float_type): Likewise.
+ (arch_decfloat_type): Likewise.
+ (arch_complex_type): Likewise.
+ (arch_pointer_type): Likewise.
+ (gdbtypes_post_init): Likewise.
+
+ * dwarf2read.c (dwarf2_init_float_type): Update call to init_type.
+ (read_base_type): Likewise.
+ * mdebugread.c (basic_type): Likewise.
+ * stabsread.c (dbx_init_float_type): Likewise.
+ (rs6000_builtin_type): Likewise.
+ (read_range_type): Likewise. Also, fix call to init_integer_type
+ with erroneous length argument.
+
+ * ada-lang.c (ada_language_arch_info): Update call to arch_type.
+ * d-lang.c (build_d_types): Likewise.
+ * f-lang.c (build_fortran_types): Likewise.
+ * go-lang.c (build_go_types): Likewise.
+ * opencl-lang.c (build_opencl_types): Likewise.
+ * jit.c (finalize_symtab): Likewise.
+ * gnu-v3-abi.c (build_gdb_vtable_type): Likewise.
+ (build_std_type_info_type): Likewise.
+ * target-descriptions.c (tdesc_gdb_type): Likewise. Also,
+ update call to arch_flags_type.
+
+ * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to
+ arch_type.
+ * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise.
+ * windows-tdep.c (windows_get_tlb_type): Likewise.
+
+ * avr-tdep.c (avr_gdbarch_init): Update call to arch_type.
+ * ft32-tdep.c (ft32_gdbarch_init): Likewise.
+ * m32c-tdep.c (make_types): Likewise.
+ * rl78-tdep.c (rl78_gdbarch_init): Likewise.
+ (rl78_psw_type): Update call to arch_flags_type.
+ * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type.
+ * rx-tdep.c (rx_psw_type): Likewise.
+ (rx_fpsw_type): Likewise.
+ * sparc-tdep.c (sparc_psr_type): Likewise.
+ (sparc_fsr_type): Likewise.
+ * sparc64-tdep.c (sparc64_pstate_type): Likewise.
+ (sparc64_ccr_type): Likewise.
+ (sparc64_fsr_type): Likewise.
+ (sparc64_fprs_type): Likewise.
+
2017-09-27 Tom Tromey <tom@tromey.com>
* findcmd.c (find_command): Constify.
= builtin->builtin_void;
lai->primitive_type_vector [ada_primitive_type_system_address]
- = lookup_pointer_type (arch_type (gdbarch, TYPE_CODE_VOID, 1, "void"));
+ = lookup_pointer_type (arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT,
+ "void"));
TYPE_NAME (lai->primitive_type_vector [ada_primitive_type_system_address])
= "system__address";
/* Create a type for PC. We can't use builtin types here, as they may not
be defined. */
- tdep->void_type = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ tdep->void_type = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT,
+ "void");
tdep->func_void_type = make_function_type (tdep->void_type, NULL);
tdep->pc_type = arch_pointer_type (gdbarch, 4 * TARGET_CHAR_BIT, NULL,
tdep->func_void_type);
/* Basic types. */
builtin_d_type->builtin_void
- = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
builtin_d_type->builtin_bool
= arch_boolean_type (gdbarch, 8, 1, "bool");
builtin_d_type->builtin_byte
if (format)
type = init_float_type (objfile, bits, name, format);
else
- type = init_type (objfile, TYPE_CODE_ERROR, bits / TARGET_CHAR_BIT, name);
+ type = init_type (objfile, TYPE_CODE_ERROR, bits, name);
return type;
}
{
case DW_ATE_address:
/* Turn DW_ATE_address into a void * pointer. */
- type = init_type (objfile, TYPE_CODE_VOID, 1, NULL);
+ type = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL);
type = init_pointer_type (objfile, bits, name, type);
break;
case DW_ATE_boolean:
default:
complaint (&symfile_complaints, _("unsupported DW_AT_encoding: '%s'"),
dwarf_type_encoding_name (encoding));
- type = init_type (objfile, TYPE_CODE_ERROR,
- bits / TARGET_CHAR_BIT, name);
+ type = init_type (objfile, TYPE_CODE_ERROR, bits, name);
break;
}
= GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_f_type);
builtin_f_type->builtin_void
- = arch_type (gdbarch, TYPE_CODE_VOID, 1, "VOID");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "VOID");
builtin_f_type->builtin_character
= arch_integer_type (gdbarch, TARGET_CHAR_BIT, 0, "character");
/* __pid_t */
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
- TYPE_LENGTH (int32_type), "__pid_t");
+ TYPE_LENGTH (int32_type) * TARGET_CHAR_BIT, "__pid_t");
TYPE_TARGET_TYPE (pid_type) = int32_type;
TYPE_TARGET_STUB (pid_type) = 1;
/* __uid_t */
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
- TYPE_LENGTH (uint32_type), "__uid_t");
+ TYPE_LENGTH (uint32_type) * TARGET_CHAR_BIT,
+ "__uid_t");
TYPE_TARGET_TYPE (uid_type) = uint32_type;
TYPE_TARGET_STUB (uid_type) = 1;
/* Create a type for PC. We can't use builtin types here, as they may not
be defined. */
- void_type = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ void_type = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
func_void_type = make_function_type (void_type, NULL);
tdep->pc_type = arch_pointer_type (gdbarch, 4 * TARGET_CHAR_BIT, NULL,
func_void_type);
least as long as OBJFILE. */
struct type *
-init_type (struct objfile *objfile, enum type_code code, int length,
+init_type (struct objfile *objfile, enum type_code code, int bit,
const char *name)
{
struct type *type;
type = alloc_type (objfile);
set_type_code (type, code);
- TYPE_LENGTH (type) = length;
+ gdb_assert ((bit % TARGET_CHAR_BIT) == 0);
+ TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
TYPE_NAME (type) = name;
return type;
{
struct type *t;
- t = init_type (objfile, TYPE_CODE_INT, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_INT, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
{
struct type *t;
- t = init_type (objfile, TYPE_CODE_CHAR, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_CHAR, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
{
struct type *t;
- t = init_type (objfile, TYPE_CODE_BOOL, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_BOOL, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
struct type *t;
bit = verify_floatformat (bit, floatformats);
- t = init_type (objfile, TYPE_CODE_FLT, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_FLT, bit, name);
TYPE_FLOATFORMAT (t) = floatformats;
return t;
{
struct type *t;
- t = init_type (objfile, TYPE_CODE_DECFLOAT, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_DECFLOAT, bit, name);
return t;
}
struct type *t;
t = init_type (objfile, TYPE_CODE_COMPLEX,
- 2 * TYPE_LENGTH (target_type), name);
+ 2 * TYPE_LENGTH (target_type) * TARGET_CHAR_BIT, name);
TYPE_TARGET_TYPE (t) = target_type;
return t;
}
{
struct type *t;
- t = init_type (objfile, TYPE_CODE_PTR, bit / TARGET_CHAR_BIT, name);
+ t = init_type (objfile, TYPE_CODE_PTR, bit, name);
TYPE_TARGET_TYPE (t) = target_type;
TYPE_UNSIGNED (t) = 1;
return t;
struct type *
arch_type (struct gdbarch *gdbarch,
- enum type_code code, int length, const char *name)
+ enum type_code code, int bit, const char *name)
{
struct type *type;
type = alloc_type_arch (gdbarch);
set_type_code (type, code);
- TYPE_LENGTH (type) = length;
+ gdb_assert ((bit % TARGET_CHAR_BIT) == 0);
+ TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
if (name)
TYPE_NAME (type) = gdbarch_obstack_strdup (gdbarch, name);
{
struct type *t;
- t = arch_type (gdbarch, TYPE_CODE_INT, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_INT, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
{
struct type *t;
- t = arch_type (gdbarch, TYPE_CODE_CHAR, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_CHAR, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
{
struct type *t;
- t = arch_type (gdbarch, TYPE_CODE_BOOL, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_BOOL, bit, name);
if (unsigned_p)
TYPE_UNSIGNED (t) = 1;
struct type *t;
bit = verify_floatformat (bit, floatformats);
- t = arch_type (gdbarch, TYPE_CODE_FLT, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_FLT, bit, name);
TYPE_FLOATFORMAT (t) = floatformats;
return t;
{
struct type *t;
- t = arch_type (gdbarch, TYPE_CODE_DECFLOAT, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_DECFLOAT, bit, name);
return t;
}
struct type *t;
t = arch_type (gdbarch, TYPE_CODE_COMPLEX,
- 2 * TYPE_LENGTH (target_type), name);
+ 2 * TYPE_LENGTH (target_type) * TARGET_CHAR_BIT, name);
TYPE_TARGET_TYPE (t) = target_type;
return t;
}
{
struct type *t;
- t = arch_type (gdbarch, TYPE_CODE_PTR, bit / TARGET_CHAR_BIT, name);
+ t = arch_type (gdbarch, TYPE_CODE_PTR, bit, name);
TYPE_TARGET_TYPE (t) = target_type;
TYPE_UNSIGNED (t) = 1;
return t;
}
/* Allocate a TYPE_CODE_FLAGS type structure associated with GDBARCH.
- NAME is the type name. LENGTH is the size of the flag word in bytes. */
+ NAME is the type name. BIT is the size of the flag word in bits. */
struct type *
-arch_flags_type (struct gdbarch *gdbarch, const char *name, int length)
+arch_flags_type (struct gdbarch *gdbarch, const char *name, int bit)
{
- int max_nfields = length * TARGET_CHAR_BIT;
struct type *type;
- type = arch_type (gdbarch, TYPE_CODE_FLAGS, length, name);
+ type = arch_type (gdbarch, TYPE_CODE_FLAGS, bit, name);
TYPE_UNSIGNED (type) = 1;
TYPE_NFIELDS (type) = 0;
/* Pre-allocate enough space assuming every field is one bit. */
TYPE_FIELDS (type)
- = (struct field *) TYPE_ZALLOC (type, max_nfields * sizeof (struct field));
+ = (struct field *) TYPE_ZALLOC (type, bit * sizeof (struct field));
return type;
}
/* Basic types. */
builtin_type->builtin_void
- = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
builtin_type->builtin_char
= arch_integer_type (gdbarch, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
= arch_complex_type (gdbarch, "double complex",
builtin_type->builtin_double);
builtin_type->builtin_string
- = arch_type (gdbarch, TYPE_CODE_STRING, 1, "string");
+ = arch_type (gdbarch, TYPE_CODE_STRING, TARGET_CHAR_BIT, "string");
builtin_type->builtin_bool
- = arch_type (gdbarch, TYPE_CODE_BOOL, 1, "bool");
+ = arch_type (gdbarch, TYPE_CODE_BOOL, TARGET_CHAR_BIT, "bool");
/* The following three are about decimal floating point types, which
are 32-bits, 64-bits and 128-bits respectively. */
/* Basic types. */
objfile_type->builtin_void
- = init_type (objfile, TYPE_CODE_VOID, 1, "void");
+ = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
objfile_type->builtin_char
= init_integer_type (objfile, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
/* The following set of types is used for symbols with no
debug information. */
objfile_type->nodebug_text_symbol
- = init_type (objfile, TYPE_CODE_FUNC, 1,
+ = init_type (objfile, TYPE_CODE_FUNC, TARGET_CHAR_BIT,
"<text variable, no debug info>");
objfile_type->nodebug_text_gnu_ifunc_symbol
- = init_type (objfile, TYPE_CODE_FUNC, 1,
+ = init_type (objfile, TYPE_CODE_FUNC, TARGET_CHAR_BIT,
"<text gnu-indirect-function variable, no debug info>");
/* Ifunc resolvers return a function address. */
TYPE_TARGET_TYPE (objfile_type->nodebug_text_gnu_ifunc_symbol)
type is created using arch_flag_type(). Flags are then added using
append_flag_type_field() and append_flag_type_flag(). */
extern struct type *arch_flags_type (struct gdbarch *gdbarch,
- const char *name, int length);
+ const char *name, int bit);
extern void append_flags_type_field (struct type *type,
int start_bitpos, int nr_bits,
struct type *field_type, const char *name);
/* We assumed in the allocation above that there were four fields. */
gdb_assert (field == (field_list + 4));
- t = arch_type (arch, TYPE_CODE_STRUCT, offset, NULL);
+ t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
TYPE_NFIELDS (t) = field - field_list;
TYPE_FIELDS (t) = field_list;
TYPE_TAG_NAME (t) = "gdb_gnu_v3_abi_vtable";
gdb_assert (field == (field_list + 2));
- t = arch_type (arch, TYPE_CODE_STRUCT, offset, NULL);
+ t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
TYPE_NFIELDS (t) = field - field_list;
TYPE_FIELDS (t) = field_list;
TYPE_TAG_NAME (t) = "gdb_gnu_v3_type_info";
= GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_go_type);
builtin_go_type->builtin_void
- = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
builtin_go_type->builtin_char
= arch_character_type (gdbarch, 8, 1, "char");
builtin_go_type->builtin_bool
struct symbol *block_name = allocate_symbol (objfile);
struct type *block_type = arch_type (get_objfile_arch (objfile),
TYPE_CODE_VOID,
- 1,
+ TARGET_CHAR_BIT,
"void");
BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
/* __pid_t */
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
- TYPE_LENGTH (int_type), "__pid_t");
+ TYPE_LENGTH (int_type) * TARGET_CHAR_BIT, "__pid_t");
TYPE_TARGET_TYPE (pid_type) = int_type;
TYPE_TARGET_STUB (pid_type) = 1;
/* __uid_t */
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
- TYPE_LENGTH (uint_type), "__uid_t");
+ TYPE_LENGTH (uint_type) * TARGET_CHAR_BIT, "__uid_t");
TYPE_TARGET_TYPE (uid_type) = uint_type;
TYPE_TARGET_STUB (uid_type) = 1;
/* __clock_t */
clock_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
- TYPE_LENGTH (long_type), "__clock_t");
+ TYPE_LENGTH (long_type) * TARGET_CHAR_BIT,
+ "__clock_t");
TYPE_TARGET_TYPE (clock_type) = long_type;
TYPE_TARGET_STUB (clock_type) = 1;
/* The builtin_type_mumble variables are sometimes uninitialized when
this is called, so we avoid using them. */
- tdep->voyd = arch_type (arch, TYPE_CODE_VOID, 1, "void");
+ tdep->voyd = arch_type (arch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
tdep->ptr_voyd
= arch_pointer_type (arch, gdbarch_ptr_bit (arch), NULL, tdep->voyd);
tdep->func_voyd = lookup_function_type (tdep->voyd);
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_m68k_ps", 4);
+ type = arch_flags_type (gdbarch, "builtin_type_m68k_ps", 32);
append_flags_type_flag (type, 0, "C");
append_flags_type_flag (type, 1, "V");
append_flags_type_flag (type, 2, "Z");
case btFloatDec:
tp = init_type (objfile, TYPE_CODE_ERROR,
- gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT,
- "floating decimal");
+ gdbarch_double_bit (gdbarch), "floating decimal");
break;
case btString:
/* Is a "string" the way btString means it the same as TYPE_CODE_STRING?
FIXME. */
- tp = init_type (objfile, TYPE_CODE_STRING, 1, "string");
+ tp = init_type (objfile, TYPE_CODE_STRING, TARGET_CHAR_BIT, "string");
break;
case btVoid:
types[opencl_primitive_type_uintptr_t]
= arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 1, "uintptr_t");
types[opencl_primitive_type_void]
- = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
return types;
}
if (tdep->rl78_psw_type == NULL)
{
tdep->rl78_psw_type = arch_flags_type (gdbarch,
- "builtin_type_rl78_psw", 1);
+ "builtin_type_rl78_psw", 8);
append_flags_type_flag (tdep->rl78_psw_type, 0, "CY");
append_flags_type_flag (tdep->rl78_psw_type, 1, "ISP0");
append_flags_type_flag (tdep->rl78_psw_type, 2, "ISP1");
tdep->elf_flags = elf_flags;
/* Initialize types. */
- tdep->rl78_void = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
+ tdep->rl78_void = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT,
+ "void");
tdep->rl78_uint8 = arch_integer_type (gdbarch, 8, 1, "uint8_t");
tdep->rl78_int8 = arch_integer_type (gdbarch, 8, 0, "int8_t");
tdep->rl78_uint16 = arch_integer_type (gdbarch, 16, 1, "uint16_t");
if (tdep->rx_psw_type == NULL)
{
- tdep->rx_psw_type = arch_flags_type (gdbarch, "rx_psw_type", 4);
+ tdep->rx_psw_type = arch_flags_type (gdbarch, "rx_psw_type", 32);
append_flags_type_flag (tdep->rx_psw_type, 0, "C");
append_flags_type_flag (tdep->rx_psw_type, 1, "Z");
append_flags_type_flag (tdep->rx_psw_type, 2, "S");
if (tdep->rx_fpsw_type == NULL)
{
- tdep->rx_fpsw_type = arch_flags_type (gdbarch, "rx_fpsw_type", 4);
+ tdep->rx_fpsw_type = arch_flags_type (gdbarch, "rx_fpsw_type", 32);
append_flags_type_flag (tdep->rx_fpsw_type, 0, "RM0");
append_flags_type_flag (tdep->rx_fpsw_type, 1, "RM1");
append_flags_type_flag (tdep->rx_fpsw_type, 2, "CV");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc_psr", 4);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc_psr", 32);
append_flags_type_flag (type, 5, "ET");
append_flags_type_flag (type, 6, "PS");
append_flags_type_flag (type, 7, "S");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc_fsr", 4);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc_fsr", 32);
append_flags_type_flag (type, 0, "NXA");
append_flags_type_flag (type, 1, "DZA");
append_flags_type_flag (type, 2, "UFA");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc64_pstate", 8);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_pstate", 64);
append_flags_type_flag (type, 0, "AG");
append_flags_type_flag (type, 1, "IE");
append_flags_type_flag (type, 2, "PRIV");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 64);
append_flags_type_flag (type, 0, "icc.c");
append_flags_type_flag (type, 1, "icc.v");
append_flags_type_flag (type, 2, "icc.z");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 64);
append_flags_type_flag (type, 0, "NXC");
append_flags_type_flag (type, 1, "DZC");
append_flags_type_flag (type, 2, "UFC");
{
struct type *type;
- type = arch_flags_type (gdbarch, "builtin_type_sparc64_fprs", 8);
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_fprs", 64);
append_flags_type_flag (type, 0, "DL");
append_flags_type_flag (type, 1, "DU");
append_flags_type_flag (type, 2, "FEF");
if (format)
type = init_float_type (objfile, bits, NULL, format);
else
- type = init_type (objfile, TYPE_CODE_ERROR, bits / TARGET_CHAR_BIT, NULL);
+ type = init_type (objfile, TYPE_CODE_ERROR, bits, NULL);
return type;
}
rettype = init_integer_type (objfile, 32, 1, "unsigned long");
break;
case 11:
- rettype = init_type (objfile, TYPE_CODE_VOID, 1, "void");
+ rettype = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
break;
case 12:
/* IEEE single precision (32 bit). */
if (type_bits == 0)
{
- struct type *type = init_type (objfile, TYPE_CODE_VOID, 1, NULL);
+ struct type *type = init_type (objfile, TYPE_CODE_VOID,
+ TARGET_CHAR_BIT, NULL);
if (unsigned_type)
TYPE_UNSIGNED (type) = 1;
return type;
/* A type defined as a subrange of itself, with bounds both 0, is void. */
if (self_subrange && n2 == 0 && n3 == 0)
- return init_type (objfile, TYPE_CODE_VOID, 1, NULL);
+ return init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL);
/* If n3 is zero and n2 is positive, we want a floating type, and n2
is the width in bytes.
itself with range 0-127. */
else if (self_subrange && n2 == 0 && n3 == 127)
{
- struct type *type = init_integer_type (objfile, 1, 0, NULL);
+ struct type *type = init_integer_type (objfile, TARGET_CHAR_BIT,
+ 0, NULL);
TYPE_NOSIGN (type) = 1;
return type;
}
int ix;
type = arch_flags_type (gdbarch, tdesc_type->name,
- tdesc_type->u.u.size);
+ tdesc_type->u.u.size * TARGET_CHAR_BIT);
for (ix = 0;
VEC_iterate (tdesc_type_field, tdesc_type->u.u.fields, ix, f);
ix++)
int ix;
type = arch_type (gdbarch, TYPE_CODE_ENUM,
- tdesc_type->u.u.size, tdesc_type->name);
+ tdesc_type->u.u.size * TARGET_CHAR_BIT,
+ tdesc_type->name);
TYPE_UNSIGNED (type) = 1;
for (ix = 0;
VEC_iterate (tdesc_type_field, tdesc_type->u.u.fields, ix, f);
TYPE_NAME (seh_type) = xstrdup ("seh");
seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- TYPE_LENGTH (void_ptr_type), NULL);
+ TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
+ NULL);
TYPE_TARGET_TYPE (seh_ptr_type) = seh_type;
append_composite_type_field (seh_type, "next_seh", seh_ptr_type);
append_composite_type_field (peb_ldr_type, "entry_in_progress",
void_ptr_type);
peb_ldr_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- TYPE_LENGTH (void_ptr_type), NULL);
+ TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
+ NULL);
TYPE_TARGET_TYPE (peb_ldr_ptr_type) = peb_ldr_type;
append_composite_type_field (peb_type, "process_heap", void_ptr_type);
append_composite_type_field (peb_type, "fast_peb_lock", void_ptr_type);
peb_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- TYPE_LENGTH (void_ptr_type), NULL);
+ TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
+ NULL);
TYPE_TARGET_TYPE (peb_ptr_type) = peb_type;
append_composite_type_field (tib_type, "last_error_number", dword_ptr_type);
tib_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
- TYPE_LENGTH (void_ptr_type), NULL);
+ TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
+ NULL);
TYPE_TARGET_TYPE (tib_ptr_type) = tib_type;
last_tlb_type = tib_ptr_type;