-static void
-build_gdbtypes (void)
-{
- builtin_type_void =
- init_type (TYPE_CODE_VOID, 1,
- 0,
- "void", (struct objfile *) NULL);
- builtin_type_char =
- init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- (TYPE_FLAG_NOSIGN
- | (gdbarch_char_signed (current_gdbarch) ?
- 0 : TYPE_FLAG_UNSIGNED)),
- "char", (struct objfile *) NULL);
- builtin_type_true_char =
- init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "true character", (struct objfile *) NULL);
- builtin_type_signed_char =
- init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "signed char", (struct objfile *) NULL);
- builtin_type_unsigned_char =
- init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned char", (struct objfile *) NULL);
- builtin_type_short =
- init_type (TYPE_CODE_INT,
- gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0, "short", (struct objfile *) NULL);
- builtin_type_unsigned_short =
- init_type (TYPE_CODE_INT,
- gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned short", (struct objfile *) NULL);
- builtin_type_int =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0, "int", (struct objfile *) NULL);
- builtin_type_unsigned_int =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned int", (struct objfile *) NULL);
- builtin_type_long =
- init_type (TYPE_CODE_INT,
- gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0, "long", (struct objfile *) NULL);
- builtin_type_unsigned_long =
- init_type (TYPE_CODE_INT,
- gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned long", (struct objfile *) NULL);
- builtin_type_long_long =
- init_type (TYPE_CODE_INT,
- gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0, "long long", (struct objfile *) NULL);
- builtin_type_unsigned_long_long =
- init_type (TYPE_CODE_INT,
- gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned long long", (struct objfile *) NULL);
-
- builtin_type_float
- = build_flt (gdbarch_float_bit (current_gdbarch), "float",
- gdbarch_float_format (current_gdbarch));
- builtin_type_double
- = build_flt (gdbarch_double_bit (current_gdbarch), "double",
- gdbarch_double_format (current_gdbarch));
- builtin_type_long_double
- = build_flt (gdbarch_long_double_bit (current_gdbarch), "long double",
- gdbarch_long_double_format
- (current_gdbarch));
-
- builtin_type_complex =
- init_type (TYPE_CODE_COMPLEX,
- 2 * gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0,
- "complex", (struct objfile *) NULL);
- TYPE_TARGET_TYPE (builtin_type_complex) = builtin_type_float;
- builtin_type_double_complex =
- init_type (TYPE_CODE_COMPLEX,
- 2 * gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
- 0,
- "double complex", (struct objfile *) NULL);
- TYPE_TARGET_TYPE (builtin_type_double_complex) = builtin_type_double;
- builtin_type_string =
- init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "string", (struct objfile *) NULL);
- builtin_type_bool =
- init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "bool", (struct objfile *) NULL);
-
- /* Add user knob for controlling resolution of opaque types */
- add_setshow_boolean_cmd ("opaque-type-resolution", class_support,
- &opaque_type_resolution, _("\
-Set resolution of opaque struct/class/union types (if set before loading symbols)."), _("\
-Show resolution of opaque struct/class/union types (if set before loading symbols)."), NULL,
- NULL,
- show_opaque_type_resolution,
- &setlist, &showlist);
- opaque_type_resolution = 1;
-
- /* Build SIMD types. */
- builtin_type_v4sf
- = init_simd_type ("__builtin_v4sf", builtin_type_float, "f", 4);
- builtin_type_v4si
- = init_simd_type ("__builtin_v4si", builtin_type_int32, "f", 4);
- builtin_type_v16qi
- = init_simd_type ("__builtin_v16qi", builtin_type_int8, "f", 16);
- builtin_type_v8qi
- = init_simd_type ("__builtin_v8qi", builtin_type_int8, "f", 8);
- builtin_type_v8hi
- = init_simd_type ("__builtin_v8hi", builtin_type_int16, "f", 8);
- builtin_type_v4hi
- = init_simd_type ("__builtin_v4hi", builtin_type_int16, "f", 4);
- builtin_type_v2si
- = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2);
-
- /* 128 bit vectors. */
- builtin_type_v2_double = init_vector_type (builtin_type_double, 2);
- builtin_type_v4_float = init_vector_type (builtin_type_float, 4);
- builtin_type_v2_int64 = init_vector_type (builtin_type_int64, 2);
- builtin_type_v4_int32 = init_vector_type (builtin_type_int32, 4);
- builtin_type_v8_int16 = init_vector_type (builtin_type_int16, 8);
- builtin_type_v16_int8 = init_vector_type (builtin_type_int8, 16);
- /* 64 bit vectors. */
- builtin_type_v2_float = init_vector_type (builtin_type_float, 2);
- builtin_type_v2_int32 = init_vector_type (builtin_type_int32, 2);
- builtin_type_v4_int16 = init_vector_type (builtin_type_int16, 4);
- builtin_type_v8_int8 = init_vector_type (builtin_type_int8, 8);
-
- /* Vector types. */
- builtin_type_vec64 = build_builtin_type_vec64 ();
- builtin_type_vec128 = build_builtin_type_vec128 ();
-
- /* Pointer/Address types. */
-
- /* NOTE: on some targets, addresses and pointers are not necessarily
- the same --- for example, on the D10V, pointers are 16 bits long,
- but addresses are 32 bits long. See doc/gdbint.texinfo,
- ``Pointers Are Not Always Addresses''.
-
- The upshot is:
- - gdb's `struct type' always describes the target's
- representation.
- - gdb's `struct value' objects should always hold values in
- target form.
- - gdb's CORE_ADDR values are addresses in the unified virtual
- address space that the assembler and linker work with. Thus,
- since target_read_memory takes a CORE_ADDR as an argument, it
- can access any memory on the target, even if the processor has
- separate code and data address spaces.
-
- So, for example:
- - If v is a value holding a D10V code pointer, its contents are
- in target form: a big-endian address left-shifted two bits.
- - If p is a D10V pointer type, TYPE_LENGTH (p) == 2, just as
- sizeof (void *) == 2 on the target.
-
- In this context, builtin_type_CORE_ADDR is a bit odd: it's a
- target type for a value the target will never see. It's only
- used to hold the values of (typeless) linker symbols, which are
- indeed in the unified virtual address space. */
- builtin_type_void_data_ptr = make_pointer_type (builtin_type_void, NULL);
- builtin_type_void_func_ptr
- = lookup_pointer_type (lookup_function_type (builtin_type_void));
- builtin_type_CORE_ADDR =
- init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8,
- TYPE_FLAG_UNSIGNED,
- "__CORE_ADDR", (struct objfile *) NULL);
- builtin_type_bfd_vma =
- init_type (TYPE_CODE_INT, TARGET_BFD_VMA_BIT / 8,
- TYPE_FLAG_UNSIGNED,
- "__bfd_vma", (struct objfile *) NULL);
-}
-