+Tue Apr 14 22:33:55 1992 Fred Fish (fnf@cygnus.com)
+
+ * gdbtypes.h (FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL): Add defines.
+ * gdbtypes.h (TYPE_FLAG_FUND_TYPE): Add define for bit in a
+ type's flag word that marks it as a fundamental type.
+ * c-exp.y (_initialize_c_exp): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type().
+ * m2-exp.y (_initialize_m2_exp): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type(). Also remove
+ dependency on host sizes for ints, floats, etc.
+ * mipsread.c (_initialize_mipsread): Add TYPE_FLAG_FUND_TYPE bit to
+ flags argument for all calls to init_type(). Also remove
+ dependency on host sizes for ints, floats, etc.
+ * gdbtypes.c (lookup_fundamental_type): Add TYPE_FLAG_FUND_TYPE
+ bit to flags argument for all calls to init_type(). Add types
+ FT_FIXED_DECIMAL and FT_FLOAT_DECIMAL.
+ * valprint.c (unsigned_type_table, signed_type_table,
+ float_type_table): Remove.
+ * valprint.c (type_print_base): Test new TYPE_FLAG_FUND_TYPE
+ bit when printing fundamental types, and print the actual name
+ for such types, rather than inventing one. Remove code that
+ invented fundamental type names.
+ * valprint.c (_initialize_valprint): Remove initializations
+ for now removed unsigned_type_table, signed_type_table, and
+ float_type_table.
+
Mon Apr 13 20:59:21 1992 Fred Fish (fnf@cygnus.com)
* dwarfread.c (target_to_host): New function similar to previous
{
builtin_type_void =
init_type (TYPE_CODE_VOID, 1,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"void", (struct objfile *) NULL);
builtin_type_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"char", (struct objfile *) NULL);
builtin_type_signed_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed char", (struct objfile *) NULL);
builtin_type_unsigned_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned char", (struct objfile *) NULL);
builtin_type_short =
init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"short", (struct objfile *) NULL);
builtin_type_unsigned_short =
init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned short", (struct objfile *) NULL);
builtin_type_int =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"int", (struct objfile *) NULL);
builtin_type_unsigned_int =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned int", (struct objfile *) NULL);
builtin_type_long =
init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long", (struct objfile *) NULL);
builtin_type_unsigned_long =
init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned long", (struct objfile *) NULL);
builtin_type_long_long =
init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long long", (struct objfile *) NULL);
builtin_type_unsigned_long_long =
init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned long long", (struct objfile *) NULL);
builtin_type_float =
init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"float", (struct objfile *) NULL);
builtin_type_double =
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"double", (struct objfile *) NULL);
builtin_type_long_double =
init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long double", (struct objfile *) NULL);
builtin_type_complex =
init_type (TYPE_CODE_FLT, TARGET_COMPLEX_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"complex", (struct objfile *) NULL);
builtin_type_double_complex =
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_COMPLEX_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"double complex", (struct objfile *) NULL);
add_language (&c_language_defn);
case FT_VOID:
type = init_type (TYPE_CODE_VOID,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"void", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"boolean", objfile);
break;
case FT_STRING:
type = init_type (TYPE_CODE_PASCAL_ARRAY,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"string", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"char", objfile);
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed char", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned char", objfile);
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed short", objfile);
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed int", objfile);
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned int", objfile);
break;
+ case FT_FIXED_DECIMAL:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
+ "fixed decimal", objfile);
+ break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed long", objfile);
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_SIGNED,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_SIGNED,
"signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned long long",
- objfile);
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
+ "unsigned long long", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"float", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"double", objfile);
break;
+ case FT_FLOAT_DECIMAL:
+ type = init_type (TYPE_CODE_FLT,
+ TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
+ "floating decimal", objfile);
+ break;
case FT_EXT_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"long double", objfile);
break;
case FT_COMPLEX:
type = init_type (TYPE_CODE_FLT,
TARGET_COMPLEX_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"complex", objfile);
break;
case FT_DBL_PREC_COMPLEX:
type = init_type (TYPE_CODE_FLT,
TARGET_DOUBLE_COMPLEX_BIT / TARGET_CHAR_BIT,
- 0,
+ TYPE_FLAG_FUND_TYPE,
"double complex", objfile);
break;
case FT_EXT_PREC_COMPLEX:
type = init_type (TYPE_CODE_FLT,
TARGET_DOUBLE_COMPLEX_BIT / TARGET_CHAR_BIT,
- 0,
- "long double complex",
- objfile);
+ TYPE_FLAG_FUND_TYPE,
+ "long double complex", objfile);
break;
}
/* Install the newly created type in the objfile's fundamental_types
#define FT_DBL_PREC_COMPLEX 21
#define FT_EXT_PREC_COMPLEX 22
#define FT_STRING 23
+#define FT_FIXED_DECIMAL 24
+#define FT_FLOAT_DECIMAL 25
-#define FT_NUM_MEMBERS 24
+#define FT_NUM_MEMBERS 26
/* Different kinds of data types are distinguished by the `code' field. */
#define TYPE_FLAG_UNSIGNED (1 << 0)
-/* Explicity signed integer type */
+/* Explicitly signed integer type */
#define TYPE_FLAG_SIGNED (1 << 1)
#define TYPE_FLAG_STUB (1 << 2)
+/* This type is a fundamental type in the current source language. */
+
+#define TYPE_FLAG_FUND_TYPE (1 << 3)
+
+
struct type
{
void
_initialize_m2_exp ()
{
- /* FIXME: The code below assumes that the sizes of the basic data
- types are the same on the host and target machines!!! */
-
/* Modula-2 "pervasive" types. NOTE: these can be redefined!!! */
builtin_type_m2_int =
- init_type (TYPE_CODE_INT, sizeof(int), 0,
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
"INTEGER", (struct objfile *) NULL);
builtin_type_m2_card =
- init_type (TYPE_CODE_INT, sizeof(int), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"CARDINAL", (struct objfile *) NULL);
builtin_type_m2_real =
- init_type (TYPE_CODE_FLT, sizeof(float), 0,
+ init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
"REAL", (struct objfile *) NULL);
builtin_type_m2_char =
- init_type (TYPE_CODE_CHAR, sizeof(char), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"CHAR", (struct objfile *) NULL);
builtin_type_m2_bool =
- init_type (TYPE_CODE_BOOL, sizeof(int), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"BOOLEAN", (struct objfile *) NULL);
TYPE_NFIELDS(builtin_type_m2_bool) = 2;
add_symtab_fns (&ecoff_sym_fns);
/* Missing basic types */
+
builtin_type_string =
- init_type (TYPE_CODE_PASCAL_ARRAY,
- 1, 0, "string",
- (struct objfile *) NULL);
+ init_type(TYPE_CODE_PASCAL_ARRAY,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE, "string",
+ (struct objfile *) NULL);
builtin_type_complex =
init_type(TYPE_CODE_FLT,
- 2 * sizeof(float), 0, "complex",
+ TARGET_COMPLEX_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE, "complex",
(struct objfile *) NULL);
builtin_type_double_complex =
init_type(TYPE_CODE_FLT,
- 2 * sizeof(double), 0, "double_complex",
+ TARGET_DOUBLE_COMPLEX_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE, "double complex",
(struct objfile *) NULL);
builtin_type_fixed_dec =
- init_type(TYPE_CODE_INT, sizeof(int),
- 0, "fixed_decimal",
+ init_type(TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE, "fixed decimal",
(struct objfile *) NULL);
builtin_type_float_dec =
- init_type(TYPE_CODE_FLT, sizeof(double),
- 0, "floating_decimal",
+ init_type(TYPE_CODE_FLT,
+ TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE, "floating decimal",
(struct objfile *) NULL);
}
unsigned output_radix = 10;
int output_format = 0;
-
-char **unsigned_type_table;
-char **signed_type_table;
-char **float_type_table;
-
-
/* Print repeat counts if there are more than this
many repetitions of an element in an array. */
#define REPEAT_COUNT_THRESHOLD 10
}
}
+static void
+print_class_member (valaddr, domain, stream, prefix)
+ char *valaddr;
+ struct type *domain;
+ FILE *stream;
+ char *prefix;
+{
+
+ /* VAL is a byte offset into the structure type DOMAIN.
+ Find the name of the field for that offset and
+ print it. */
+ int extra = 0;
+ int bits = 0;
+ register unsigned int i;
+ unsigned len = TYPE_NFIELDS (domain);
+ /* @@ Make VAL into bit offset */
+ LONGEST val = unpack_long (builtin_type_int, valaddr) << 3;
+ for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
+ {
+ int bitpos = TYPE_FIELD_BITPOS (domain, i);
+ QUIT;
+ if (val == bitpos)
+ break;
+ if (val < bitpos && i != 0)
+ {
+ /* Somehow pointing into a field. */
+ i -= 1;
+ extra = (val - TYPE_FIELD_BITPOS (domain, i));
+ if (extra & 0x7)
+ bits = 1;
+ else
+ extra >>= 3;
+ break;
+ }
+ }
+ if (i < len)
+ {
+ char *name;
+ fprintf_filtered (stream, prefix);
+ name = type_name_no_tag (domain);
+ if (name)
+ fputs_filtered (name, stream);
+ else
+ type_print_base (domain, stream, 0, 0);
+ fprintf_filtered (stream, "::");
+ fputs_filtered (TYPE_FIELD_NAME (domain, i), stream);
+ if (extra)
+ fprintf_filtered (stream, " + %d bytes", extra);
+ if (bits)
+ fprintf_filtered (stream, " (offset in bits)");
+ }
+ else
+ fprintf_filtered (stream, "%d", val >> 3);
+}
+
/* Print data of type TYPE located at VALADDR (within GDB),
which came from the inferior at address ADDRESS,
onto stdio stream STREAM according to FORMAT
}
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_MEMBER)
{
- struct type *domain = TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type));
-
- /* VAL is a byte offset into the structure type DOMAIN.
- Find the name of the field for that offset and
- print it. */
- int extra = 0;
- int bits = 0;
- len = TYPE_NFIELDS (domain);
- /* @@ Make VAL into bit offset */
- val = unpack_long (builtin_type_int, valaddr) << 3;
- for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
- {
- int bitpos = TYPE_FIELD_BITPOS (domain, i);
- QUIT;
- if (val == bitpos)
- break;
- if (val < bitpos && i != 0)
- {
- /* Somehow pointing into a field. */
- i -= 1;
- extra = (val - TYPE_FIELD_BITPOS (domain, i));
- if (extra & 0x7)
- bits = 1;
- else
- extra >>= 3;
- break;
- }
- }
- if (i < len)
- {
- fprintf_filtered (stream, "&");
- type_print_base (domain, stream, 0, 0);
- fprintf_filtered (stream, "::");
- fputs_filtered (TYPE_FIELD_NAME (domain, i), stream);
- if (extra)
- fprintf_filtered (stream, " + %d bytes", extra);
- if (bits)
- fprintf_filtered (stream, " (offset in bits)");
- break;
- }
- fprintf_filtered (stream, "%d", val >> 3);
+ print_class_member (valaddr,
+ TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type)),
+ stream, "&");
}
else
{
break;
case TYPE_CODE_REF:
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_MEMBER)
+ {
+ print_class_member (valaddr,
+ TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type)),
+ stream, "");
+ break;
+ }
if (addressprint)
{
fprintf_filtered (stream, "@0x%lx",
int show;
int passed_a_ptr;
{
+ char *name;
if (type == 0)
return;
type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0,
0);
fprintf_filtered (stream, " ");
- type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0,
- passed_a_ptr);
+ name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
+ if (name)
+ fputs_filtered (name, stream);
+ else
+ type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
fprintf_filtered (stream, "::");
break;
return;
}
- if (TYPE_NAME (type) && show <= 0)
+ /* If the type is a fundamental type, then always print the type name
+ directly from the type. Also print the type name directly whenever
+ SHOW drops to zero and there is a valid type name to print. */
+
+ if ((TYPE_FLAGS (type) & TYPE_FLAG_FUND_TYPE) ||
+ ((show <= 0) && (TYPE_NAME (type) != NULL)))
{
fputs_filtered (TYPE_NAME (type), stream);
return;
}
break;
- case TYPE_CODE_INT:
- name = 0;
- if (TYPE_LENGTH (type) <= sizeof (LONGEST))
- {
- if (TYPE_UNSIGNED (type))
- name = unsigned_type_table[TYPE_LENGTH (type)];
- else
- name = signed_type_table[TYPE_LENGTH (type)];
- }
- if (name)
- fputs_filtered (name, stream);
- else
- fprintf_filtered (stream, "<%d bit integer>",
- TYPE_LENGTH (type) * TARGET_CHAR_BIT);
- break;
-
- case TYPE_CODE_FLT:
- name = float_type_table[TYPE_LENGTH (type)];
- fputs_filtered (name, stream);
- break;
-
case TYPE_CODE_VOID:
fprintf_filtered (stream, "void");
break;
print_max = 200;
- /* Initialize the names of the various types based on their lengths on
- the target, in bits. Note that ordering is important, so that for example,
- if ints and longs are the same size, that size will default to "int". */
-
- unsigned_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (unsigned_type_table, (1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)));
- unsigned_type_table[TARGET_CHAR_BIT/TARGET_CHAR_BIT] = "unsigned char";
- unsigned_type_table[TARGET_SHORT_BIT/TARGET_CHAR_BIT] = "unsigned short";
- unsigned_type_table[TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT] = "unsigned long long";
- unsigned_type_table[TARGET_LONG_BIT/TARGET_CHAR_BIT] = "unsigned long";
- unsigned_type_table[TARGET_INT_BIT/TARGET_CHAR_BIT] = "unsigned int";
-
- signed_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (signed_type_table, (1 + (TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT)));
- signed_type_table[TARGET_CHAR_BIT/TARGET_CHAR_BIT] = "char";
- signed_type_table[TARGET_SHORT_BIT/TARGET_CHAR_BIT] = "short";
- signed_type_table[TARGET_LONG_LONG_BIT/TARGET_CHAR_BIT] = "long long";
- signed_type_table[TARGET_LONG_BIT/TARGET_CHAR_BIT] = "long";
- signed_type_table[TARGET_INT_BIT/TARGET_CHAR_BIT] = "int";
-
- float_type_table = (char **)
- xmalloc ((1 + (TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT)) * sizeof (char *));
- bzero (float_type_table, (1 + (TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT)));
- float_type_table[TARGET_FLOAT_BIT/TARGET_CHAR_BIT] = "float";
- float_type_table[TARGET_DOUBLE_COMPLEX_BIT/TARGET_CHAR_BIT] = "double complex";
- float_type_table[TARGET_COMPLEX_BIT/TARGET_CHAR_BIT] = "complex";
- float_type_table[TARGET_LONG_DOUBLE_BIT/TARGET_CHAR_BIT] = "long double";
- float_type_table[TARGET_DOUBLE_BIT/TARGET_CHAR_BIT] = "double";
-
obstack_begin (&dont_print_obstack, 32 * sizeof (struct type *));
}