* gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise.
* gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* ada-lex.l (processInt): Likewise.
* f-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* ada-lang.c (ada_create_fundamental_type, ada_language_arch_info)
(gdbtypes_post_init, build_gdbtypes): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* parse.c (build_parse): Likewise.
* xcoffread.c (_initialize_xcoffread): Likewise.
* stabsread.c (define_symbol, read_one_struct_field, read_enum_type)
(read_range_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type, _initialize_m2_language)
(m2_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* coffread.c (coff_read_enum_type): Likewise.
* mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise.
* dwarf2read.c (new_symbol): Likewise.
* gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* ada-lex.l (processInt): Likewise.
* f-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* valarith.c (value_binop): Likewise.
* symfile.c (read_target_long_array, simple_overlay_update_1): Likewise.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
* symfile.c (TARGET_LONG_BYTES): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* coffread.c (decode_base_type): Likewise.
* gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit.
* c-exp.y (parse_number): Likewise.
* objc-exp.y (parse_number): Likewise.
* p-exp.y (parse_number): Likewise.
* ada-lang.c (ada_create_fundamental_type)
(ada_language_arch_info): Likewise.
* gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise.
* stabsread.c (read_range_type): Likewise.
* p-lang.c (pascal_create_fundamental_type): Likewise.
* objc-lang.c (objc_create_fundamental_type): Likewise.
* m2-lang.c (m2_create_fundamental_type): Likewise.
* f-lang.c (f_create_fundamental_type): Likewise.
* c-lang.c (c_create_fundamental_type): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
+2007-06-12 Markus Deuling <deuling@de.ibm.com>
+
+ * gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit.
+ * ada-lang.c (ada_create_fundamental_type)
+ (ada_language_arch_info): Likewise.
+ * c-lang.c (c_create_fundamental_type): Likewise.
+ * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise.
+ * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
+ * m2-lang.c (m2_create_fundamental_type): Likewise.
+ * objc-lang.c (objc_create_fundamental_type): Likewise.
+ * p-lang.c (pascal_create_fundamental_type): Likewise.
+ * gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit.
+ * c-exp.y (parse_number): Likewise.
+ * objc-exp.y (parse_number): Likewise.
+ * ada-lex.l (processInt): Likewise.
+ * f-exp.y (parse_number): Likewise.
+ * p-exp.y (parse_number): Likewise.
+ * ada-lang.c (ada_create_fundamental_type, ada_language_arch_info)
+ (gdbtypes_post_init, build_gdbtypes): Likewise.
+ * p-lang.c (pascal_create_fundamental_type): Likewise.
+ * parse.c (build_parse): Likewise.
+ * xcoffread.c (_initialize_xcoffread): Likewise.
+ * stabsread.c (define_symbol, read_one_struct_field, read_enum_type)
+ (read_range_type): Likewise.
+ * objc-lang.c (objc_create_fundamental_type): Likewise.
+ * f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise.
+ * m2-lang.c (m2_create_fundamental_type, _initialize_m2_language)
+ (m2_create_fundamental_type): Likewise.
+ * c-lang.c (c_create_fundamental_type): Likewise.
+ * coffread.c (coff_read_enum_type): Likewise.
+ * mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise.
+ * dwarf2read.c (new_symbol): Likewise.
+ * gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit.
+ * c-exp.y (parse_number): Likewise.
+ * objc-exp.y (parse_number): Likewise.
+ * ada-lex.l (processInt): Likewise.
+ * f-exp.y (parse_number): Likewise.
+ * p-exp.y (parse_number): Likewise.
+ * valarith.c (value_binop): Likewise.
+ * symfile.c (read_target_long_array, simple_overlay_update_1): Likewise.
+ * ada-lang.c (ada_create_fundamental_type)
+ (ada_language_arch_info): Likewise.
+ * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise.
+ * symfile.c (TARGET_LONG_BYTES): Likewise.
+ * p-lang.c (pascal_create_fundamental_type): Likewise.
+ * objc-lang.c (objc_create_fundamental_type): Likewise.
+ * m2-lang.c (m2_create_fundamental_type): Likewise.
+ * f-lang.c (f_create_fundamental_type): Likewise.
+ * c-lang.c (c_create_fundamental_type): Likewise.
+ * coffread.c (decode_base_type): Likewise.
+ * gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit.
+ * c-exp.y (parse_number): Likewise.
+ * objc-exp.y (parse_number): Likewise.
+ * p-exp.y (parse_number): Likewise.
+ * ada-lang.c (ada_create_fundamental_type)
+ (ada_language_arch_info): Likewise.
+ * gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise.
+ * stabsread.c (read_range_type): Likewise.
+ * p-lang.c (pascal_create_fundamental_type): Likewise.
+ * objc-lang.c (objc_create_fundamental_type): Likewise.
+ * m2-lang.c (m2_create_fundamental_type): Likewise.
+ * f-lang.c (f_create_fundamental_type): Likewise.
+ * c-lang.c (c_create_fundamental_type): Likewise.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
2007-06-12 Andreas Schwab <schwab@suse.de>
* frame-unwind.h (frame_dealloc_cache_ftype): Define.
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no Ada fundamental type %d"), typeid);
break;
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short_integer", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short_integer", objfile);
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer", objfile);
break;
case FT_SIGNED_INTEGER:
- type = init_type (TYPE_CODE_INT, TARGET_INT_BIT /
- TARGET_CHAR_BIT,
+ type = init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long_integer", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long_integer", objfile);
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
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, "long_long_integer", objfile);
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
+ 0, "long_long_integer", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_long_integer", objfile);
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
+ 0, "long_long_integer", 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);
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT,
= GDBARCH_OBSTACK_CALLOC (current_gdbarch, nr_ada_primitive_types + 1,
struct type *);
lai->primitive_type_vector [ada_primitive_type_int] =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "integer", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long] =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_integer", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "long_integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_short] =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0, "short_integer", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "short_integer", (struct objfile *) NULL);
lai->string_char_type =
lai->primitive_type_vector [ada_primitive_type_char] =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_long] =
- init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_INT,
+ gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long_long_integer", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_long_double] =
init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "long_long_float", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_natural] =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "natural", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "natural", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_positive] =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "positive", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "positive", (struct objfile *) NULL);
lai->primitive_type_vector [ada_primitive_type_void] = builtin->builtin_void;
lai->primitive_type_vector [ada_primitive_type_system_address] =
exp -= 1;
}
- if ((result >> (TARGET_INT_BIT-1)) == 0)
+ if ((result >> (gdbarch_int_bit (current_gdbarch)-1)) == 0)
yylval.typed_val.type = type_int ();
- else if ((result >> (TARGET_LONG_BIT-1)) == 0)
+ else if ((result >> (gdbarch_long_bit (current_gdbarch)-1)) == 0)
yylval.typed_val.type = type_long ();
- else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
+ else if (((result >> (gdbarch_long_bit (current_gdbarch)-1)) >> 1) == 0)
{
/* We have a number representable as an unsigned integer quantity.
For consistency with the C treatment, we will treat it as an
shift it right and see whether anything remains. Note that we
can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
operation, because many compilers will warn about such a shift
- (which always produces a zero result). Sometimes TARGET_INT_BIT
- or TARGET_LONG_BIT will be that big, sometimes not. To deal with
+ (which always produces a zero result). Sometimes gdbarch_int_bit
+ or gdbarch_long_bit will be that big, sometimes not. To deal with
the case where it is we just always shift the value more than
once, with fewer bits each time. */
un = (ULONGEST)n >> 2;
if (long_p == 0
- && (un >> (TARGET_INT_BIT - 2)) == 0)
+ && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
/* A large decimal (not hex or octal) constant (between INT_MAX
and UINT_MAX) is a long or unsigned long, according to ANSI,
signed_type = builtin_type (current_gdbarch)->builtin_int;
}
else if (long_p <= 1
- && (un >> (TARGET_LONG_BIT - 2)) == 0)
+ && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long;
signed_type = builtin_type (current_gdbarch)->builtin_long;
}
else
{
int shift;
- if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+ if (sizeof (ULONGEST) * HOST_CHAR_BIT
+ < gdbarch_long_long_bit (current_gdbarch))
/* A long long does not fit in a LONGEST. */
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
else
- shift = (TARGET_LONG_LONG_BIT - 1);
+ shift = (gdbarch_long_long_bit (current_gdbarch) - 1);
high_bit = (ULONGEST) 1 << shift;
unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long_long;
signed_type = builtin_type (current_gdbarch)->builtin_long_long;
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no C/C++ fundamental type %d"), typeid);
break;
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
case T_LONG:
if (cs->c_sclass == C_FIELD
- && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+ && aux->x_sym.x_misc.x_lnsz.x_size
+ > gdbarch_long_bit (current_gdbarch))
return lookup_fundamental_type (current_objfile, FT_LONG_LONG);
else
return lookup_fundamental_type (current_objfile, FT_LONG);
case T_ULONG:
if (cs->c_sclass == C_FIELD
- && aux->x_sym.x_misc.x_lnsz.x_size > TARGET_LONG_BIT)
+ && aux->x_sym.x_misc.x_lnsz.x_size
+ > gdbarch_long_bit (current_gdbarch))
return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG_LONG);
else
return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
if (length > 0)
TYPE_LENGTH (type) = length;
- else
- TYPE_LENGTH (type) = TARGET_INT_BIT / TARGET_CHAR_BIT; /* Assume ints */
+ else /* Assume ints. */
+ TYPE_LENGTH (type) = gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT;
TYPE_CODE (type) = TYPE_CODE_ENUM;
TYPE_NFIELDS (type) = nsyms;
TYPE_FIELDS (type) = (struct field *)
to something sensible. */
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
SYMBOL_TYPE (sym) = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / HOST_CHAR_BIT, 0,
- "<variable, no debug info>",
+ gdbarch_int_bit (current_gdbarch)
+ / HOST_CHAR_BIT,
+ 0, "<variable, no debug info>",
objfile);
attr = dwarf2_attr (die, DW_AT_const_value, cu);
if (attr)
target int size is different to the target long size.
In the expression below, we could have tested
- (n >> TARGET_INT_BIT)
+ (n >> gdbarch_int_bit (current_gdbarch))
to see if it was zero,
but too many compilers warn about that, when ints and longs
are the same size. So we shift it twice, with fewer bits
each time, for the same result. */
- if ((TARGET_INT_BIT != TARGET_LONG_BIT
- && ((n >> 2) >> (TARGET_INT_BIT-2))) /* Avoid shift warning */
+ if ((gdbarch_int_bit (current_gdbarch) != gdbarch_long_bit (current_gdbarch)
+ && ((n >> 2)
+ >> (gdbarch_int_bit (current_gdbarch)-2))) /* Avoid shift warning */
|| long_p)
{
- high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch)-1);
unsigned_type = builtin_type_unsigned_long;
signed_type = builtin_type_long;
}
else
{
- high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch)-1);
unsigned_type = builtin_type_unsigned_int;
signed_type = builtin_type_int;
}
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer*2", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_BOOL,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "logical*2", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer*4", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_BOOL,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "logical*4", objfile);
break;
case FT_FIXED_DECIMAL:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "fixed decimal", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no F77 fundamental type %d"), typeid);
break;
"logical*1", (struct objfile *) NULL);
builtin_type_f_integer_s2 =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
- "integer*2", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "integer*2", (struct objfile *) NULL);
builtin_type_f_logical_s2 =
- init_type (TYPE_CODE_BOOL, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "logical*2", (struct objfile *) NULL);
+ init_type (TYPE_CODE_BOOL,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "logical*2", (struct objfile *) NULL);
builtin_type_f_integer =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "integer", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "integer", (struct objfile *) NULL);
builtin_type_f_logical =
- init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "logical*4", (struct objfile *) NULL);
+ init_type (TYPE_CODE_BOOL,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "logical*4", (struct objfile *) NULL);
builtin_type_f_real =
init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
- current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
+ current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit;
current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
- current_gdbarch->ptr_bit = TARGET_INT_BIT;
+ current_gdbarch->ptr_bit = current_gdbarch->int_bit;
current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
current_gdbarch->char_signed = -1;
current_gdbarch->write_pc = generic_target_write_pc;
fprintf_unfiltered (file,
"gdbarch_dump: inner_than = <0x%lx>\n",
(long) current_gdbarch->inner_than);
-#ifdef TARGET_INT_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_INT_BIT # %s\n",
- XSTRING (TARGET_INT_BIT));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: int_bit = %s\n",
paddr_d (current_gdbarch->int_bit));
fprintf_unfiltered (file,
"gdbarch_dump: integer_to_address = <0x%lx>\n",
(long) current_gdbarch->integer_to_address);
-#ifdef TARGET_LONG_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_LONG_BIT # %s\n",
- XSTRING (TARGET_LONG_BIT));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: long_bit = %s\n",
paddr_d (current_gdbarch->long_bit));
fprintf_unfiltered (file,
"gdbarch_dump: long_double_format = %s\n",
pformat (current_gdbarch->long_double_format));
-#ifdef TARGET_LONG_LONG_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
- XSTRING (TARGET_LONG_LONG_BIT));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: long_long_bit = %s\n",
paddr_d (current_gdbarch->long_long_bit));
fprintf_unfiltered (file,
"gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
(long) current_gdbarch->sdb_reg_to_regnum);
-#ifdef TARGET_SHORT_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
- XSTRING (TARGET_SHORT_BIT));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: short_bit = %s\n",
paddr_d (current_gdbarch->short_bit));
extern int gdbarch_short_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_SHORT_BIT)
-#error "Non multi-arch definition of TARGET_SHORT_BIT"
-#endif
-#if !defined (TARGET_SHORT_BIT)
-#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
-#endif
/* Number of bits in an int or unsigned int for the target machine. */
extern int gdbarch_int_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_INT_BIT)
-#error "Non multi-arch definition of TARGET_INT_BIT"
-#endif
-#if !defined (TARGET_INT_BIT)
-#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
-#endif
/* Number of bits in a long or unsigned long for the target machine. */
extern int gdbarch_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_BIT)
-#error "Non multi-arch definition of TARGET_LONG_BIT"
-#endif
-#if !defined (TARGET_LONG_BIT)
-#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
-#endif
/* Number of bits in a long long or unsigned long long for the target
machine. */
extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_LONG_LONG_BIT)
-#error "Non multi-arch definition of TARGET_LONG_LONG_BIT"
-#endif
-#if !defined (TARGET_LONG_LONG_BIT)
-#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
-#endif
/* The ABI default bit-size and format for "float", "double", and "long
double". These bit/format pairs should eventually be combined into
# v:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
#
# Number of bits in a short or unsigned short for the target machine.
-v:TARGET_SHORT_BIT:int:short_bit:::8 * sizeof (short):2*TARGET_CHAR_BIT::0
+v::int:short_bit:::8 * sizeof (short):2*TARGET_CHAR_BIT::0
# Number of bits in an int or unsigned int for the target machine.
-v:TARGET_INT_BIT:int:int_bit:::8 * sizeof (int):4*TARGET_CHAR_BIT::0
+v::int:int_bit:::8 * sizeof (int):4*TARGET_CHAR_BIT::0
# Number of bits in a long or unsigned long for the target machine.
-v:TARGET_LONG_BIT:int:long_bit:::8 * sizeof (long):4*TARGET_CHAR_BIT::0
+v::int:long_bit:::8 * sizeof (long):4*TARGET_CHAR_BIT::0
# Number of bits in a long long or unsigned long long for the target
# machine.
-v:TARGET_LONG_LONG_BIT:int:long_long_bit:::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
+v::int:long_long_bit:::8 * sizeof (LONGEST):2*current_gdbarch->long_bit::0
# The ABI default bit-size and format for "float", "double", and "long
# double". These bit/format pairs should eventually be combined into
# as well.
#
# ptr_bit is the size of a pointer on the target
-v:TARGET_PTR_BIT:int:ptr_bit:::8 * sizeof (void*):TARGET_INT_BIT::0
+v:TARGET_PTR_BIT:int:ptr_bit:::8 * sizeof (void*):current_gdbarch->int_bit::0
# addr_bit is the size of a target address as represented in gdb
v:TARGET_ADDR_BIT:int:addr_bit:::8 * sizeof (void*):0:TARGET_PTR_BIT:
# Number of bits in a BFD_VMA for the target object file format.
TYPE_FLAG_UNSIGNED,
"unsigned char", (struct objfile *) NULL);
builtin_type_short =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
- "short", (struct objfile *) NULL);
+ 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, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned short", (struct objfile *) NULL);
+ 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, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "int", (struct objfile *) NULL);
+ 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, TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned int", (struct objfile *) NULL);
+ 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, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long", (struct objfile *) NULL);
+ 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, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned long", (struct objfile *) NULL);
+ 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, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long long", (struct objfile *) NULL);
+ 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, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
+ 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 (TARGET_FLOAT_BIT, "float",
TARGET_FLOAT_FORMAT);
builtin_type_double = build_flt (TARGET_DOUBLE_BIT, "double",
TYPE_FLAG_UNSIGNED,
"unsigned char", (struct objfile *) NULL);
builtin_type->builtin_short =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
- "short", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "short", (struct objfile *) NULL);
builtin_type->builtin_unsigned_short =
- init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned short", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned short", (struct objfile *) NULL);
builtin_type->builtin_int =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "int", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "int", (struct objfile *) NULL);
builtin_type->builtin_unsigned_int =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned int", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned int", (struct objfile *) NULL);
builtin_type->builtin_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "long", (struct objfile *) NULL);
builtin_type->builtin_unsigned_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned long", (struct objfile *) NULL);
+ init_type
+ (TYPE_CODE_INT, gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned long", (struct objfile *) NULL);
builtin_type->builtin_long_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long long", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "long long", (struct objfile *) NULL);
builtin_type->builtin_unsigned_long_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "unsigned long long", (struct objfile *) NULL);
+ 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->builtin_float
= build_flt (gdbarch_float_bit (gdbarch), "float",
gdbarch_float_format (gdbarch));
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no Modula fundamental type %d"), typeid);
break;
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_FIXED_DECIMAL:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "fixed decimal", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
{
/* Modula-2 "pervasive" types. NOTE: these can be redefined!!! */
builtin_type_m2_int =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "INTEGER", (struct objfile *) NULL);
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 0, "INTEGER", (struct objfile *) NULL);
builtin_type_m2_card =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"CARDINAL", (struct objfile *) NULL);
builtin_type_m2_real =
TYPE_FLAG_UNSIGNED,
"CHAR", (struct objfile *) NULL);
builtin_type_m2_bool =
- init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_BOOL,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED,
"BOOLEAN", (struct objfile *) NULL);
that too. */
if (TYPE_LENGTH (t) == TYPE_NFIELDS (t)
|| TYPE_LENGTH (t) == 0)
- TYPE_LENGTH (t) = TARGET_INT_BIT / HOST_CHAR_BIT;
+ TYPE_LENGTH (t) =
+ gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT;
for (ext_tsym = ext_sh + external_sym_size;
;
ext_tsym += external_sym_size)
TYPE_CODE_ERROR print things in hex if it knows the size? */
mdebug_type_fixed_dec =
init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "fixed decimal",
(struct objfile *) NULL);
"<function, no debug info>", NULL);
TYPE_TARGET_TYPE (nodebug_func_symbol_type) = mdebug_type_int;
nodebug_var_symbol_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
"<variable, no debug info>", NULL);
}
shift it right and see whether anything remains. Note that we
can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
operation, because many compilers will warn about such a shift
- (which always produces a zero result). Sometimes TARGET_INT_BIT
- or TARGET_LONG_BIT will be that big, sometimes not. To deal with
+ (which always produces a zero result). Sometimes gdbarch_int_bit
+ or gdbarch_long_int will be that big, sometimes not. To deal with
the case where it is we just always shift the value more than
once, with fewer bits each time. */
un = (unsigned LONGEST)n >> 2;
if (long_p == 0
- && (un >> (TARGET_INT_BIT - 2)) == 0)
+ && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
+ high_bit = ((unsigned LONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
/* A large decimal (not hex or octal) constant (between INT_MAX
and UINT_MAX) is a long or unsigned long, according to ANSI,
signed_type = builtin_type_int;
}
else if (long_p <= 1
- && (un >> (TARGET_LONG_BIT - 2)) == 0)
+ && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
+ high_bit = ((unsigned LONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
unsigned_type = builtin_type_unsigned_long;
signed_type = builtin_type_long;
}
else
{
high_bit = (((unsigned LONGEST)1)
- << (TARGET_LONG_LONG_BIT - 32 - 1)
+ << (gdbarch_long_long_bit (current_gdbarch) - 32 - 1)
<< 16
<< 16);
if (high_bit == 0)
the type reconstruction work, this should probably become
an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no C/C++ fundamental type %d"), typeid);
break;
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit (current_gdbarch)
+ / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
shift it right and see whether anything remains. Note that we
can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
operation, because many compilers will warn about such a shift
- (which always produces a zero result). Sometimes TARGET_INT_BIT
- or TARGET_LONG_BIT will be that big, sometimes not. To deal with
+ (which always produces a zero result). Sometimes gdbarch_int_bit
+ or gdbarch_long_bit will be that big, sometimes not. To deal with
the case where it is we just always shift the value more than
once, with fewer bits each time. */
un = (ULONGEST)n >> 2;
if (long_p == 0
- && (un >> (TARGET_INT_BIT - 2)) == 0)
+ && (un >> (gdbarch_int_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_int_bit (current_gdbarch) - 1);
/* A large decimal (not hex or octal) constant (between INT_MAX
and UINT_MAX) is a long or unsigned long, according to ANSI,
signed_type = builtin_type_int;
}
else if (long_p <= 1
- && (un >> (TARGET_LONG_BIT - 2)) == 0)
+ && (un >> (gdbarch_long_bit (current_gdbarch) - 2)) == 0)
{
- high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
+ high_bit = ((ULONGEST)1) << (gdbarch_long_bit (current_gdbarch) - 1);
unsigned_type = builtin_type_unsigned_long;
signed_type = builtin_type_long;
}
else
{
int shift;
- if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
+ if (sizeof (ULONGEST) * HOST_CHAR_BIT
+ < gdbarch_long_long_bit (current_gdbarch))
/* A long long does not fit in a LONGEST. */
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
else
- shift = (TARGET_LONG_LONG_BIT - 1);
+ shift = (gdbarch_long_long_bit (current_gdbarch) - 1);
high_bit = (ULONGEST) 1 << shift;
unsigned_type = builtin_type_unsigned_long_long;
signed_type = builtin_type_long_long;
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning (_("internal error: no Pascal fundamental type %d"), typeid);
break;
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "integer", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "word", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "longint", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "longint", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "cardinal", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit
+ (current_gdbarch) / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit
+ (current_gdbarch) / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ gdbarch_long_long_bit
+ (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
msym_data_symbol_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
"<data variable, no debug info>", NULL);
msym_unknown_symbol_type =
init_type (TYPE_CODE_INT, 1, 0,
NULL);
msym_tls_symbol_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
"<thread local variable, no debug info>", NULL);
}
/* Call it "int" because this is mainly C lossage. */
if (pcc_promotion_type == NULL)
pcc_promotion_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "int", NULL);
if (pcc_unsigned_promotion_type == NULL)
pcc_unsigned_promotion_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", NULL);
/* If PCC says a parameter is a short or a char, it is
if ((FIELD_BITSIZE (fip->list->field)
== TARGET_CHAR_BIT * TYPE_LENGTH (field_type)
|| (TYPE_CODE (field_type) == TYPE_CODE_ENUM
- && FIELD_BITSIZE (fip->list->field) == TARGET_INT_BIT)
+ && FIELD_BITSIZE (fip->list->field)
+ == gdbarch_int_bit (current_gdbarch))
)
&&
FIELD_BITPOS (fip->list->field) % 8 == 0)
/* Now fill in the fields of the type-structure. */
- TYPE_LENGTH (type) = TARGET_INT_BIT / HOST_CHAR_BIT;
+ TYPE_LENGTH (type) = gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT;
TYPE_CODE (type) = TYPE_CODE_ENUM;
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
if (unsigned_enum)
/* It is unsigned int or unsigned long. */
/* GCC 2.3.3 uses this for long long too, but that is just a GDB 3.5
compatibility hack. */
- return init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ return init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, NULL, objfile);
}
of self_subrange. */
else if (n3 == 0 && n2 < 0
&& (self_subrange
- || n2 == -TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT))
+ || n2 == -gdbarch_long_long_bit
+ (current_gdbarch) / TARGET_CHAR_BIT))
return init_type (TYPE_CODE_INT, -n2, 0, NULL, objfile);
else if (n2 == -n3 - 1)
{
_("base type %d of range type is not defined"), rangenums[1]);
if (range_type_index == NULL)
range_type_index =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "range type index type", NULL);
index_type = range_type_index;
}
{
VMA, SIZE, LMA, MAPPED
};
-#define TARGET_LONG_BYTES (TARGET_LONG_BIT / TARGET_CHAR_BIT)
+#define TARGET_LONG_BYTES (gdbarch_long_bit (current_gdbarch) \
+ / TARGET_CHAR_BIT)
/* Throw away the cached copy of _ovly_table */
static void
/* Can't just call init_type because we wouldn't know what
name to give the type. */
val = allocate_value
- (result_len > TARGET_LONG_BIT / HOST_CHAR_BIT
+ (result_len > gdbarch_long_bit (current_gdbarch) / HOST_CHAR_BIT
? builtin_type_unsigned_long_long
: builtin_type_unsigned_long);
store_unsigned_integer (value_contents_raw (val),
/* Can't just call init_type because we wouldn't know what
name to give the type. */
val = allocate_value
- (result_len > TARGET_LONG_BIT / HOST_CHAR_BIT
+ (result_len > gdbarch_long_bit (current_gdbarch) / HOST_CHAR_BIT
? builtin_type_long_long
: builtin_type_long);
store_signed_integer (value_contents_raw (val),
"<function, no debug info>", NULL);
TYPE_TARGET_TYPE (func_symbol_type) = builtin_type_int;
var_symbol_type =
- init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ init_type (TYPE_CODE_INT,
+ gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
"<variable, no debug info>", NULL);
}